From c2f8d4803f25f04df3a2739562aa2ff59b834bad Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Sun, 30 Jun 2024 20:36:55 +0200 Subject: [PATCH] =?UTF-8?q?Update=20Javadoc=20for=20@=E2=81=A0TestBean?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bean/override/convention/TestBean.java | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/spring-test/src/main/java/org/springframework/test/context/bean/override/convention/TestBean.java b/spring-test/src/main/java/org/springframework/test/context/bean/override/convention/TestBean.java index ec5f92679af..a94ee7a9bcc 100644 --- a/spring-test/src/main/java/org/springframework/test/context/bean/override/convention/TestBean.java +++ b/spring-test/src/main/java/org/springframework/test/context/bean/override/convention/TestBean.java @@ -29,17 +29,20 @@ import org.springframework.test.context.bean.override.BeanOverride; * Mark a field to override a bean definition in the {@code BeanFactory}. * *

By default, the bean to override is inferred from the type of the - * annotated field. This requires that exactly one matching definition is + * annotated field. This requires that exactly one matching bean definition is * present in the application context. A {@code @Qualifier} annotation can be - * used to help disambiguate. Alternatively, you can explicitly specify a bean - * name to replace by setting the {@link #value()} or {@link #name()} attribute. + * used to help disambiguate. In the absence of a {@code @Qualifier} annotation, + * the name of the annotated field will be used as a qualifier. Alternatively, + * you can explicitly specify a bean name to replace by setting the + * {@link #value()} or {@link #name()} attribute. * *

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 - * case of a nested test class, the enclosing class hierarchy is also considered. + * case of a nested test class, the enclosing class hierarchy is also searched. * Similarly, if the test class extends from a base class or implements any - * interfaces, the entire type hierarchy is considered. The method is deduced as + * interfaces, the entire type hierarchy is searched. The method is deduced as * follows. + * *