Annotation Interface EnabledIfRuntimeHintsAgent
@Target({TYPE,METHOD})
@Retention(RUNTIME)
@Documented
@ExtendWith(org.springframework.aot.test.agent.RuntimeHintsAgentCondition.class)
@Tag("RuntimeHintsTests")
public @interface EnabledIfRuntimeHintsAgent
@EneabledIfRuntimeHintsAgent signals that the annotated test class or test method
is only enabled if the RuntimeHintsAgent is loaded on the current JVM.
@EnabledIfRuntimeHintsAgent
class MyTestCases {
@Test
void hintsForMethodsReflectionShouldMatch() {
RuntimeHints hints = new RuntimeHints();
hints.reflection().registerType(String.class,
hint -> hint.withMembers(MemberCategory.INTROSPECT_PUBLIC_METHODS));
RuntimeHintsInvocations invocations = RuntimeHintsRecorder.record(() -> {
Method[] methods = String.class.getMethods();
});
assertThat(invocations).match(hints);
}
}
- Since:
- 6.0
- Author:
- Brian Clozel