@@ -16,25 +16,26 @@ class ScopedProxyGenericTypeMatchTests {
16
16
void scopedProxyBeanTypeMatching () {
17
17
DefaultListableBeanFactory factory = new DefaultListableBeanFactory ();
18
18
19
+ String targetBeanName = "scopedTarget.wordBean" ;
20
+ String proxyBeanName = "wordBean" ;
21
+
19
22
RootBeanDefinition targetDef = new RootBeanDefinition (SomeGenericSupplier .class );
20
23
targetDef .setScope ("request" );
21
- factory .registerBeanDefinition ("scopedTarget.wordBean" , targetDef );
24
+ factory .registerBeanDefinition (targetBeanName , targetDef );
22
25
23
26
RootBeanDefinition proxyDef = new RootBeanDefinition ();
24
27
proxyDef .setScope ("singleton" );
25
28
proxyDef .setTargetType (ResolvableType .forClassWithGenerics (Supplier .class , String .class ));
26
- proxyDef .setAttribute ("targetBeanName" , "scopedTarget.wordBean" );
27
- factory .registerBeanDefinition ("wordBean" , proxyDef );
29
+ proxyDef .setAttribute ("targetBeanName" , targetBeanName );
30
+ factory .registerBeanDefinition (proxyBeanName , proxyDef );
28
31
29
32
ResolvableType supplierType = ResolvableType .forClassWithGenerics (Supplier .class , String .class );
30
33
31
- boolean isMatch = factory .isTypeMatch ("wordBean" , supplierType );
32
-
33
-
34
+ boolean isMatch = factory .isTypeMatch (proxyBeanName , supplierType );
34
35
assertThat (isMatch ).isTrue ();
35
36
36
37
String [] names = factory .getBeanNamesForType (supplierType );
37
- assertThat (names ).contains ("wordBean" );
38
+ assertThat (names ).contains (proxyBeanName );
38
39
}
39
40
40
41
static class SomeGenericSupplier implements Supplier <String > {
0 commit comments