Skip to content

Commit c184dbc

Browse files
committed
Polish test
1 parent 5fa0963 commit c184dbc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,22 +1036,22 @@ void findMethodByParameterNamesWithWithCustomTypeFromDifferentClassLoader() thro
10361036

10371037
try (TestClassLoader customTypeClassLoader = TestClassLoader.forClassNamePrefix(customTypeName)) {
10381038
var customType = customTypeClassLoader.loadClass(customTypeName);
1039-
assertThat(customType.getClassLoader()).isInstanceOf(TestClassLoader.class);
1039+
assertThat(customType.getClassLoader()).isEqualTo(customTypeClassLoader);
10401040

10411041
var optional = findMethod(customType, methodName, nestedTypeName);
10421042
assertThat(optional).get().satisfies(method -> {
10431043
assertThat(method.getName()).isEqualTo(methodName);
10441044

10451045
var declaringClass = method.getDeclaringClass();
1046-
assertThat(declaringClass.getClassLoader()).isInstanceOf(TestClassLoader.class);
1046+
assertThat(declaringClass.getClassLoader()).isEqualTo(customTypeClassLoader);
10471047
assertThat(declaringClass.getName()).isEqualTo(customTypeName);
10481048
assertThat(declaringClass).isNotEqualTo(CustomType.class);
10491049

10501050
var parameterTypes = method.getParameterTypes();
10511051
assertThat(parameterTypes).extracting(Class::getName).containsExactly(nestedTypeName);
10521052
Class<?> parameterType = parameterTypes[0];
10531053
assertThat(parameterType).isNotEqualTo(CustomType.NestedType.class);
1054-
assertThat(parameterType.getClassLoader()).isInstanceOf(TestClassLoader.class);
1054+
assertThat(parameterType.getClassLoader()).isEqualTo(customTypeClassLoader);
10551055
});
10561056
}
10571057
}

0 commit comments

Comments
 (0)