ResetResponseHandler implements ResponseHandler { @Override public final void onFailure( Throwable error ) { resetCompleted( false ); } ResetResponseHandler( InboundMessageDispatcher messageDispatcher );  ResetResponseHandler( InboundMessageDispatcher messageDispatcher, CompletableFuture<Void> completionFuture ); @Override final void onSuccess( Map<String,Value> metadata ); @Override final void onFailure( Throwable error ); @Override final void onRecord( Value[] fields );  }
@Test void shouldCompleteFutureOnFailure() throws Exception { CompletableFuture<Void> future = new CompletableFuture<>(); ResetResponseHandler handler = newHandler( future ); assertFalse( future.isDone() ); handler.onFailure( new RuntimeException() ); assertTrue( future.isDone() ); assertNull( future.get() ); }