@ -290,11 +290,11 @@ public abstract class AbstractAnnotationMetadataTests {
void getComplexAttributeTypesReturnsAll ( ) {
void getComplexAttributeTypesReturnsAll ( ) {
MultiValueMap < String , Object > attributes =
MultiValueMap < String , Object > attributes =
get ( WithComplexAttributeTypes . class ) . getAllAnnotationAttributes ( ComplexAttributes . class . getName ( ) ) ;
get ( WithComplexAttributeTypes . class ) . getAllAnnotationAttributes ( ComplexAttributes . class . getName ( ) ) ;
assertThat ( attributes ) . containsOnlyKeys ( "names" , "count" , "type" , "subAnnotation" ) ;
assertThat ( attributes ) . containsOnlyKeys ( "names" , "count" , "types " , "subAnnotation" ) ;
assertThat ( attributes . get ( "names" ) ) . hasSize ( 1 ) ;
assertThat ( attributes . get ( "names" ) ) . hasSize ( 1 ) ;
assertThat ( attributes . get ( "names" ) . get ( 0 ) ) . isEqualTo ( new String [ ] { "first" , "second" } ) ;
assertThat ( attributes . get ( "names" ) . get ( 0 ) ) . isEqualTo ( new String [ ] { "first" , "second" } ) ;
assertThat ( attributes . get ( "count" ) ) . containsExactlyInAnyOrder ( TestEnum . ONE ) ;
assertThat ( attributes . get ( "count" ) . get ( 0 ) ) . isEqualTo ( new TestEnum [ ] { TestEnum . ONE , TestEnum . TWO } ) ;
assertThat ( attributes . get ( "type" ) ) . containsExactlyInAnyOrder ( TestEnum . class ) ;
assertThat ( attributes . get ( "types " ) . get ( 0 ) ) . isEqualTo ( new Class [ ] { TestEnum . class } ) ;
assertThat ( attributes . get ( "subAnnotation" ) ) . hasSize ( 1 ) ;
assertThat ( attributes . get ( "subAnnotation" ) ) . hasSize ( 1 ) ;
}
}
@ -312,8 +312,8 @@ public abstract class AbstractAnnotationMetadataTests {
void getAnnotationAttributeIntType ( ) {
void getAnnotationAttributeIntType ( ) {
MultiValueMap < String , Object > attributes =
MultiValueMap < String , Object > attributes =
get ( WithIntType . class ) . getAllAnnotationAttributes ( ComplexAttributes . class . getName ( ) ) ;
get ( WithIntType . class ) . getAllAnnotationAttributes ( ComplexAttributes . class . getName ( ) ) ;
assertThat ( attributes ) . containsOnlyKeys ( "names" , "count" , "type" , "subAnnotation" ) ;
assertThat ( attributes ) . containsOnlyKeys ( "names" , "count" , "types " , "subAnnotation" ) ;
assertThat ( attributes . get ( "type" ) ) . contains ( int . class ) ;
assertThat ( attributes . get ( "types " ) . get ( 0 ) ) . isEqualTo ( new Class [ ] { int . class } ) ;
}
}
@Test
@Test
@ -454,13 +454,13 @@ public abstract class AbstractAnnotationMetadataTests {
}
}
@ComplexAttributes ( names = { "first" , "second" } , count = TestEnum . ONE ,
@ComplexAttributes ( names = { "first" , "second" } , count = { TestEnum . ONE , TestEnum . TWO } ,
type = TestEnum . class , subAnnotation = @SubAnnotation ( name = "spring" ) )
types = { TestEnum . class } , subAnnotation = @SubAnnotation ( name = "spring" ) )
@Metadata ( mv = { 42 } )
@Metadata ( mv = { 42 } )
public static class WithComplexAttributeTypes {
public static class WithComplexAttributeTypes {
}
}
@ComplexAttributes ( names = "void" , count = TestEnum . ONE , type = int . class ,
@ComplexAttributes ( names = "void" , count = TestEnum . ONE , types = int . class ,
subAnnotation = @SubAnnotation ( name = "spring" ) )
subAnnotation = @SubAnnotation ( name = "spring" ) )
public static class WithIntType {
public static class WithIntType {
@ -471,9 +471,9 @@ public abstract class AbstractAnnotationMetadataTests {
String [ ] names ( ) ;
String [ ] names ( ) ;
TestEnum count ( ) ;
TestEnum [ ] count ( ) ;
Class < ? > type ( ) ;
Class < ? > [ ] types ( ) ;
SubAnnotation subAnnotation ( ) ;
SubAnnotation subAnnotation ( ) ;
}
}
@ -484,7 +484,15 @@ public abstract class AbstractAnnotationMetadataTests {
}
}
public enum TestEnum {
public enum TestEnum {
ONE , TWO , THREE
ONE {
} ,
TWO {
} ,
THREE {
}
}
}
@RepeatableAnnotation ( name = "first" )
@RepeatableAnnotation ( name = "first" )