diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestClientCustomizer.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestClientCustomizer.java index a41fb5247b7a..7c98aa76dc9d 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestClientCustomizer.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestClientCustomizer.java @@ -50,6 +50,10 @@ * obtain the mock server. If the customizer has been used more than once the * {@link #getServer(RestClient.Builder)} or {@link #getServers()} method must be used to * access the related server. + *
+ * If a mock server is used in more than one test case in a test class, it might be + * necessary to reset the expectations on the server between tests using + * {@code getServer().reset()} or {@code getServer(restClientBuilder).reset()}. * * @author Scott Frederick * @since 3.2.0 diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestTemplateCustomizer.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestTemplateCustomizer.java index ce7ea7d1abe4..3cd206bc1a79 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestTemplateCustomizer.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestTemplateCustomizer.java @@ -48,6 +48,10 @@ * obtain the mock server. If the customizer has been used more than once the * {@link #getServer(RestTemplate)} or {@link #getServers()} method must be used to access * the related server. + *
+ * If a mock server is used in more than one test case in a test class, it might be + * necessary to reset the expectations on the server between tests using + * {@code getServer().reset()} or {@code getServer(restTemplate).reset()}. * * @author Phillip Webb * @author Moritz Halbritter