public void testTrustedGetFailure_Completed() { SettableFuture<String> future = SettableFuture.create(); future.set("261"); assertThat(future.tryInternalFastPathGetFailure()).isNull(); }
public void testTrustedGetFailure_Failed() { SettableFuture<String> future = SettableFuture.create(); Throwable failure = new Throwable(); future.setException(failure); assertThat(future.tryInternalFastPathGetFailure()).isEqualTo(failure); }
public void testTrustedGetFailure_CanceledNoCause() { SettableFuture<String> future = SettableFuture.create(); future.cancel(false); assertThat(future.tryInternalFastPathGetFailure()).isNull(); }
public void testTrustedGetFailure_NotCompleted() { SettableFuture<String> future = SettableFuture.create(); assertThat(future.isDone()).isFalse(); assertThat(future.tryInternalFastPathGetFailure()).isNull(); }