From 8fcc1dd0fe842d91d66554bd3decea4238305f28 Mon Sep 17 00:00:00 2001 From: Tran Ngoc Nhan Date: Thu, 12 Jun 2025 00:59:36 +0700 Subject: [PATCH] Update javadoc of test slice annotations to suggest MockitoBean rather than MockBean See gh-45887 Signed-off-by: Tran Ngoc Nhan --- .../boot/test/autoconfigure/graphql/GraphQlTest.java | 6 +++--- .../boot/test/autoconfigure/web/reactive/WebFluxTest.java | 8 ++++---- .../boot/test/autoconfigure/web/servlet/WebMvcTest.java | 8 ++++---- .../webservices/server/WebServiceServerTest.java | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/graphql/GraphQlTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/graphql/GraphQlTest.java index 81fdc34e28e..7ecc741d53a 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/graphql/GraphQlTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/graphql/GraphQlTest.java @@ -65,9 +65,9 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; * {@link AutoConfigureGraphQlTester @AutoConfigureGraphQlTester}. *

* Typically {@code @GraphQlTest} is used in combination with - * {@link org.springframework.boot.test.mock.mockito.MockBean @MockBean} or - * {@link org.springframework.context.annotation.Import @Import} to load any collaborators - * and other components required for the tests. + * {@link org.springframework.test.context.bean.override.mockito.MockitoBean @MockitoBean} + * or {@link org.springframework.context.annotation.Import @Import} to load any + * collaborators and other components required for the tests. *

* To load your full application configuration instead and test via * {@code HttpGraphQlTester}, consider using diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTest.java index 746ae2f51a4..9d46e4ad23c 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -68,9 +68,9 @@ import org.springframework.test.web.reactive.server.WebTestClient; * {@link AutoConfigureWebTestClient @AutoConfigureWebTestClient} annotation can be used. *

* Typically {@code @WebFluxTest} is used in combination with - * {@link org.springframework.boot.test.mock.mockito.MockBean @MockBean} or - * {@link Import @Import} to create any collaborators required by your {@code @Controller} - * beans. + * {@link org.springframework.test.context.bean.override.mockito.MockitoBean @MockitoBean} + * or {@link Import @Import} to create any collaborators required by your + * {@code @Controller} beans. *

* If you are looking to load your full application configuration and use WebTestClient, * you should consider {@link SpringBootTest @SpringBootTest} combined with diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java index 1674e5926de..46c972dcd21 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -76,9 +76,9 @@ import org.springframework.test.web.servlet.MockMvc; * {@link AutoConfigureMockMvc @AutoConfigureMockMvc} annotation can be used. *

* Typically {@code @WebMvcTest} is used in combination with - * {@link org.springframework.boot.test.mock.mockito.MockBean @MockBean} or - * {@link Import @Import} to create any collaborators required by your {@code @Controller} - * beans. + * {@link org.springframework.test.context.bean.override.mockito.MockitoBean @MockitoBean} + * or {@link Import @Import} to create any collaborators required by your + * {@code @Controller} beans. *

* If you are looking to load your full application configuration and use MockMVC, you * should consider {@link SpringBootTest @SpringBootTest} combined with diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/server/WebServiceServerTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/server/WebServiceServerTest.java index eb3d6be22b9..316ef230017 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/server/WebServiceServerTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/server/WebServiceServerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -51,8 +51,8 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; * *

* Typically {@code WebServiceServerTest} is used in combination with - * {@link org.springframework.boot.test.mock.mockito.MockBean @MockBean} or - * {@link org.springframework.context.annotation.Import @Import} to create any + * {@link org.springframework.test.context.bean.override.mockito.MockitoBean @MockitoBean} + * or {@link org.springframework.context.annotation.Import @Import} to create any * collaborators required by your {@code Endpoint} beans. *

* If you are looking to load your full application configuration and use