@@ -1956,41 +1956,25 @@ void synthesizeNonPublicWithAttributeAliasesFromDifferentPackage() throws Except
1956
1956
}
1957
1957
1958
1958
@ Test
1959
- void synthesizeWithAttributeAliasesInNestedAnnotations () throws Exception {
1959
+ void synthesizeWithArrayOfAnnotations () throws Exception {
1960
1960
Hierarchy hierarchy = HierarchyClass .class .getAnnotation (Hierarchy .class );
1961
1961
assertThat (hierarchy ).isNotNull ();
1962
1962
Hierarchy synthesizedHierarchy = MergedAnnotation .from (hierarchy ).synthesize ();
1963
1963
assertThat (synthesizedHierarchy ).isInstanceOf (SynthesizedAnnotation .class );
1964
1964
TestConfiguration [] configs = synthesizedHierarchy .value ();
1965
1965
assertThat (configs ).isNotNull ();
1966
1966
assertThat (configs ).allMatch (SynthesizedAnnotation .class ::isInstance );
1967
- assertThat (
1968
- Arrays .stream (configs ).map (TestConfiguration ::location )).containsExactly (
1969
- "A" , "B" );
1970
- assertThat (Arrays .stream (configs ).map (TestConfiguration ::value )).containsExactly (
1971
- "A" , "B" );
1972
- }
1967
+ assertThat (configs ).extracting (TestConfiguration ::value ).containsExactly ("A" , "B" );
1968
+ assertThat (configs ).extracting (TestConfiguration ::location ).containsExactly ("A" , "B" );
1973
1969
1974
- @ Test
1975
- void synthesizeWithArrayOfAnnotations () throws Exception {
1976
- Hierarchy hierarchy = HierarchyClass .class .getAnnotation (Hierarchy .class );
1977
- assertThat (hierarchy ).isNotNull ();
1978
- Hierarchy synthesizedHierarchy = MergedAnnotation .from (hierarchy ).synthesize ();
1979
- assertThat (synthesizedHierarchy ).isInstanceOf (SynthesizedAnnotation .class );
1980
- TestConfiguration contextConfig = TestConfigurationClass .class .getAnnotation (
1981
- TestConfiguration .class );
1970
+ TestConfiguration contextConfig = TestConfigurationClass .class .getAnnotation (TestConfiguration .class );
1982
1971
assertThat (contextConfig ).isNotNull ();
1983
- TestConfiguration [] configs = synthesizedHierarchy .value ();
1984
- assertThat (
1985
- Arrays .stream (configs ).map (TestConfiguration ::location )).containsExactly (
1986
- "A" , "B" );
1987
1972
// Alter array returned from synthesized annotation
1988
1973
configs [0 ] = contextConfig ;
1974
+ assertThat (configs ).extracting (TestConfiguration ::value ).containsExactly ("simple.xml" , "B" );
1989
1975
// Re-retrieve the array from the synthesized annotation
1990
1976
configs = synthesizedHierarchy .value ();
1991
- assertThat (
1992
- Arrays .stream (configs ).map (TestConfiguration ::location )).containsExactly (
1993
- "A" , "B" );
1977
+ assertThat (configs ).extracting (TestConfiguration ::value ).containsExactly ("A" , "B" );
1994
1978
}
1995
1979
1996
1980
@ Test
0 commit comments