@@ -63,6 +63,28 @@ void registerTypeForSerializationWithEmptyClass() {
63
63
});
64
64
}
65
65
66
+ @ Test
67
+ void registerTypeForSerializationWithExtendingClass () {
68
+ bindingRegistrar .registerReflectionHints (this .hints .reflection (), SampleExtendingClass .class );
69
+ assertThat (this .hints .reflection ().typeHints ()).satisfiesExactlyInAnyOrder (
70
+ typeHint -> {
71
+ assertThat (typeHint .getType ()).isEqualTo (TypeReference .of (SampleEmptyClass .class ));
72
+ assertThat (typeHint .getMemberCategories ()).containsExactlyInAnyOrder (
73
+ MemberCategory .DECLARED_FIELDS , MemberCategory .INVOKE_DECLARED_CONSTRUCTORS );
74
+ assertThat (typeHint .constructors ()).isEmpty ();
75
+ assertThat (typeHint .fields ()).isEmpty ();
76
+ assertThat (typeHint .methods ()).isEmpty ();
77
+ },
78
+ typeHint -> {
79
+ assertThat (typeHint .getType ()).isEqualTo (TypeReference .of (SampleExtendingClass .class ));
80
+ assertThat (typeHint .getMemberCategories ()).containsExactlyInAnyOrder (
81
+ MemberCategory .DECLARED_FIELDS , MemberCategory .INVOKE_DECLARED_CONSTRUCTORS );
82
+ assertThat (typeHint .constructors ()).isEmpty ();
83
+ assertThat (typeHint .fields ()).isEmpty ();
84
+ assertThat (typeHint .methods ()).isEmpty ();
85
+ });
86
+ }
87
+
66
88
@ Test
67
89
void registerTypeForSerializationWithNoProperty () {
68
90
bindingRegistrar .registerReflectionHints (this .hints .reflection (), SampleClassWithNoProperty .class );
@@ -284,6 +306,9 @@ void registerTypeForAnnotationOnMethodAndField() {
284
306
static class SampleEmptyClass {
285
307
}
286
308
309
+ static class SampleExtendingClass extends SampleEmptyClass {
310
+ }
311
+
287
312
static class SampleClassWithNoProperty {
288
313
289
314
String name () {
0 commit comments