From ce0ec4644b22f8ee1298c069debcb1569f867773 Mon Sep 17 00:00:00 2001 From: cdalexndr Date: Fri, 19 Feb 2021 17:59:31 +0200 Subject: [PATCH 1/2] Include ResetMocksTestExecutionListener ResetMocksTestExecutionListener is required to enable `@SpyBean/@MockBean`'s `reset()` attribute. https://github.com/spring-projects/spring-boot/issues/25366 --- .../src/docs/asciidoc/spring-boot-features.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc index eae98d701bf5..fb2941335c15 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc @@ -6656,7 +6656,7 @@ To use this feature with a different arrangement, a listener must be explicitly [source,java,pending-extract=true,indent=0] ---- - @TestExecutionListeners(MockitoTestExecutionListener.class) + @TestExecutionListeners({MockitoTestExecutionListener.class, ResetMocksTestExecutionListener.class}) ---- ==== From 775942b294aaa2f0898ca03369982f236c083022 Mon Sep 17 00:00:00 2001 From: cdalexndr Date: Mon, 1 Mar 2021 11:54:31 +0200 Subject: [PATCH 2/2] Update spring-boot-features.adoc --- .../src/docs/asciidoc/spring-boot-features.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc index fb2941335c15..f55e722a85f2 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc @@ -6652,7 +6652,7 @@ Mock beans are automatically reset after each test method. [NOTE] ==== If your test uses one of Spring Boot's test annotations (such as `@SpringBootTest`), this feature is automatically enabled. -To use this feature with a different arrangement, a listener must be explicitly added, as shown in the following example: +To use this feature with a different arrangement, listeners must be explicitly added, as shown in the following example: [source,java,pending-extract=true,indent=0] ----