@Test public void testErrorThrowingAsync() { FutureWithTrigger<Object> futureWithTrigger = new FutureWithTrigger<>(); RuntimeException exception = new RuntimeException(); AtomicReference<RuntimeException> exceptionReference = new AtomicReference<>(); Triggerer.triggerErrorAsync(10, exception, futureWithTrigger); try { futureWithTrigger.getFuture().trap(RuntimeException.class, e -> { exceptionReference.set(e); throw e; }).await(); fail("Exception should have been thrown"); } catch (Exception catchedException) { assertEquals(exception, exceptionReference.get()); assertEquals(exception, catchedException); } }
public Future<T> getFuture(){ return this.future; }
FutureWithTrigger { public Future<T> getFuture(){ return this.future; } }
FutureWithTrigger { public Future<T> getFuture(){ return this.future; } FutureWithTrigger(); }
FutureWithTrigger { public Future<T> getFuture(){ return this.future; } FutureWithTrigger(); Callback<T> getTrigger(); Future<T> getFuture(); }
FutureWithTrigger { public Future<T> getFuture(){ return this.future; } FutureWithTrigger(); Callback<T> getTrigger(); Future<T> getFuture();  }