@@ -51,6 +51,7 @@ public void testStandard() {
51
51
assertFalse (ctx .getBeanFactory ().containsSingleton ("testBean1" ));
52
52
StandardPojo pojo = ctx .getBean (StandardPojo .class );
53
53
assertThat (pojo .testBean .getName (), equalTo ("interesting" ));
54
+ assertThat (pojo .testBean2 .getName (), equalTo ("boring" ));
54
55
}
55
56
56
57
@ Test
@@ -60,6 +61,7 @@ public void testScoped() {
60
61
assertFalse (ctx .getBeanFactory ().containsSingleton ("testBean1" ));
61
62
StandardPojo pojo = ctx .getBean (StandardPojo .class );
62
63
assertThat (pojo .testBean .getName (), equalTo ("interesting" ));
64
+ assertThat (pojo .testBean2 .getName (), equalTo ("boring" ));
63
65
}
64
66
65
67
@ Test
@@ -69,6 +71,7 @@ public void testScopedProxy() {
69
71
assertTrue (ctx .getBeanFactory ().containsSingleton ("testBean1" )); // a shared scoped proxy
70
72
StandardPojo pojo = ctx .getBean (StandardPojo .class );
71
73
assertThat (pojo .testBean .getName (), equalTo ("interesting" ));
74
+ assertThat (pojo .testBean2 .getName (), equalTo ("boring" ));
72
75
}
73
76
74
77
@ Test
@@ -89,7 +92,7 @@ public TestBean testBean1() {
89
92
return new TestBean ("interesting" );
90
93
}
91
94
92
- @ Bean @ Qualifier ( "boring" )
95
+ @ Bean @ Boring
93
96
public TestBean testBean2 () {
94
97
return new TestBean ("boring" );
95
98
}
@@ -103,7 +106,7 @@ public TestBean testBean1() {
103
106
return new TestBean ("interesting" );
104
107
}
105
108
106
- @ Bean @ Qualifier ( "boring" ) @ Scope ("prototype" )
109
+ @ Bean @ Boring @ Scope ("prototype" )
107
110
public TestBean testBean2 () {
108
111
return new TestBean ("boring" );
109
112
}
@@ -117,7 +120,7 @@ public TestBean testBean1() {
117
120
return new TestBean ("interesting" );
118
121
}
119
122
120
- @ Bean @ Qualifier ( "boring" ) @ Scope (value ="prototype" , proxyMode =ScopedProxyMode .TARGET_CLASS )
123
+ @ Bean @ Boring @ Scope (value ="prototype" , proxyMode =ScopedProxyMode .TARGET_CLASS )
121
124
public TestBean testBean2 () {
122
125
return new TestBean ("boring" );
123
126
}
@@ -127,6 +130,13 @@ public TestBean testBean2() {
127
130
static class StandardPojo {
128
131
129
132
@ Autowired @ Qualifier ("interesting" ) TestBean testBean ;
133
+
134
+ @ Autowired @ Boring TestBean testBean2 ;
135
+ }
136
+
137
+ @ Qualifier
138
+ @ Retention (RetentionPolicy .RUNTIME )
139
+ public @interface Boring {
130
140
}
131
141
132
142
@ Configuration
0 commit comments