|
55 | 55 | import org.springframework.beans.factory.support.GenericBeanDefinition;
|
56 | 56 | import org.springframework.beans.factory.support.RootBeanDefinition;
|
57 | 57 | import org.springframework.core.Ordered;
|
| 58 | +import org.springframework.core.ResolvableType; |
58 | 59 | import org.springframework.core.annotation.AnnotationAwareOrderComparator;
|
59 | 60 | import org.springframework.core.annotation.Order;
|
60 | 61 | import org.springframework.tests.sample.beans.ITestBean;
|
@@ -1633,6 +1634,8 @@ public void testGenericsBasedFieldInjectionWithSimpleMatch() {
|
1633 | 1634 | assertSame(1, bean.stringRepositoryMap.size());
|
1634 | 1635 | assertSame(repo, bean.repositoryMap.get("repo"));
|
1635 | 1636 | assertSame(repo, bean.stringRepositoryMap.get("repo"));
|
| 1637 | + |
| 1638 | + assertArrayEquals(new String[] {"repo"}, bf.getBeanNamesForType(ResolvableType.forClassWithGenerics(Repository.class, String.class))); |
1636 | 1639 | }
|
1637 | 1640 |
|
1638 | 1641 | @Test
|
@@ -2018,6 +2021,9 @@ public void testGenericsBasedInjectionIntoTypeVariableSelectingBestMatch() {
|
2018 | 2021 | GenericInterface1Impl bean1 = (GenericInterface1Impl) bf.getBean("bean1");
|
2019 | 2022 | GenericInterface2Impl bean2 = (GenericInterface2Impl) bf.getBean("bean2");
|
2020 | 2023 | assertSame(bean2, bean1.gi2);
|
| 2024 | + |
| 2025 | + assertArrayEquals(new String[] {"bean1"}, bf.getBeanNamesForType(ResolvableType.forClassWithGenerics(GenericInterface1.class, String.class))); |
| 2026 | + assertArrayEquals(new String[] {"bean2"}, bf.getBeanNamesForType(ResolvableType.forClassWithGenerics(GenericInterface2.class, String.class))); |
2021 | 2027 | }
|
2022 | 2028 |
|
2023 | 2029 | @Test
|
@@ -3076,7 +3082,7 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
|
3076 | 3082 |
|
3077 | 3083 | public interface GenericInterface1<T> {
|
3078 | 3084 |
|
3079 |
| - public String doSomethingGeneric(T o); |
| 3085 | + String doSomethingGeneric(T o); |
3080 | 3086 | }
|
3081 | 3087 |
|
3082 | 3088 |
|
|
0 commit comments