use of com.linkedin.d2.balancer.clients.DynamicClient in project rest.li by linkedin.
the class RetryClientTest method testRetry.
@Test
public void testRetry() throws Exception {
SimpleLoadBalancer balancer = prepareLoadBalancer(Arrays.asList("http://test.linkedin.com/retry1", "http://test.linkedin.com/good"));
DynamicClient dynamicClient = new DynamicClient(balancer, null);
RetryClient client = new RetryClient(dynamicClient, 3);
URI uri = URI.create("d2://retryService?arg1arg2");
RestRequest restRequest = new RestRequestBuilder(uri).build();
TrackerClientTest.TestCallback<RestResponse> restCallback = new TrackerClientTest.TestCallback<RestResponse>();
client.restRequest(restRequest, restCallback);
assertNull(restCallback.e);
assertNotNull(restCallback.t);
}
Aggregations