Skip to content

Commit

Permalink
Sync Javadoc for @⁠TestBean & @⁠MockitoBean with reference manual
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Oct 28, 2024
1 parent 81d89f4 commit de2c10a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
* Alternatively, you can explicitly specify a bean name to replace by setting the
* {@link #value() value} or {@link #name() name} attribute.
*
* <p>A new bean definition will be created if a corresponding bean definition does
* not exist. However, if you would like for the test to fail when a corresponding
* bean definition does not exist, you can set the {@link #enforceOverride()
* enforceOverride} attribute to {@code true}.
* <p>A bean will be created if a corresponding bean does not exist. However, if
* you would like for the test to fail when a corresponding bean does not exist,
* you can set the {@link #enforceOverride() enforceOverride} attribute to {@code true}
* &mdash; for example, {@code @TestBean(enforceOverride = true)}.
*
* <p>The instance is created from a zero-argument static factory method in the
* test class whose return type is compatible with the annotated field. In the
Expand Down Expand Up @@ -151,12 +151,11 @@
String methodName() default "";

/**
* Whether to require the existence of a bean definition for the bean being
* overridden.
* <p>Defaults to {@code false} which means that a new bean definition will
* be created if a corresponding bean definition does not exist.
* Whether to require the existence of the bean being overridden.
* <p>Defaults to {@code false} which means that a bean will be created if a
* corresponding bean does not exist.
* <p>Set to {@code true} to cause an exception to be thrown if a corresponding
* bean definition does not exist.
* bean does not exist.
* @see org.springframework.test.context.bean.override.BeanOverrideStrategy#REPLACE_OR_CREATE
* @see org.springframework.test.context.bean.override.BeanOverrideStrategy#REPLACE
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
* Alternatively, you can explicitly specify a bean name to mock by setting the
* {@link #value() value} or {@link #name() name} attribute.
*
* <p>A new bean definition will be created if a corresponding bean definition does
* not exist. However, if you would like for the test to fail when a corresponding
* bean definition does not exist, you can set the {@link #enforceOverride()
* enforceOverride} attribute to {@code true}.
* <p>A bean will be created if a corresponding bean does not exist. However, if
* you would like for the test to fail when a corresponding bean does not exist,
* you can set the {@link #enforceOverride() enforceOverride} attribute to {@code true}
* &mdash; for example, {@code @MockitoBean(enforceOverride = true)}.
*
* <p>Dependencies that are known to the application context but are not beans
* (such as those
Expand Down Expand Up @@ -121,12 +121,11 @@
MockReset reset() default MockReset.AFTER;

/**
* Whether to require the existence of a bean definition for the bean being
* overridden.
* <p>Defaults to {@code false} which means that a new bean definition will
* be created if a corresponding bean definition does not exist.
* Whether to require the existence of the bean being mocked.
* <p>Defaults to {@code false} which means that a mock will be created if a
* corresponding bean does not exist.
* <p>Set to {@code true} to cause an exception to be thrown if a corresponding
* bean definition does not exist.
* bean does not exist.
* @see org.springframework.test.context.bean.override.BeanOverrideStrategy#REPLACE_OR_CREATE
* @see org.springframework.test.context.bean.override.BeanOverrideStrategy#REPLACE
*/
Expand Down

0 comments on commit de2c10a

Please sign in to comment.