Skip to content

Commit 3a0a5ed

Browse files
committed
Update JavaTypeKindParameterizedTypeTest.java
1 parent daaf336 commit 3a0a5ed

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

microsphere-java-core/src/test/java/io/microsphere/reflect/JavaTypeKindParameterizedTypeTest.java

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
import io.microsphere.reflect.JavaType.Kind;
2020
import io.microsphere.test.B;
2121
import io.microsphere.test.C;
22-
import io.microsphere.test.D;
2322
import org.junit.jupiter.api.Test;
2423

2524
import java.lang.reflect.Type;
2625
import java.util.RandomAccess;
2726

2827
import static io.microsphere.reflect.JavaType.Kind.PARAMETERIZED_TYPE;
2928
import static io.microsphere.reflect.JavaType.from;
29+
import static io.microsphere.reflect.JavaTypeKindTest.C_STRING_PARAMETERIZED_TYPE;
3030
import static org.junit.jupiter.api.Assertions.assertEquals;
3131
import static org.junit.jupiter.api.Assertions.assertSame;
3232
import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -39,24 +39,17 @@
3939
*/
4040
public 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

Comments
 (0)