@SuppressWarnings({"ThrowableInstanceNeverThrown"}) @Test void testOnFailure() throws InterruptedException { Thread t = new Thread(() -> { try { resultFromParallelThread = testSubject.get(); } catch (Exception e) { resultFromParallelThread = e; } }); t.start(); assertTrue(t.isAlive()); RuntimeException exception = new MockException(); testSubject.onResult(COMMAND_MESSAGE, asCommandResultMessage(exception)); t.join(THREAD_JOIN_TIMEOUT); assertTrue(resultFromParallelThread instanceof CommandResultMessage); assertEquals(exception, ((CommandResultMessage) resultFromParallelThread).exceptionResult()); }
@Override public void onResult(CommandMessage<? extends C> commandMessage, CommandResultMessage<? extends R> commandResultMessage) { super.complete(commandResultMessage); }
FutureCallback extends CompletableFuture<CommandResultMessage<? extends R>> implements CommandCallback<C, R> { @Override public void onResult(CommandMessage<? extends C> commandMessage, CommandResultMessage<? extends R> commandResultMessage) { super.complete(commandResultMessage); } }
FutureCallback extends CompletableFuture<CommandResultMessage<? extends R>> implements CommandCallback<C, R> { @Override public void onResult(CommandMessage<? extends C> commandMessage, CommandResultMessage<? extends R> commandResultMessage) { super.complete(commandResultMessage); }  }
FutureCallback extends CompletableFuture<CommandResultMessage<? extends R>> implements CommandCallback<C, R> { @Override public void onResult(CommandMessage<? extends C> commandMessage, CommandResultMessage<? extends R> commandResultMessage) { super.complete(commandResultMessage); }  @Override void onResult(CommandMessage<? extends C> commandMessage,
                         CommandResultMessage<? extends R> commandResultMessage); CommandResultMessage<? extends R> getResult(); CommandResultMessage<? extends R> getResult(long timeout, TimeUnit unit); boolean awaitCompletion(long timeout, TimeUnit unit); }
FutureCallback extends CompletableFuture<CommandResultMessage<? extends R>> implements CommandCallback<C, R> { @Override public void onResult(CommandMessage<? extends C> commandMessage, CommandResultMessage<? extends R> commandResultMessage) { super.complete(commandResultMessage); }  @Override void onResult(CommandMessage<? extends C> commandMessage,
                         CommandResultMessage<? extends R> commandResultMessage); CommandResultMessage<? extends R> getResult(); CommandResultMessage<? extends R> getResult(long timeout, TimeUnit unit); boolean awaitCompletion(long timeout, TimeUnit unit);  }