@Test public void testGetServicesHttpException() throws Exception { final Exception testingException = new Exception("testing exception"); ListenableFuture<ServiceDescriptors> future = createClient( request -> { throw testingException; }) .getServices("testService", "testPool"); try { future.get(); fail("Expected ExecutionException"); } catch (ExecutionException e) { assertInstanceOf(e.getCause(), DiscoveryException.class); assertEquals(e.getCause().getCause(), testingException); assertEquals(e.getCause().getMessage(), "Lookup of testService failed"); } }
@Override public ListenableFuture<ServiceDescriptors> getServices(String type) { requireNonNull(type, "type is null"); return lookup(type, null, null); }
HttpDiscoveryLookupClient implements DiscoveryLookupClient { @Override public ListenableFuture<ServiceDescriptors> getServices(String type) { requireNonNull(type, "type is null"); return lookup(type, null, null); } }
HttpDiscoveryLookupClient implements DiscoveryLookupClient { @Override public ListenableFuture<ServiceDescriptors> getServices(String type) { requireNonNull(type, "type is null"); return lookup(type, null, null); } @Inject  HttpDiscoveryLookupClient(NodeInfo nodeInfo,
            JsonCodec<ServiceDescriptorsRepresentation> serviceDescriptorsCodec,
            @ForDiscoveryClient HttpClient httpClient,
            ServiceInventory serviceInventory); }
HttpDiscoveryLookupClient implements DiscoveryLookupClient { @Override public ListenableFuture<ServiceDescriptors> getServices(String type) { requireNonNull(type, "type is null"); return lookup(type, null, null); } @Inject  HttpDiscoveryLookupClient(NodeInfo nodeInfo,
            JsonCodec<ServiceDescriptorsRepresentation> serviceDescriptorsCodec,
            @ForDiscoveryClient HttpClient httpClient,
            ServiceInventory serviceInventory); @Flatten RequestStats getStats(); @Override ListenableFuture<ServiceDescriptors> getServices(String type); @Override ListenableFuture<ServiceDescriptors> getServices(String type, String pool); @Override ListenableFuture<ServiceDescriptors> refreshServices(ServiceDescriptors serviceDescriptors); }
HttpDiscoveryLookupClient implements DiscoveryLookupClient { @Override public ListenableFuture<ServiceDescriptors> getServices(String type) { requireNonNull(type, "type is null"); return lookup(type, null, null); } @Inject  HttpDiscoveryLookupClient(NodeInfo nodeInfo,
            JsonCodec<ServiceDescriptorsRepresentation> serviceDescriptorsCodec,
            @ForDiscoveryClient HttpClient httpClient,
            ServiceInventory serviceInventory); @Flatten RequestStats getStats(); @Override ListenableFuture<ServiceDescriptors> getServices(String type); @Override ListenableFuture<ServiceDescriptors> getServices(String type, String pool); @Override ListenableFuture<ServiceDescriptors> refreshServices(ServiceDescriptors serviceDescriptors);  }