Browse Source

Polishing

pull/31226/head
Sam Brannen 1 year ago
parent
commit
345910591a
  1. 2
      framework-docs/modules/ROOT/pages/testing/testcontext-framework/support-classes.adoc
  2. 10
      spring-context/src/main/java/org/springframework/context/annotation/AnnotationBeanNameGenerator.java

2
framework-docs/modules/ROOT/pages/testing/testcontext-framework/support-classes.adoc

@ -318,7 +318,7 @@ extension API from JUnit Jupiter, which lets Spring provide dependency injection @@ -318,7 +318,7 @@ extension API from JUnit Jupiter, which lets Spring provide dependency injection
constructors, test methods, and test lifecycle callback methods.
Specifically, the `SpringExtension` can inject dependencies from the test's
`ApplicationContext` into into test constructors and methods that are annotated with
`ApplicationContext` into test constructors and methods that are annotated with
Spring's `@BeforeTransaction` and `@AfterTransaction` or JUnit's `@BeforeAll`,
`@AfterAll`, `@BeforeEach`, `@AfterEach`, `@Test`, `@RepeatedTest`, `@ParameterizedTest`,
and others.

10
spring-context/src/main/java/org/springframework/context/annotation/AnnotationBeanNameGenerator.java

@ -152,11 +152,11 @@ public class AnnotationBeanNameGenerator implements BeanNameGenerator { @@ -152,11 +152,11 @@ public class AnnotationBeanNameGenerator implements BeanNameGenerator {
if (conventionBasedStereotypeCheckCache.add(annotationType) &&
metaAnnotationTypes.contains(COMPONENT_ANNOTATION_CLASSNAME) && logger.isWarnEnabled()) {
logger.warn("""
Support for convention-based stereotype names is deprecated and will \
be removed in a future version of the framework. Please annotate the \
'value' attribute in @%s with @AliasFor(annotation=Component.class) \
to declare an explicit alias for @Component's 'value' attribute."""
.formatted(annotationType));
Support for convention-based stereotype names is deprecated and will \
be removed in a future version of the framework. Please annotate the \
'value' attribute in @%s with @AliasFor(annotation=Component.class) \
to declare an explicit alias for @Component's 'value' attribute."""
.formatted(annotationType));
}
if (beanName != null && !currentName.equals(beanName)) {
throw new IllegalStateException("Stereotype annotations suggest inconsistent " +

Loading…
Cancel
Save