1919import io .microsphere .reflect .JavaType .Kind ;
2020import io .microsphere .test .B ;
2121import io .microsphere .test .C ;
22- import io .microsphere .test .D ;
2322import org .junit .jupiter .api .Test ;
2423
2524import java .lang .reflect .Type ;
2625import java .util .RandomAccess ;
2726
2827import static io .microsphere .reflect .JavaType .Kind .PARAMETERIZED_TYPE ;
2928import static io .microsphere .reflect .JavaType .from ;
29+ import static io .microsphere .reflect .JavaTypeKindTest .C_STRING_PARAMETERIZED_TYPE ;
3030import static org .junit .jupiter .api .Assertions .assertEquals ;
3131import static org .junit .jupiter .api .Assertions .assertSame ;
3232import static org .junit .jupiter .api .Assertions .assertThrows ;
3939 */
4040public class JavaTypeKindParameterizedTypeTest {
4141
42- /**
43- * ParameterizedType : {@link C<String>}
44- *
45- * @see C
46- */
47- private static final Type C_STRING_TYPE = D .class .getGenericSuperclass ();
48-
4942 @ Test
5043 public void testGetSuperType () {
51- Type superType = PARAMETERIZED_TYPE .getSuperType (C_STRING_TYPE );
44+ Type superType = PARAMETERIZED_TYPE .getSuperType (C_STRING_PARAMETERIZED_TYPE );
5245 assertSame (B .class , superType );
5346
5447 assertThrows (ClassCastException .class , () -> PARAMETERIZED_TYPE .getSuperType (String .class ));
5548 }
5649
5750 @ Test
5851 public void testGetRawType () {
59- Type rawType = PARAMETERIZED_TYPE .getRawType (C_STRING_TYPE );
52+ Type rawType = PARAMETERIZED_TYPE .getRawType (C_STRING_PARAMETERIZED_TYPE );
6053 assertSame (C .class , rawType );
6154
6255 assertThrows (ClassCastException .class , () -> PARAMETERIZED_TYPE .getRawType (String .class ));
@@ -65,7 +58,7 @@ public void testGetRawType() {
6558
6659 @ Test
6760 public void testGetInterfaces () {
68- Type [] interfaces = PARAMETERIZED_TYPE .getInterfaces (C_STRING_TYPE );
61+ Type [] interfaces = PARAMETERIZED_TYPE .getInterfaces (C_STRING_PARAMETERIZED_TYPE );
6962 assertEquals (1 , interfaces .length );
7063 assertEquals (RandomAccess .class , interfaces [0 ]);
7164
@@ -74,7 +67,7 @@ public void testGetInterfaces() {
7467
7568 @ Test
7669 public void testGetGenericTypes () {
77- Type [] genericTypes = PARAMETERIZED_TYPE .getGenericTypes (from (C_STRING_TYPE ));
70+ Type [] genericTypes = PARAMETERIZED_TYPE .getGenericTypes (from (C_STRING_PARAMETERIZED_TYPE ));
7871 assertEquals (1 , genericTypes .length );
7972 assertEquals (String .class , genericTypes [0 ]);
8073
0 commit comments