Fix hints and predicates for Field reflective access
This commit revisits the arrangement for Field hints after changes made in gh-34239. Closes gh-34294
This commit is contained in:
@@ -534,7 +534,7 @@ class AnnotationConfigApplicationContextTests {
|
||||
TypeReference cglibType = TypeReference.of(CglibConfiguration.class.getName() + "$$SpringCGLIB$$0");
|
||||
assertThat(RuntimeHintsPredicates.reflection().onType(cglibType)
|
||||
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
|
||||
MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.INVOKE_DECLARED_FIELDS))
|
||||
MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.ACCESS_DECLARED_FIELDS))
|
||||
.accepts(runtimeHints);
|
||||
assertThat(RuntimeHintsPredicates.reflection().onType(CglibConfiguration.class)
|
||||
.withMemberCategories(MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_DECLARED_METHODS))
|
||||
|
||||
@@ -79,7 +79,7 @@ class BeanValidationBeanRegistrationAotProcessorTests {
|
||||
process(MethodParameterLevelConstraint.class);
|
||||
assertThat(this.generationContext.getRuntimeHints().reflection().typeHints()).hasSize(2);
|
||||
assertThat(RuntimeHintsPredicates.reflection().onType(MethodParameterLevelConstraint.class)
|
||||
.withMemberCategory(MemberCategory.INVOKE_DECLARED_FIELDS)).accepts(this.generationContext.getRuntimeHints());
|
||||
.withMemberCategory(MemberCategory.ACCESS_DECLARED_FIELDS)).accepts(this.generationContext.getRuntimeHints());
|
||||
assertThat(RuntimeHintsPredicates.reflection().onType(ExistsValidator.class)
|
||||
.withMemberCategory(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(this.generationContext.getRuntimeHints());
|
||||
}
|
||||
@@ -89,7 +89,7 @@ class BeanValidationBeanRegistrationAotProcessorTests {
|
||||
process(ConstructorParameterLevelConstraint.class);
|
||||
assertThat(this.generationContext.getRuntimeHints().reflection().typeHints()).hasSize(2);
|
||||
assertThat(RuntimeHintsPredicates.reflection().onType(ConstructorParameterLevelConstraint.class)
|
||||
.withMemberCategory(MemberCategory.INVOKE_DECLARED_FIELDS)).accepts(this.generationContext.getRuntimeHints());
|
||||
.withMemberCategory(MemberCategory.ACCESS_DECLARED_FIELDS)).accepts(this.generationContext.getRuntimeHints());
|
||||
assertThat(RuntimeHintsPredicates.reflection().onType(ExistsValidator.class)
|
||||
.withMemberCategory(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(this.generationContext.getRuntimeHints());
|
||||
}
|
||||
@@ -99,7 +99,7 @@ class BeanValidationBeanRegistrationAotProcessorTests {
|
||||
process(PropertyLevelConstraint.class);
|
||||
assertThat(this.generationContext.getRuntimeHints().reflection().typeHints()).hasSize(2);
|
||||
assertThat(RuntimeHintsPredicates.reflection().onType(PropertyLevelConstraint.class)
|
||||
.withMemberCategory(MemberCategory.INVOKE_DECLARED_FIELDS)).accepts(this.generationContext.getRuntimeHints());
|
||||
.withMemberCategory(MemberCategory.ACCESS_DECLARED_FIELDS)).accepts(this.generationContext.getRuntimeHints());
|
||||
assertThat(RuntimeHintsPredicates.reflection().onType(ExistsValidator.class)
|
||||
.withMemberCategory(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(this.generationContext.getRuntimeHints());
|
||||
}
|
||||
@@ -109,7 +109,7 @@ class BeanValidationBeanRegistrationAotProcessorTests {
|
||||
process(GenericTypeLevelConstraint.class);
|
||||
assertThat(this.generationContext.getRuntimeHints().reflection().typeHints()).hasSize(2);
|
||||
assertThat(RuntimeHintsPredicates.reflection().onType(GenericTypeLevelConstraint.class)
|
||||
.withMemberCategory(MemberCategory.INVOKE_DECLARED_FIELDS)).accepts(this.generationContext.getRuntimeHints());
|
||||
.withMemberCategory(MemberCategory.ACCESS_DECLARED_FIELDS)).accepts(this.generationContext.getRuntimeHints());
|
||||
assertThat(RuntimeHintsPredicates.reflection().onType(PatternValidator.class)
|
||||
.withMemberCategory(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(this.generationContext.getRuntimeHints());
|
||||
}
|
||||
@@ -119,9 +119,9 @@ class BeanValidationBeanRegistrationAotProcessorTests {
|
||||
process(TransitiveGenericTypeLevelConstraint.class);
|
||||
assertThat(this.generationContext.getRuntimeHints().reflection().typeHints()).hasSize(3);
|
||||
assertThat(RuntimeHintsPredicates.reflection().onType(TransitiveGenericTypeLevelConstraint.class)
|
||||
.withMemberCategory(MemberCategory.INVOKE_DECLARED_FIELDS)).accepts(this.generationContext.getRuntimeHints());
|
||||
.withMemberCategory(MemberCategory.ACCESS_DECLARED_FIELDS)).accepts(this.generationContext.getRuntimeHints());
|
||||
assertThat(RuntimeHintsPredicates.reflection().onType(Exclude.class)
|
||||
.withMemberCategory(MemberCategory.INVOKE_DECLARED_FIELDS)).accepts(this.generationContext.getRuntimeHints());
|
||||
.withMemberCategory(MemberCategory.ACCESS_DECLARED_FIELDS)).accepts(this.generationContext.getRuntimeHints());
|
||||
assertThat(RuntimeHintsPredicates.reflection().onType(PatternValidator.class)
|
||||
.withMemberCategory(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(this.generationContext.getRuntimeHints());
|
||||
}
|
||||
@@ -132,7 +132,7 @@ class BeanValidationBeanRegistrationAotProcessorTests {
|
||||
process(beanClass);
|
||||
assertThat(this.generationContext.getRuntimeHints().reflection().typeHints()).hasSize(1);
|
||||
assertThat(RuntimeHintsPredicates.reflection().onType(beanClass)
|
||||
.withMemberCategory(MemberCategory.INVOKE_DECLARED_FIELDS)).accepts(this.generationContext.getRuntimeHints());
|
||||
.withMemberCategory(MemberCategory.ACCESS_DECLARED_FIELDS)).accepts(this.generationContext.getRuntimeHints());
|
||||
}
|
||||
|
||||
@Test // gh-33940
|
||||
|
||||
Reference in New Issue
Block a user