mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Polishing
This commit is contained in:
+6
-2
@@ -64,8 +64,7 @@ class ConfigurationBeanNameTests {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.setBeanNameGenerator(new AnnotationBeanNameGenerator() {
|
||||
@Override
|
||||
public String generateBeanName(
|
||||
BeanDefinition definition, BeanDefinitionRegistry registry) {
|
||||
public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
|
||||
return "custom-" + super.generateBeanName(definition, registry);
|
||||
}
|
||||
});
|
||||
@@ -78,17 +77,22 @@ class ConfigurationBeanNameTests {
|
||||
ctx.close();
|
||||
}
|
||||
|
||||
|
||||
@Configuration("outer")
|
||||
@Import(C.class)
|
||||
static class A {
|
||||
|
||||
@Component("nested")
|
||||
static class B {
|
||||
|
||||
@Bean public String nestedBean() { return ""; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Configuration("imported")
|
||||
static class C {
|
||||
|
||||
@Bean public String s() { return "s"; }
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -20,4 +20,5 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ComponentForScanning {
|
||||
|
||||
}
|
||||
|
||||
+2
@@ -22,8 +22,10 @@ import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class ConfigForScanning {
|
||||
|
||||
@Bean
|
||||
public TestBean testBean() {
|
||||
return new TestBean();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user