Skip to content

Commit

Permalink
Remove the HealthIndicator.host() getter
Browse files Browse the repository at this point in the history
  • Loading branch information
bryce-anderson committed Mar 6, 2024
1 parent c0269f4 commit 06d1071
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,4 @@ interface HealthIndicator<ResolvedAddress, C extends LoadBalancedConnection> ext
* @param host which will be associated with this health indicator.
*/
void setHost(Host<ResolvedAddress, C> host);

/**
* Get the {@link Host} associated with this health indicator.
* @return the {@link Host} associated with this health indicator.
*/
Host<ResolvedAddress, C> host();
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,6 @@ public final void setHost(Host<ResolvedAddress, C> host) {
this.host = requireNonNull(host, "host");
}

@Override
public final Host<ResolvedAddress, C> host() {
assert host != null;
return host;
}

@Override
public final boolean isHealthy() {
final Long evictedUntilNanos = this.evictedUntilNanos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void setsHostOnHealthIndicator() throws Exception {
sendServiceDiscoveryEvents(upEvent("address-1"));
TestHealthIndicator indicator = healthChecker.getIndicators().stream()
.filter(i -> "address-1".equals(i.address)).findFirst().get();
assertNotNull(indicator.host());
assertNotNull(indicator.host);
}

@Test
Expand Down Expand Up @@ -208,11 +208,6 @@ public void setHost(final Host<String, TestLoadBalancedConnection> host) {
this.host = host;
}

@Override
public Host<String, TestLoadBalancedConnection> host() {
return host;
}

@Override
public int score() {
return 0;
Expand Down

0 comments on commit 06d1071

Please sign in to comment.