File tree 1 file changed +32
-0
lines changed
src/test/java/com/fasterxml/jackson/failing
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .fasterxml .jackson .failing ;
2
+
3
+
4
+ import com .fasterxml .jackson .databind .JavaType ;
5
+ import com .fasterxml .jackson .databind .ObjectMapper ;
6
+ import org .junit .Test ;
7
+
8
+ import java .lang .reflect .Method ;
9
+ import java .lang .reflect .Type ;
10
+
11
+ import static org .junit .Assert .assertEquals ;
12
+
13
+ public class GenericParameterTypeFactory1456Test {
14
+ public static class BaseController <Entity extends BaseEntity > {
15
+ public void process (Entity entity ) {}
16
+ }
17
+
18
+ public static class ImplController extends BaseController <ImplEntity > {}
19
+
20
+ public static class BaseEntity {}
21
+
22
+ public static class ImplEntity extends BaseEntity {}
23
+
24
+ @ Test
25
+ public void testGenericParameterHierarchy () throws NoSuchMethodException {
26
+ Method proceed = BaseController .class .getMethod ("process" , BaseEntity .class );
27
+ Type entityType = proceed .getGenericParameterTypes ()[0 ];
28
+
29
+ JavaType resolvedType = new ObjectMapper ().getTypeFactory ().constructType (entityType , ImplController .class );
30
+ assertEquals (ImplEntity .class , resolvedType .getRawClass ());
31
+ }
32
+ }
You can’t perform that action at this time.
0 commit comments