PipelineClient implements Closeable { public EventSource fetch() { final URI uri = UriBuilder.fromUri(destination).path("/events").build(); LOGGER.debug("GET {}", uri); final WebTarget target = client.target(uri); return EventSource.target(target).build(); } PipelineClient(@Nonnull final Client client, @Nonnull final URI destination); EventSource fetch(); boolean ping(); String version(); @Override void close();  }
@Test public void testFetch() throws Exception { final CountDownLatch latch = new CountDownLatch(10); final EventSource source = client.fetch(); final EventListener listener = new EventListener() { @Override public void onEvent(InboundEvent inboundEvent) { latch.countDown(); } }; source.register(listener, "message-to-client"); source.open(); latch.await(10, TimeUnit.SECONDS); source.close(); }