@@ -52,6 +52,7 @@ public void testStandard() {
52
52
assertFalse (ctx .getBeanFactory ().containsSingleton ("testBean1" ));
53
53
StandardPojo pojo = ctx .getBean (StandardPojo .class );
54
54
assertThat (pojo .testBean .getName (), equalTo ("interesting" ));
55
+ assertThat (pojo .testBean2 .getName (), equalTo ("boring" ));
55
56
}
56
57
57
58
@ Test
@@ -61,6 +62,7 @@ public void testScoped() {
61
62
assertFalse (ctx .getBeanFactory ().containsSingleton ("testBean1" ));
62
63
StandardPojo pojo = ctx .getBean (StandardPojo .class );
63
64
assertThat (pojo .testBean .getName (), equalTo ("interesting" ));
65
+ assertThat (pojo .testBean2 .getName (), equalTo ("boring" ));
64
66
}
65
67
66
68
@ Test
@@ -70,6 +72,7 @@ public void testScopedProxy() {
70
72
assertTrue (ctx .getBeanFactory ().containsSingleton ("testBean1" )); // a shared scoped proxy
71
73
StandardPojo pojo = ctx .getBean (StandardPojo .class );
72
74
assertThat (pojo .testBean .getName (), equalTo ("interesting" ));
75
+ assertThat (pojo .testBean2 .getName (), equalTo ("boring" ));
73
76
}
74
77
75
78
@ Test
@@ -99,7 +102,7 @@ public TestBean testBean1() {
99
102
return new TestBean ("interesting" );
100
103
}
101
104
102
- @ Bean @ Qualifier ( "boring" )
105
+ @ Bean @ Boring
103
106
public TestBean testBean2 () {
104
107
return new TestBean ("boring" );
105
108
}
@@ -113,7 +116,7 @@ public TestBean testBean1() {
113
116
return new TestBean ("interesting" );
114
117
}
115
118
116
- @ Bean @ Qualifier ( "boring" ) @ Scope ("prototype" )
119
+ @ Bean @ Boring @ Scope ("prototype" )
117
120
public TestBean testBean2 () {
118
121
return new TestBean ("boring" );
119
122
}
@@ -127,7 +130,7 @@ public TestBean testBean1() {
127
130
return new TestBean ("interesting" );
128
131
}
129
132
130
- @ Bean @ Qualifier ( "boring" ) @ Scope (value ="prototype" , proxyMode =ScopedProxyMode .TARGET_CLASS )
133
+ @ Bean @ Boring @ Scope (value ="prototype" , proxyMode =ScopedProxyMode .TARGET_CLASS )
131
134
public TestBean testBean2 () {
132
135
return new TestBean ("boring" );
133
136
}
@@ -137,6 +140,13 @@ public TestBean testBean2() {
137
140
static class StandardPojo {
138
141
139
142
@ Autowired @ Qualifier ("interesting" ) TestBean testBean ;
143
+
144
+ @ Autowired @ Boring TestBean testBean2 ;
145
+ }
146
+
147
+ @ Qualifier
148
+ @ Retention (RetentionPolicy .RUNTIME )
149
+ public @interface Boring {
140
150
}
141
151
142
152
@ Configuration
0 commit comments