Skip to content

Commit de2c10a

Browse files
committed
Sync Javadoc for @⁠TestBean & @⁠MockitoBean with reference manual
See gh-33701
1 parent 81d89f4 commit de2c10a

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

spring-test/src/main/java/org/springframework/test/context/bean/override/convention/TestBean.java

+8-9
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
* Alternatively, you can explicitly specify a bean name to replace by setting the
3939
* {@link #value() value} or {@link #name() name} attribute.
4040
*
41-
* <p>A new bean definition will be created if a corresponding bean definition does
42-
* not exist. However, if you would like for the test to fail when a corresponding
43-
* bean definition does not exist, you can set the {@link #enforceOverride()
44-
* enforceOverride} attribute to {@code true}.
41+
* <p>A bean will be created if a corresponding bean does not exist. However, if
42+
* you would like for the test to fail when a corresponding bean does not exist,
43+
* you can set the {@link #enforceOverride() enforceOverride} attribute to {@code true}
44+
* &mdash; for example, {@code @TestBean(enforceOverride = true)}.
4545
*
4646
* <p>The instance is created from a zero-argument static factory method in the
4747
* test class whose return type is compatible with the annotated field. In the
@@ -151,12 +151,11 @@
151151
String methodName() default "";
152152

153153
/**
154-
* Whether to require the existence of a bean definition for the bean being
155-
* overridden.
156-
* <p>Defaults to {@code false} which means that a new bean definition will
157-
* be created if a corresponding bean definition does not exist.
154+
* Whether to require the existence of the bean being overridden.
155+
* <p>Defaults to {@code false} which means that a bean will be created if a
156+
* corresponding bean does not exist.
158157
* <p>Set to {@code true} to cause an exception to be thrown if a corresponding
159-
* bean definition does not exist.
158+
* bean does not exist.
160159
* @see org.springframework.test.context.bean.override.BeanOverrideStrategy#REPLACE_OR_CREATE
161160
* @see org.springframework.test.context.bean.override.BeanOverrideStrategy#REPLACE
162161
*/

spring-test/src/main/java/org/springframework/test/context/bean/override/mockito/MockitoBean.java

+8-9
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
* Alternatively, you can explicitly specify a bean name to mock by setting the
4242
* {@link #value() value} or {@link #name() name} attribute.
4343
*
44-
* <p>A new bean definition will be created if a corresponding bean definition does
45-
* not exist. However, if you would like for the test to fail when a corresponding
46-
* bean definition does not exist, you can set the {@link #enforceOverride()
47-
* enforceOverride} attribute to {@code true}.
44+
* <p>A bean will be created if a corresponding bean does not exist. However, if
45+
* you would like for the test to fail when a corresponding bean does not exist,
46+
* you can set the {@link #enforceOverride() enforceOverride} attribute to {@code true}
47+
* &mdash; for example, {@code @MockitoBean(enforceOverride = true)}.
4848
*
4949
* <p>Dependencies that are known to the application context but are not beans
5050
* (such as those
@@ -121,12 +121,11 @@
121121
MockReset reset() default MockReset.AFTER;
122122

123123
/**
124-
* Whether to require the existence of a bean definition for the bean being
125-
* overridden.
126-
* <p>Defaults to {@code false} which means that a new bean definition will
127-
* be created if a corresponding bean definition does not exist.
124+
* Whether to require the existence of the bean being mocked.
125+
* <p>Defaults to {@code false} which means that a mock will be created if a
126+
* corresponding bean does not exist.
128127
* <p>Set to {@code true} to cause an exception to be thrown if a corresponding
129-
* bean definition does not exist.
128+
* bean does not exist.
130129
* @see org.springframework.test.context.bean.override.BeanOverrideStrategy#REPLACE_OR_CREATE
131130
* @see org.springframework.test.context.bean.override.BeanOverrideStrategy#REPLACE
132131
*/

0 commit comments

Comments
 (0)