|
|
|
@ -37,6 +37,9 @@ import static org.assertj.core.api.Assertions.assertThat;
@@ -37,6 +37,9 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
|
*/ |
|
|
|
|
class ProblemDetailRuntimeHintsTests { |
|
|
|
|
|
|
|
|
|
private static final List<String> METHOD_NAMES = List.of("getType", "getTitle", |
|
|
|
|
"getStatus", "getDetail", "getInstance", "getProperties"); |
|
|
|
|
|
|
|
|
|
private final RuntimeHints hints = new RuntimeHints(); |
|
|
|
|
|
|
|
|
|
@BeforeEach |
|
|
|
@ -48,9 +51,17 @@ class ProblemDetailRuntimeHintsTests {
@@ -48,9 +51,17 @@ class ProblemDetailRuntimeHintsTests {
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void getterMethodsShouldHaveReflectionHints() { |
|
|
|
|
List<String> methodNames = List.of("getType", "getTitle", "getStatus", "getDetail", "getInstance", "getProperties"); |
|
|
|
|
for (String methodName : methodNames) { |
|
|
|
|
assertThat(RuntimeHintsPredicates.reflection().onMethod(ProblemDetail.class, methodName)).accepts(this.hints); |
|
|
|
|
for (String methodName : METHOD_NAMES) { |
|
|
|
|
assertThat(RuntimeHintsPredicates.reflection() |
|
|
|
|
.onMethod(ProblemDetail.class, methodName)).accepts(this.hints); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void mixinShouldHaveReflectionHints() { |
|
|
|
|
for (String methodName : METHOD_NAMES) { |
|
|
|
|
assertThat(RuntimeHintsPredicates.reflection() |
|
|
|
|
.onMethod(ProblemDetailJacksonXmlMixin.class, methodName)).accepts(this.hints); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|