@Test public void testServerFails() throws InterruptedException { responseCode = 503; client = newEventClient(ImmutableSet.of(baseUri)); ListenableFuture<Void> future = client.post(TestingUtils.getEvents()); try { future.get(); fail("expected exception"); } catch (ExecutionException e) { assertInstanceOf(e.getCause(), UnexpectedResponseException.class); } assertEquals(servlet.lastPath, "/v2/event"); }
@SafeVarargs @Override public final <T> ListenableFuture<Void> post(T... event) throws IllegalArgumentException { requireNonNull(event, "event is null"); return post(Arrays.asList(event)); }
HttpEventClient implements EventClient { @SafeVarargs @Override public final <T> ListenableFuture<Void> post(T... event) throws IllegalArgumentException { requireNonNull(event, "event is null"); return post(Arrays.asList(event)); } }
HttpEventClient implements EventClient { @SafeVarargs @Override public final <T> ListenableFuture<Void> post(T... event) throws IllegalArgumentException { requireNonNull(event, "event is null"); return post(Arrays.asList(event)); } @Inject  HttpEventClient(
            JsonEventWriter eventWriter,
            NodeInfo nodeInfo,
            @ForEventClient HttpClient httpClient); }
HttpEventClient implements EventClient { @SafeVarargs @Override public final <T> ListenableFuture<Void> post(T... event) throws IllegalArgumentException { requireNonNull(event, "event is null"); return post(Arrays.asList(event)); } @Inject  HttpEventClient(
            JsonEventWriter eventWriter,
            NodeInfo nodeInfo,
            @ForEventClient HttpClient httpClient); @Flatten RequestStats getStats(); @SafeVarargs @Override final ListenableFuture<Void> post(T... event); @Override ListenableFuture<Void> post(final Iterable<T> events); }
HttpEventClient implements EventClient { @SafeVarargs @Override public final <T> ListenableFuture<Void> post(T... event) throws IllegalArgumentException { requireNonNull(event, "event is null"); return post(Arrays.asList(event)); } @Inject  HttpEventClient(
            JsonEventWriter eventWriter,
            NodeInfo nodeInfo,
            @ForEventClient HttpClient httpClient); @Flatten RequestStats getStats(); @SafeVarargs @Override final ListenableFuture<Void> post(T... event); @Override ListenableFuture<Void> post(final Iterable<T> events);  }