|
|
|
@ -96,8 +96,8 @@ public class DeferredResultReturnValueHandlerTests { |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void completableFuture() throws Exception { |
|
|
|
|
SettableListenableFuture<String> future = new SettableListenableFuture<>(); |
|
|
|
|
testHandle(future, CompletableFuture.class, () -> future.set("foo"), "foo"); |
|
|
|
|
CompletableFuture<String> future = new CompletableFuture<>(); |
|
|
|
|
testHandle(future, CompletableFuture.class, () -> future.complete("foo"), "foo"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@ -115,9 +115,9 @@ public class DeferredResultReturnValueHandlerTests { |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void completableFutureWithError() throws Exception { |
|
|
|
|
SettableListenableFuture<String> future = new SettableListenableFuture<>(); |
|
|
|
|
CompletableFuture<String> future = new CompletableFuture<>(); |
|
|
|
|
IllegalStateException ex = new IllegalStateException(); |
|
|
|
|
testHandle(future, CompletableFuture.class, () -> future.setException(ex), ex); |
|
|
|
|
testHandle(future, CompletableFuture.class, () -> future.completeExceptionally(ex), ex); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|