Introduce failing @Disabled test for gh-23856
This commit is contained in:
@@ -34,6 +34,7 @@ import javax.annotation.Nonnull;
|
|||||||
import javax.annotation.ParametersAreNonnullByDefault;
|
import javax.annotation.ParametersAreNonnullByDefault;
|
||||||
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Disabled;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.core.Ordered;
|
import org.springframework.core.Ordered;
|
||||||
@@ -964,6 +965,25 @@ class AnnotationUtilsTests {
|
|||||||
TestRepeatableContainer.class)).isNotNull();
|
TestRepeatableContainer.class)).isNotNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test // gh-23856
|
||||||
|
void findAnnotationFindsRepeatableContainerOnComposedAnnotationMetaAnnotatedWithRepeatableAnnotations() {
|
||||||
|
MyRepeatableContainer annotation = AnnotationUtils.findAnnotation(MyRepeatableMeta1And2.class, MyRepeatableContainer.class);
|
||||||
|
|
||||||
|
assertThat(annotation).isNotNull();
|
||||||
|
assertThat(annotation.value()).extracting(MyRepeatable::value).containsExactly("meta1", "meta2");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test // gh-23856
|
||||||
|
@Disabled("disabled until gh-23856 is resolved")
|
||||||
|
void findAnnotationFindsRepeatableContainerOnComposedAnnotationMetaAnnotatedWithRepeatableAnnotationsOnMethod() throws NoSuchMethodException {
|
||||||
|
Method method = getClass().getDeclaredMethod("methodWithComposedAnnotationMetaAnnotatedWithRepeatableAnnotations");
|
||||||
|
MyRepeatableContainer annotation = AnnotationUtils.findAnnotation(method, MyRepeatableContainer.class);
|
||||||
|
|
||||||
|
assertThat(annotation).isNotNull();
|
||||||
|
assertThat(annotation.value()).extracting(MyRepeatable::value).containsExactly("meta1", "meta2");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@SafeVarargs
|
@SafeVarargs
|
||||||
static <T> T[] asArray(T... arr) {
|
static <T> T[] asArray(T... arr) {
|
||||||
return arr;
|
return arr;
|
||||||
@@ -1262,6 +1282,17 @@ class AnnotationUtilsTests {
|
|||||||
@interface MyRepeatableMeta2 {
|
@interface MyRepeatableMeta2 {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Inherited
|
||||||
|
@MyRepeatable("meta1")
|
||||||
|
@MyRepeatable("meta2")
|
||||||
|
@interface MyRepeatableMeta1And2 {
|
||||||
|
}
|
||||||
|
|
||||||
|
@MyRepeatableMeta1And2
|
||||||
|
void methodWithComposedAnnotationMetaAnnotatedWithRepeatableAnnotations() {
|
||||||
|
}
|
||||||
|
|
||||||
interface InterfaceWithRepeated {
|
interface InterfaceWithRepeated {
|
||||||
|
|
||||||
@MyRepeatable("A")
|
@MyRepeatable("A")
|
||||||
|
|||||||
Reference in New Issue
Block a user