@Test
public void allFailingNoInstanceAvailable() {
loadBalancer.addServiceEndpoint(new ServiceEndpoint(executor, "localhost:20001", "dc1", dependencyHealthCheck));
loadBalancer.addServiceEndpoint(new ServiceEndpoint(executor, "localhost:20002", "dc1", dependencyHealthCheck));
loadBalancer.addServiceEndpoint(new ServiceEndpoint(executor, "localhost:20003", "dc1", dependencyHealthCheck));
rpcClient = clientFactory.newClient(serviceName, "testing", FrameworkTest.Foobar.class).
withRetries(4).build();
httpClient.makeFailing();
int failureCount = 0;
try {
rpcClient.callSynchronous(FrameworkTest.Foobar.newBuilder().build(), new OrangeContext());
} catch (java.lang.Exception e) {
e.printStackTrace();
failureCount++;
}
assertThat(failureCount).isEqualTo(1);
assertThat(httpClient.verifyRequestsProcessed(1, "localhost:20001")).isTrue();
assertThat(httpClient.verifyRequestsProcessed(1, "localhost:20002")).isTrue();
assertThat(httpClient.verifyRequestsProcessed(1, "localhost:20003")).isTrue();
}