Skip to content

Commit 6174055

Browse files
committedFeb 12, 2025·
Link to @⁠MockitoBean, @⁠MockitoSpyBean, & @⁠TestBean Javadoc from ref docs
1 parent e31ce35 commit 6174055

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed
 

Diff for: ‎framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-mockitobean.adoc

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
[[spring-testing-annotation-beanoverriding-mockitobean]]
22
= `@MockitoBean` and `@MockitoSpyBean`
33

4-
`@MockitoBean` and `@MockitoSpyBean` can be used in test classes to override a bean in
5-
the test's `ApplicationContext` with a Mockito _mock_ or _spy_, respectively. In the
6-
latter case, an early instance of the original bean is captured and wrapped by the spy.
4+
{spring-framework-api}/test/context/bean/override/mockito/MockitoBean.html[`@MockitoBean`] and
5+
{spring-framework-api}/test/context/bean/override/mockito/MockitoSpyBean.html[`@MockitoSpyBean`]
6+
can be used in test classes to override a bean in the test's `ApplicationContext` with a
7+
Mockito _mock_ or _spy_, respectively. In the latter case, an early instance of the
8+
original bean is captured and wrapped by the spy.
79

810
The annotations can be applied in the following ways.
911

Diff for: ‎framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-testbean.adoc

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[[spring-testing-annotation-beanoverriding-testbean]]
22
= `@TestBean`
33

4-
`@TestBean` is used on a non-static field in a test class to override a specific bean in
5-
the test's `ApplicationContext` with an instance provided by a factory method.
4+
{spring-framework-api}/test/context/bean/override/convention/TestBean.html[`@TestBean`]
5+
is used on a non-static field in a test class to override a specific bean in the test's
6+
`ApplicationContext` with an instance provided by a factory method.
67

78
The associated factory method name is derived from the annotated field's name, or the
89
bean name if specified. The factory method must be `static`, accept no arguments, and

0 commit comments

Comments
 (0)
Please sign in to comment.