Support properties on records in BindingReflectionHintsRegistrar
Closes gh-29571
This commit is contained in:
@@ -221,6 +221,13 @@ public class BindingReflectionHintsRegistrarTests {
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void registerTypeForSerializationWithRecordWithProperty() {
|
||||
bindingRegistrar.registerReflectionHints(this.hints.reflection(), SampleRecordWithProperty.class);
|
||||
assertThat(RuntimeHintsPredicates.reflection().onMethod(SampleRecordWithProperty.class, "getNameProperty"))
|
||||
.accepts(this.hints);
|
||||
}
|
||||
|
||||
@Test
|
||||
void registerTypeForSerializationWithAnonymousClass() {
|
||||
Runnable anonymousRunnable = () -> { };
|
||||
@@ -329,6 +336,13 @@ public class BindingReflectionHintsRegistrarTests {
|
||||
|
||||
record SampleRecord(String name) {}
|
||||
|
||||
record SampleRecordWithProperty(String name) {
|
||||
|
||||
public String getNameProperty() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
static class SampleClassWithJsonProperty {
|
||||
|
||||
@JsonProperty
|
||||
|
||||
Reference in New Issue
Block a user