|
|
|
@ -24,7 +24,6 @@ import org.junit.jupiter.api.Test;
@@ -24,7 +24,6 @@ import org.junit.jupiter.api.Test;
|
|
|
|
|
|
|
|
|
|
import org.springframework.aot.hint.JdkProxyHint; |
|
|
|
|
import org.springframework.aot.hint.MemberCategory; |
|
|
|
|
import org.springframework.aot.hint.ReflectionHints; |
|
|
|
|
import org.springframework.aot.hint.RuntimeHints; |
|
|
|
|
import org.springframework.aot.hint.TypeHint; |
|
|
|
|
import org.springframework.aot.hint.TypeReference; |
|
|
|
@ -74,7 +73,8 @@ class RuntimeHintsUtilsTests {
@@ -74,7 +73,8 @@ class RuntimeHintsUtilsTests {
|
|
|
|
|
RuntimeHintsUtils.registerAnnotation(this.hints, RetryInvoker.class); |
|
|
|
|
assertThat(this.hints.reflection().typeHints()) |
|
|
|
|
.anySatisfy(annotationHint(RetryInvoker.class)) |
|
|
|
|
.anySatisfy(annotationHint(SampleInvoker.class)); |
|
|
|
|
.anySatisfy(annotationHint(SampleInvoker.class)) |
|
|
|
|
.hasSize(2); |
|
|
|
|
assertThat(this.hints.proxies().jdkProxies()) |
|
|
|
|
.anySatisfy(annotationProxy(RetryInvoker.class)) |
|
|
|
|
.anySatisfy(annotationProxy(SampleInvoker.class)) |
|
|
|
@ -92,8 +92,7 @@ class RuntimeHintsUtilsTests {
@@ -92,8 +92,7 @@ class RuntimeHintsUtilsTests {
|
|
|
|
|
@Test |
|
|
|
|
void registerAnnotationTypeWhereUsedAsAMetaAnnotationRegistersHierarchy() { |
|
|
|
|
RuntimeHintsUtils.registerAnnotation(this.hints, RetryWithEnabledFlagInvoker.class); |
|
|
|
|
ReflectionHints reflection = this.hints.reflection(); |
|
|
|
|
assertThat(reflection.typeHints()) |
|
|
|
|
assertThat(this.hints.reflection().typeHints()) |
|
|
|
|
.anySatisfy(annotationHint(RetryWithEnabledFlagInvoker.class)) |
|
|
|
|
.anySatisfy(annotationHint(RetryInvoker.class)) |
|
|
|
|
.anySatisfy(annotationHint(SampleInvoker.class)) |
|
|
|
@ -117,8 +116,7 @@ class RuntimeHintsUtilsTests {
@@ -117,8 +116,7 @@ class RuntimeHintsUtilsTests {
|
|
|
|
|
|
|
|
|
|
private Consumer<JdkProxyHint> annotationProxy(Class<?> type) { |
|
|
|
|
return jdkProxyHint -> assertThat(jdkProxyHint.getProxiedInterfaces()) |
|
|
|
|
.containsExactly(TypeReference.of(type), |
|
|
|
|
TypeReference.of(SynthesizedAnnotation.class)); |
|
|
|
|
.containsExactly(TypeReference.of(type), TypeReference.of(SynthesizedAnnotation.class)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -154,7 +152,7 @@ class RuntimeHintsUtilsTests {
@@ -154,7 +152,7 @@ class RuntimeHintsUtilsTests {
|
|
|
|
|
@RetryInvoker |
|
|
|
|
@interface RetryWithEnabledFlagInvoker { |
|
|
|
|
|
|
|
|
|
@AliasFor(attribute = "value", annotation = RetryInvoker.class) |
|
|
|
|
@AliasFor(annotation = RetryInvoker.class) |
|
|
|
|
int value() default 5; |
|
|
|
|
|
|
|
|
|
boolean enabled() default true; |
|
|
|
|