Fix use CompletableFuture in DeferredResultReturnValueHandlerTest

See gh-22337
This commit is contained in:
Muhammad Hewedy 2019-02-03 23:51:48 +03:00 committed by Stephane Nicoll
parent 4560dc2818
commit 6507b09c7f
1 changed files with 4 additions and 4 deletions

View File

@ -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);
}