Add dedicated hint support for composable annotations

This commit adds a dedicated method for annotations that are used as
meta-annotation when the composed annotation does not require to be
visible at runtime.

Closes gh-28887
This commit is contained in:
Stephane Nicoll
2022-07-29 15:38:09 +02:00
parent 1aa4e7c68d
commit 916a871fbc
2 changed files with 28 additions and 1 deletions

View File

@@ -50,6 +50,15 @@ class RuntimeHintsUtilsTests {
assertThat(this.hints.proxies().jdkProxies()).isEmpty();
}
@Test
void registerComposableAnnotationType() {
RuntimeHintsUtils.registerComposableAnnotation(this.hints, SampleInvoker.class);
assertThat(this.hints.reflection().typeHints()).singleElement()
.satisfies(annotationHint(SampleInvoker.class));
assertThat(this.hints.proxies().jdkProxies()).singleElement()
.satisfies(annotationProxy(SampleInvoker.class));
}
@Test
void registerAnnotationTypeWithLocalUseOfAliasForRegistersProxy() {
RuntimeHintsUtils.registerAnnotation(this.hints, LocalMapping.class);