PingResponseHandler implements ResponseHandler { @Override public void onSuccess( Map<String,Value> metadata ) { log.trace( "Channel %s pinged successfully", channel ); result.setSuccess( true ); } PingResponseHandler( Promise<Boolean> result, Channel channel, Logger log ); @Override void onSuccess( Map<String,Value> metadata ); @Override void onFailure( Throwable error ); @Override void onRecord( Value[] fields );  }
@Test void shouldResolvePromiseOnSuccess() { Promise<Boolean> promise = newPromise(); PingResponseHandler handler = newHandler( promise ); handler.onSuccess( emptyMap() ); assertTrue( promise.isSuccess() ); assertTrue( promise.getNow() ); }