CommitTxResponseHandler implements ResponseHandler { @Override public void onFailure( Throwable error ) { commitFuture.completeExceptionally( error ); } CommitTxResponseHandler( CompletableFuture<Bookmark> commitFuture ); @Override void onSuccess( Map<String,Value> metadata ); @Override void onFailure( Throwable error ); @Override void onRecord( Value[] fields );  }
@Test void shouldHandleFailure() { RuntimeException error = new RuntimeException( "Hello" ); handler.onFailure( error ); RuntimeException receivedError = assertThrows( RuntimeException.class, () -> await( future ) ); assertEquals( error, receivedError ); }