@@ -16,25 +16,26 @@ class ScopedProxyGenericTypeMatchTests {
1616 void scopedProxyBeanTypeMatching () {
1717 DefaultListableBeanFactory factory = new DefaultListableBeanFactory ();
1818
19+ String targetBeanName = "scopedTarget.wordBean" ;
20+ String proxyBeanName = "wordBean" ;
21+
1922 RootBeanDefinition targetDef = new RootBeanDefinition (SomeGenericSupplier .class );
2023 targetDef .setScope ("request" );
21- factory .registerBeanDefinition ("scopedTarget.wordBean" , targetDef );
24+ factory .registerBeanDefinition (targetBeanName , targetDef );
2225
2326 RootBeanDefinition proxyDef = new RootBeanDefinition ();
2427 proxyDef .setScope ("singleton" );
2528 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 );
2831
2932 ResolvableType supplierType = ResolvableType .forClassWithGenerics (Supplier .class , String .class );
3033
31- boolean isMatch = factory .isTypeMatch ("wordBean" , supplierType );
32-
33-
34+ boolean isMatch = factory .isTypeMatch (proxyBeanName , supplierType );
3435 assertThat (isMatch ).isTrue ();
3536
3637 String [] names = factory .getBeanNamesForType (supplierType );
37- assertThat (names ).contains ("wordBean" );
38+ assertThat (names ).contains (proxyBeanName );
3839 }
3940
4041 static class SomeGenericSupplier implements Supplier <String > {
0 commit comments