|
|
|
|
@ -98,6 +98,21 @@ class ReflectionHintsPredicatesTests {
@@ -98,6 +98,21 @@ class ReflectionHintsPredicatesTests {
|
|
|
|
|
assertPredicateDoesNotMatch(reflection.onType(SampleClass.class).withMemberCategory(MemberCategory.INVOKE_PUBLIC_METHODS)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void typeWithMemberCategoriesMatchesCategories() { |
|
|
|
|
runtimeHints.reflection().registerType(SampleClass.class, builder -> |
|
|
|
|
builder.withMembers(MemberCategory.INTROSPECT_PUBLIC_CONSTRUCTORS, MemberCategory.INTROSPECT_PUBLIC_METHODS)); |
|
|
|
|
assertPredicateMatches(reflection.onType(SampleClass.class) |
|
|
|
|
.withMemberCategories(MemberCategory.INTROSPECT_PUBLIC_CONSTRUCTORS, MemberCategory.INTROSPECT_PUBLIC_METHODS)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void typeWithMemberCategoriesDoesNotMatchMissingCategory() { |
|
|
|
|
runtimeHints.reflection().registerType(SampleClass.class, builder -> builder.withMembers(MemberCategory.INTROSPECT_PUBLIC_METHODS)); |
|
|
|
|
assertPredicateDoesNotMatch(reflection.onType(SampleClass.class) |
|
|
|
|
.withMemberCategories(MemberCategory.INTROSPECT_PUBLIC_CONSTRUCTORS, MemberCategory.INTROSPECT_PUBLIC_METHODS)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void typeWithAnyMemberCategoryFailsWithNullCategories() { |
|
|
|
|
runtimeHints.reflection().registerType(SampleClass.class, builder -> builder.withMembers(MemberCategory.INTROSPECT_PUBLIC_METHODS)); |
|
|
|
|
|