|
38 | 38 | * Alternatively, you can explicitly specify a bean name to replace by setting the
|
39 | 39 | * {@link #value() value} or {@link #name() name} attribute.
|
40 | 40 | *
|
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 | + * — for example, {@code @TestBean(enforceOverride = true)}. |
45 | 45 | *
|
46 | 46 | * <p>The instance is created from a zero-argument static factory method in the
|
47 | 47 | * test class whose return type is compatible with the annotated field. In the
|
|
151 | 151 | String methodName() default "";
|
152 | 152 |
|
153 | 153 | /**
|
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. |
158 | 157 | * <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. |
160 | 159 | * @see org.springframework.test.context.bean.override.BeanOverrideStrategy#REPLACE_OR_CREATE
|
161 | 160 | * @see org.springframework.test.context.bean.override.BeanOverrideStrategy#REPLACE
|
162 | 161 | */
|
|
0 commit comments