diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/DeferredResultReturnValueHandlerTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/DeferredResultReturnValueHandlerTests.java index 872498c6cf..8853f57429 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/DeferredResultReturnValueHandlerTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/DeferredResultReturnValueHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -96,8 +96,8 @@ public class DeferredResultReturnValueHandlerTests { @Test public void completableFuture() throws Exception { - SettableListenableFuture future = new SettableListenableFuture<>(); - testHandle(future, CompletableFuture.class, () -> future.set("foo"), "foo"); + CompletableFuture 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 future = new SettableListenableFuture<>(); + CompletableFuture future = new CompletableFuture<>(); IllegalStateException ex = new IllegalStateException(); - testHandle(future, CompletableFuture.class, () -> future.setException(ex), ex); + testHandle(future, CompletableFuture.class, () -> future.completeExceptionally(ex), ex); } diff --git a/src/docs/asciidoc/core/core-beans.adoc b/src/docs/asciidoc/core/core-beans.adoc index 4d755486c7..75c6bcec41 100644 --- a/src/docs/asciidoc/core/core-beans.adoc +++ b/src/docs/asciidoc/core/core-beans.adoc @@ -5952,13 +5952,27 @@ how to do so with Maven: ---- -The following example shows how to do so with Gradle: +With Gradle 4.5 and earlier, the dependency should be declared in the `compileOnly` +configuration, as shown in the following example: [source,groovy,indent=0] [subs="verbatim,quotes,attributes"] ---- dependencies { - compileOnly("org.springframework:spring-context-indexer:{spring-version}") + compileOnly "org.springframework:spring-context-indexer:{spring-version}" + } +---- +==== + +With Gradle 4.6 and later, the dependency should be declared in the `annotationProcessor` +configuration, as shown in the following example: + +==== +[source,groovy,indent=0] +[subs="verbatim,quotes,attributes"] +---- + dependencies { + annotationProcessor "org.springframework:spring-context-indexer:{spring-version}" } ----