Polishing

This commit is contained in:
Sam Brannen
2022-09-04 17:51:48 +02:00
parent afff849992
commit 8d6d3f2698

View File

@@ -64,26 +64,20 @@ class TestContextRuntimeHints implements RuntimeHintsRegistrar {
}
}
// Loaded reflectively in BootstrapUtils
registerAnnotation(runtimeHints.reflection(),
// Loaded reflectively in BootstrapUtils
org.springframework.test.context.web.WebAppConfiguration.class
);
}
private static void registerPublicConstructors(ReflectionHints reflectionHints, Class<?>... types) {
registerPublicConstructors(reflectionHints, TypeReference.listOf(types));
}
private static void registerPublicConstructors(ReflectionHints reflectionHints, Iterable<TypeReference> types) {
reflectionHints.registerTypes(types, TypeHint.builtWith(MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS));
reflectionHints.registerTypes(TypeReference.listOf(types),
TypeHint.builtWith(MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS));
}
private static void registerDeclaredConstructors(ReflectionHints reflectionHints, String... classNames) {
registerDeclaredConstructors(reflectionHints, listOf(classNames));
}
private static void registerDeclaredConstructors(ReflectionHints reflectionHints, Iterable<TypeReference> types) {
reflectionHints.registerTypes(types, TypeHint.builtWith(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS));
reflectionHints.registerTypes(listOf(classNames),
TypeHint.builtWith(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS));
}
private static List<TypeReference> listOf(String... classNames) {