@Test public void testAsyncOneWay() throws InterruptedException, ExecutionException, TTransportException, IOException { final CountDownLatch latch = new CountDownLatch(1); try (DelayedMap.AsyncClient client = createClient(DelayedMap.AsyncClient.class, syncServer).get()) { ListenableFuture<Void> onewayFuture = client.onewayPutValueSlowly(100, TimeUnit.MILLISECONDS, "testKey", "testValue"); Futures.addCallback( onewayFuture, new FutureCallback<Void>() { @Override public void onSuccess(Void result) { latch.countDown(); } @Override public void onFailure(Throwable t) { fail("Async call to onewayPutValueSlowly failed", t); } }); assertTrue(latch.await(500, TimeUnit.MILLISECONDS)); } }