33import org .junit .jupiter .api .Test ;
44import org .springframework .core .ResolvableType ;
55
6+ import java .util .UUID ;
67import java .util .function .Supplier ;
78
89import static org .assertj .core .api .Assertions .assertThat ;
@@ -16,8 +17,8 @@ class ScopedProxyGenericTypeMatchTests {
1617 void scopedProxyBeanTypeMatching () {
1718 DefaultListableBeanFactory factory = new DefaultListableBeanFactory ();
1819
19- String targetBeanName = "scopedTarget. wordBean" ;
20- String proxyBeanName = "wordBean" ;
20+ String proxyBeanName = "wordBean-" + UUID . randomUUID () ;
21+ String targetBeanName = "scopedTarget." + proxyBeanName ;
2122
2223 RootBeanDefinition targetDef = new RootBeanDefinition (SomeGenericSupplier .class );
2324 targetDef .setScope ("request" );
@@ -31,11 +32,9 @@ void scopedProxyBeanTypeMatching() {
3132
3233 ResolvableType supplierType = ResolvableType .forClassWithGenerics (Supplier .class , String .class );
3334
34- boolean isMatch = factory .isTypeMatch (proxyBeanName , supplierType );
35- assertThat (isMatch ).isTrue ();
35+ assertThat (factory .isTypeMatch (proxyBeanName , supplierType )).isTrue ();
3636
37- String [] names = factory .getBeanNamesForType (supplierType );
38- assertThat (names ).contains (proxyBeanName );
37+ assertThat (factory .getBeanNamesForType (supplierType )).contains (proxyBeanName );
3938 }
4039
4140 static class SomeGenericSupplier implements Supplier <String > {
0 commit comments