Add additional test for SPR-16210

Issue: SPR-16210
This commit is contained in:
sdeleuze 2018-01-22 10:29:21 +01:00
parent 646fcc5c2f
commit 3f3141cdda
1 changed files with 18 additions and 0 deletions

View File

@ -64,6 +64,7 @@ import static org.mockito.BDDMockito.*;
*
* @author Phillip Webb
* @author Juergen Hoeller
* @author Sebastien Deleuze
*/
@SuppressWarnings("rawtypes")
@RunWith(MockitoJUnitRunner.class)
@ -261,6 +262,19 @@ public class ResolvableTypeTests {
ResolvableType.forMethodParameter(null);
}
@Test // SPR-16210
public void forMethodParameterWithSameSignatureAndGenerics() throws Exception {
Method method = Methods.class.getMethod("list1");
MethodParameter methodParameter = MethodParameter.forExecutable(method, -1);
ResolvableType type = ResolvableType.forMethodParameter(methodParameter);
assertThat(((MethodParameter)type.getSource()).getMethod(), equalTo(method));
method = Methods.class.getMethod("list2");
methodParameter = MethodParameter.forExecutable(method, -1);
type = ResolvableType.forMethodParameter(methodParameter);
assertThat(((MethodParameter)type.getSource()).getMethod(), equalTo(method));
}
@Test
public void forMethodReturn() throws Exception {
Method method = Methods.class.getMethod("charSequenceReturn");
@ -1439,6 +1453,10 @@ public class ResolvableTypeTests {
T typedReturn();
Set<?> wildcardSet();
List<String> list1();
List<String> list2();
}