Skip to content

Commit 99da6e9

Browse files
committed
Merge pull request spring-projects#22337 from mhewedy
* pr/22337: Polish "Fix use CompletableFuture in DeferredResultReturnValueHandlerTest" Fix use CompletableFuture in DeferredResultReturnValueHandlerTest
2 parents 1241c3b + 7c62d7c commit 99da6e9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/DeferredResultReturnValueHandlerTests.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -96,8 +96,8 @@ public void listenableFuture() throws Exception {
9696

9797
@Test
9898
public void completableFuture() throws Exception {
99-
SettableListenableFuture<String> future = new SettableListenableFuture<>();
100-
testHandle(future, CompletableFuture.class, () -> future.set("foo"), "foo");
99+
CompletableFuture<String> future = new CompletableFuture<>();
100+
testHandle(future, CompletableFuture.class, () -> future.complete("foo"), "foo");
101101
}
102102

103103
@Test
@@ -115,9 +115,9 @@ public void listenableFutureWithError() throws Exception {
115115

116116
@Test
117117
public void completableFutureWithError() throws Exception {
118-
SettableListenableFuture<String> future = new SettableListenableFuture<>();
118+
CompletableFuture<String> future = new CompletableFuture<>();
119119
IllegalStateException ex = new IllegalStateException();
120-
testHandle(future, CompletableFuture.class, () -> future.setException(ex), ex);
120+
testHandle(future, CompletableFuture.class, () -> future.completeExceptionally(ex), ex);
121121
}
122122

123123

0 commit comments

Comments
 (0)