diff --git a/servicetalk-loadbalancer-experimental/src/test/java/io/servicetalk/loadbalancer/DefaultHostTest.java b/servicetalk-loadbalancer-experimental/src/test/java/io/servicetalk/loadbalancer/DefaultHostTest.java index 45382472ec..70983e0a62 100644 --- a/servicetalk-loadbalancer-experimental/src/test/java/io/servicetalk/loadbalancer/DefaultHostTest.java +++ b/servicetalk-loadbalancer-experimental/src/test/java/io/servicetalk/loadbalancer/DefaultHostTest.java @@ -80,7 +80,7 @@ void cleanup() { } } - private void buildHost(@Nullable HealthIndicator healthIndicator) { + private void buildHost(@Nullable HealthIndicator healthIndicator) { host = new DefaultHost<>("lbDescription", DEFAULT_ADDRESS, LinearSearchConnectionSelector.factory(DEFAULT_LINEAR_SEARCH_SPACE) .buildConnectionSelector("resource"), @@ -206,7 +206,7 @@ void hostStatus() throws Exception { @Test void healthIndicatorInfluencesHealthStatus() { - HealthIndicator healthIndicator = mock(HealthIndicator.class); + HealthIndicator healthIndicator = mock(HealthIndicator.class); when(healthIndicator.isHealthy()).thenReturn(true); buildHost(healthIndicator); assertThat(host.isHealthy(), is(true)); @@ -216,7 +216,7 @@ void healthIndicatorInfluencesHealthStatus() { @Test void forwardsHealthIndicatorScore() { - HealthIndicator healthIndicator = mock(HealthIndicator.class); + HealthIndicator healthIndicator = mock(HealthIndicator.class); when(healthIndicator.score()).thenReturn(10); buildHost(healthIndicator); assertThat(host.score(), is(10)); @@ -226,7 +226,7 @@ void forwardsHealthIndicatorScore() { @Test void connectFailuresAreForwardedToHealthIndicator() { connectionFactory = new TestConnectionFactory(address -> failed(DELIBERATE_EXCEPTION)); - HealthIndicator healthIndicator = mock(HealthIndicator.class); + HealthIndicator healthIndicator = mock(HealthIndicator.class); buildHost(healthIndicator); Throwable underlying = assertThrows(ExecutionException.class, () -> host.newConnection(cxn -> true, false, null).toFuture().get()).getCause(); diff --git a/servicetalk-loadbalancer-experimental/src/test/java/io/servicetalk/loadbalancer/SelectorTestHelpers.java b/servicetalk-loadbalancer-experimental/src/test/java/io/servicetalk/loadbalancer/SelectorTestHelpers.java index cc987448a5..5527105d5d 100644 --- a/servicetalk-loadbalancer-experimental/src/test/java/io/servicetalk/loadbalancer/SelectorTestHelpers.java +++ b/servicetalk-loadbalancer-experimental/src/test/java/io/servicetalk/loadbalancer/SelectorTestHelpers.java @@ -58,7 +58,8 @@ static List> generateHosts(boolean equa return results; } - private static Host mockHost(String addr, TestLoadBalancedConnection connection) { + private static Host mockHost( + String addr, TestLoadBalancedConnection connection) { Host host = mock(Host.class); when(host.address()).thenReturn(addr); when(host.isHealthy()).thenReturn(true); diff --git a/servicetalk-loadbalancer-experimental/src/test/java/io/servicetalk/loadbalancer/XdsOutlierDetectorAlgorithmTest.java b/servicetalk-loadbalancer-experimental/src/test/java/io/servicetalk/loadbalancer/XdsOutlierDetectorAlgorithmTest.java index 9c39655174..d67a8519d1 100644 --- a/servicetalk-loadbalancer-experimental/src/test/java/io/servicetalk/loadbalancer/XdsOutlierDetectorAlgorithmTest.java +++ b/servicetalk-loadbalancer-experimental/src/test/java/io/servicetalk/loadbalancer/XdsOutlierDetectorAlgorithmTest.java @@ -80,8 +80,10 @@ void healthChecksAreScheduled() { void cancellation() { config = withAllEnforcing().maxEjectionPercentage(100).build(); outlierDetector = buildOutlierDetector(); - HealthIndicator indicator1 = outlierDetector.newHealthIndicator("address-1", observer()); - HealthIndicator indicator2 = outlierDetector.newHealthIndicator("address-2", observer()); + HealthIndicator indicator1 = + outlierDetector.newHealthIndicator("address-1", observer()); + HealthIndicator indicator2 = + outlierDetector.newHealthIndicator("address-2", observer()); eject(indicator1); eject(indicator2); assertFalse(indicator1.isHealthy()); @@ -110,7 +112,8 @@ void withoutOutlierDetectorsWeStillDecrementFailureMultiplier() { .build(); outlierDetector = buildOutlierDetector(); - HealthIndicator indicator1 = outlierDetector.newHealthIndicator("address-1", observer()); + HealthIndicator indicator1 = + outlierDetector.newHealthIndicator("address-1", observer()); eject(indicator1); assertFalse(indicator1.isHealthy()); testExecutor.advanceTimeBy(config.baseEjectionTime().toNanos(), TimeUnit.NANOSECONDS); @@ -133,12 +136,12 @@ void withoutOutlierDetectorsWeStillDecrementFailureMultiplier() { private void testEjectPercentage(int maxEjectPercentage) { config = withAllEnforcing().maxEjectionPercentage(maxEjectPercentage).build(); outlierDetector = buildOutlierDetector(); - List healthIndicators = new ArrayList<>(4); + List> healthIndicators = new ArrayList<>(4); for (int i = 0; i < 4; i++) { healthIndicators.add(outlierDetector.newHealthIndicator("address-" + i, observer())); } - for (HealthIndicator indicator : healthIndicators) { + for (HealthIndicator indicator : healthIndicators) { eject(indicator); } @@ -147,7 +150,7 @@ private void testEjectPercentage(int maxEjectPercentage) { .filter(indicator -> !indicator.isHealthy()).collect(Collectors.toList()), hasSize(expectedFailed)); } - private void eject(HealthIndicator indicator) { + private void eject(HealthIndicator indicator) { for (int i = 0; i < config.consecutive5xx(); i++) { if (!indicator.isHealthy()) { break;