From 6174055910b3388eef6d74652cc0e0f1f7162f46 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Wed, 12 Feb 2025 16:31:33 +0100 Subject: [PATCH] =?UTF-8?q?Link=20to=20@=E2=81=A0MockitoBean,=20@=E2=81=A0?= =?UTF-8?q?MockitoSpyBean,=20&=20@=E2=81=A0TestBean=20Javadoc=20from=20ref?= =?UTF-8?q?=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../integration-spring/annotation-mockitobean.adoc | 8 +++++--- .../integration-spring/annotation-testbean.adoc | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-mockitobean.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-mockitobean.adoc index 8af25b975518..153a3b03435f 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-mockitobean.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-mockitobean.adoc @@ -1,9 +1,11 @@ [[spring-testing-annotation-beanoverriding-mockitobean]] = `@MockitoBean` and `@MockitoSpyBean` -`@MockitoBean` and `@MockitoSpyBean` can be used in test classes to override a bean in -the test's `ApplicationContext` with a Mockito _mock_ or _spy_, respectively. In the -latter case, an early instance of the original bean is captured and wrapped by the spy. +{spring-framework-api}/test/context/bean/override/mockito/MockitoBean.html[`@MockitoBean`] and +{spring-framework-api}/test/context/bean/override/mockito/MockitoSpyBean.html[`@MockitoSpyBean`] +can be used in test classes to override a bean in the test's `ApplicationContext` with a +Mockito _mock_ or _spy_, respectively. In the latter case, an early instance of the +original bean is captured and wrapped by the spy. The annotations can be applied in the following ways. diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-testbean.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-testbean.adoc index f142a2ded825..a9cc9ced52dc 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-testbean.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-testbean.adoc @@ -1,8 +1,9 @@ [[spring-testing-annotation-beanoverriding-testbean]] = `@TestBean` -`@TestBean` is used on a non-static field in a test class to override a specific bean in -the test's `ApplicationContext` with an instance provided by a factory method. +{spring-framework-api}/test/context/bean/override/convention/TestBean.html[`@TestBean`] +is used on a non-static field in a test class to override a specific bean in the test's +`ApplicationContext` with an instance provided by a factory method. The associated factory method name is derived from the annotated field's name, or the bean name if specified. The factory method must be `static`, accept no arguments, and