Fix use CompletableFuture in DeferredResultReturnValueHandlerTest
See gh-22337
This commit is contained in:
committed by
Stephane Nicoll
parent
4560dc2818
commit
6507b09c7f
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user