@@ -510,7 +510,7 @@ public void getRepeatableAnnotationsDeclaredOnClassWithMissingAttributeAliasDecl
510
510
exception .expect (AnnotationConfigurationException .class );
511
511
exception .expectMessage (containsString ("Attribute [value] in" ));
512
512
exception .expectMessage (containsString (BrokenContextConfig .class .getName ()));
513
- exception .expectMessage (containsString ("must be declared as an @AliasFor [locations ]" ));
513
+ exception .expectMessage (containsString ("must be declared as an @AliasFor [location ]" ));
514
514
getRepeatableAnnotations (BrokenConfigHierarchyTestCase .class , BrokenContextConfig .class , BrokenHierarchy .class );
515
515
}
516
516
@@ -525,7 +525,7 @@ public void getRepeatableAnnotationsDeclaredOnClassWithAttributeAliases() throws
525
525
annotations = getRepeatableAnnotations (ConfigHierarchyTestCase .class , ContextConfig .class , Hierarchy .class );
526
526
assertNotNull (annotations );
527
527
528
- List <String > locations = annotations .stream ().map (ContextConfig ::locations ).collect (toList ());
528
+ List <String > locations = annotations .stream ().map (ContextConfig ::location ).collect (toList ());
529
529
assertThat (locations , is (expectedLocations ));
530
530
531
531
List <String > values = annotations .stream ().map (ContextConfig ::value ).collect (toList ());
@@ -685,7 +685,7 @@ public void getAliasedAttributeNameFromWrongTargetAnnotation() throws Exception
685
685
@ Test
686
686
public void getAliasedAttributeNameFromAliasedComposedAnnotation () throws Exception {
687
687
Method attribute = AliasedComposedContextConfig .class .getDeclaredMethod ("xmlConfigFile" );
688
- assertEquals ("locations " , getAliasedAttributeName (attribute , ContextConfig .class ));
688
+ assertEquals ("location " , getAliasedAttributeName (attribute , ContextConfig .class ));
689
689
}
690
690
691
691
@ Test
@@ -712,10 +712,9 @@ public void synthesizeAlreadySynthesizedAnnotation() throws Exception {
712
712
WebMapping synthesizedWebMapping = synthesizeAnnotation (webMapping );
713
713
assertNotSame (webMapping , synthesizedWebMapping );
714
714
WebMapping synthesizedAgainWebMapping = synthesizeAnnotation (synthesizedWebMapping );
715
- assertSame (synthesizedWebMapping , synthesizedAgainWebMapping );
716
715
assertThat (synthesizedAgainWebMapping , instanceOf (SynthesizedAnnotation .class ));
716
+ assertSame (synthesizedWebMapping , synthesizedAgainWebMapping );
717
717
718
- assertNotNull (synthesizedAgainWebMapping );
719
718
assertEquals ("name attribute: " , "foo" , synthesizedAgainWebMapping .name ());
720
719
assertEquals ("aliased path attribute: " , "/test" , synthesizedAgainWebMapping .path ());
721
720
assertEquals ("actual value attribute: " , "/test" , synthesizedAgainWebMapping .value ());
@@ -837,7 +836,7 @@ public void synthesizeAnnotationWithAttributeAliasForMetaAnnotationThatIsNotMeta
837
836
exception .expect (AnnotationConfigurationException .class );
838
837
exception .expectMessage (startsWith ("@AliasFor declaration on attribute [xmlConfigFile] in annotation" ));
839
838
exception .expectMessage (containsString (AliasedComposedContextConfigNotMetaPresent .class .getName ()));
840
- exception .expectMessage (containsString ("declares an alias for attribute [locations ] in meta-annotation" ));
839
+ exception .expectMessage (containsString ("declares an alias for attribute [location ] in meta-annotation" ));
841
840
exception .expectMessage (containsString (ContextConfig .class .getName ()));
842
841
exception .expectMessage (endsWith ("which is not meta-present." ));
843
842
synthesizeAnnotation (annotation );
@@ -850,18 +849,16 @@ public void synthesizeAnnotationWithAttributeAliases() throws Exception {
850
849
assertNotNull (webMapping );
851
850
852
851
WebMapping synthesizedWebMapping1 = synthesizeAnnotation (webMapping );
853
- assertNotNull (synthesizedWebMapping1 );
854
- assertNotSame (webMapping , synthesizedWebMapping1 );
855
852
assertThat (synthesizedWebMapping1 , instanceOf (SynthesizedAnnotation .class ));
853
+ assertNotSame (webMapping , synthesizedWebMapping1 );
856
854
857
855
assertEquals ("name attribute: " , "foo" , synthesizedWebMapping1 .name ());
858
856
assertEquals ("aliased path attribute: " , "/test" , synthesizedWebMapping1 .path ());
859
857
assertEquals ("actual value attribute: " , "/test" , synthesizedWebMapping1 .value ());
860
858
861
859
WebMapping synthesizedWebMapping2 = synthesizeAnnotation (webMapping );
862
- assertNotNull (synthesizedWebMapping2 );
863
- assertNotSame (webMapping , synthesizedWebMapping2 );
864
860
assertThat (synthesizedWebMapping2 , instanceOf (SynthesizedAnnotation .class ));
861
+ assertNotSame (webMapping , synthesizedWebMapping2 );
865
862
866
863
assertEquals ("name attribute: " , "foo" , synthesizedWebMapping2 .name ());
867
864
assertEquals ("aliased path attribute: " , "/test" , synthesizedWebMapping2 .path ());
@@ -955,17 +952,17 @@ public void synthesizeAnnotationFromDefaultsWithAttributeAliases() throws Except
955
952
ContextConfig contextConfig = synthesizeAnnotation (ContextConfig .class );
956
953
assertNotNull (contextConfig );
957
954
assertEquals ("value: " , "" , contextConfig .value ());
958
- assertEquals ("locations : " , "" , contextConfig .locations ());
955
+ assertEquals ("location : " , "" , contextConfig .location ());
959
956
}
960
957
961
958
@ Test
962
959
public void synthesizeAnnotationFromMapWithMinimalAttributesWithAttributeAliases () throws Exception {
963
960
Map <String , Object > map = new HashMap <String , Object >();
964
- map .put ("locations " , "test.xml" );
961
+ map .put ("location " , "test.xml" );
965
962
ContextConfig contextConfig = synthesizeAnnotation (map , ContextConfig .class , null );
966
963
assertNotNull (contextConfig );
967
964
assertEquals ("value: " , "test.xml" , contextConfig .value ());
968
- assertEquals ("locations : " , "test.xml" , contextConfig .locations ());
965
+ assertEquals ("location : " , "test.xml" , contextConfig .location ());
969
966
}
970
967
971
968
@ Test
@@ -1177,7 +1174,7 @@ public void synthesizeAnnotationWithAttributeAliasesInNestedAnnotations() throws
1177
1174
assertTrue ("nested annotations must be synthesized" ,
1178
1175
Arrays .stream (configs ).allMatch (c -> c instanceof SynthesizedAnnotation ));
1179
1176
1180
- List <String > locations = Arrays .stream (configs ).map (ContextConfig ::locations ).collect (toList ());
1177
+ List <String > locations = Arrays .stream (configs ).map (ContextConfig ::location ).collect (toList ());
1181
1178
assertThat (locations , is (expectedLocations ));
1182
1179
1183
1180
List <String > values = Arrays .stream (configs ).map (ContextConfig ::value ).collect (toList ());
@@ -1197,7 +1194,7 @@ public void synthesizeAnnotationWithArrayOfAnnotations() throws Exception {
1197
1194
assertNotNull (contextConfig );
1198
1195
1199
1196
ContextConfig [] configs = synthesizedHierarchy .value ();
1200
- List <String > locations = Arrays .stream (configs ).map (ContextConfig ::locations ).collect (toList ());
1197
+ List <String > locations = Arrays .stream (configs ).map (ContextConfig ::location ).collect (toList ());
1201
1198
assertThat (locations , is (expectedLocations ));
1202
1199
1203
1200
// Alter array returned from synthesized annotation
@@ -1571,22 +1568,22 @@ public void handleMappedWithDifferentPathAndValueAttributes() {
1571
1568
@ Retention (RetentionPolicy .RUNTIME )
1572
1569
@interface ContextConfig {
1573
1570
1574
- @ AliasFor ("locations " )
1571
+ @ AliasFor ("location " )
1575
1572
String value () default "" ;
1576
1573
1577
1574
@ AliasFor ("value" )
1578
- String locations () default "" ;
1575
+ String location () default "" ;
1579
1576
}
1580
1577
1581
1578
@ Retention (RetentionPolicy .RUNTIME )
1582
1579
@interface BrokenContextConfig {
1583
1580
1584
1581
// Intentionally missing:
1585
- // @AliasFor("locations ")
1582
+ // @AliasFor("location ")
1586
1583
String value () default "" ;
1587
1584
1588
1585
@ AliasFor ("value" )
1589
- String locations () default "" ;
1586
+ String location () default "" ;
1590
1587
}
1591
1588
1592
1589
/**
@@ -1602,7 +1599,7 @@ public void handleMappedWithDifferentPathAndValueAttributes() {
1602
1599
BrokenContextConfig [] value ();
1603
1600
}
1604
1601
1605
- @ Hierarchy ({ @ ContextConfig ("A" ), @ ContextConfig (locations = "B" ) })
1602
+ @ Hierarchy ({ @ ContextConfig ("A" ), @ ContextConfig (location = "B" ) })
1606
1603
static class ConfigHierarchyTestCase {
1607
1604
}
1608
1605
@@ -1735,7 +1732,7 @@ static class AliasForAttributeWithDifferentDefaultValueClass {
1735
1732
@ Retention (RetentionPolicy .RUNTIME )
1736
1733
@interface AliasedComposedContextConfigNotMetaPresent {
1737
1734
1738
- @ AliasFor (annotation = ContextConfig .class , attribute = "locations " )
1735
+ @ AliasFor (annotation = ContextConfig .class , attribute = "location " )
1739
1736
String xmlConfigFile ();
1740
1737
}
1741
1738
@@ -1747,7 +1744,7 @@ static class AliasedComposedContextConfigNotMetaPresentClass {
1747
1744
@ Retention (RetentionPolicy .RUNTIME )
1748
1745
@interface AliasedComposedContextConfig {
1749
1746
1750
- @ AliasFor (annotation = ContextConfig .class , attribute = "locations " )
1747
+ @ AliasFor (annotation = ContextConfig .class , attribute = "location " )
1751
1748
String xmlConfigFile ();
1752
1749
}
1753
1750
@@ -1758,7 +1755,7 @@ static class AliasedComposedContextConfigNotMetaPresentClass {
1758
1755
}
1759
1756
1760
1757
/**
1761
- * Mock of {@code org.springframework.context.annotation.ComponentScan}
1758
+ * Mock of {@code org.springframework.context.annotation.ComponentScan}.
1762
1759
*/
1763
1760
@ Retention (RetentionPolicy .RUNTIME )
1764
1761
@interface ComponentScan {
@@ -1770,7 +1767,7 @@ static class ComponentScanClass {
1770
1767
}
1771
1768
1772
1769
/**
1773
- * Mock of {@code org.springframework.context.annotation.ComponentScan}
1770
+ * Mock of {@code org.springframework.context.annotation.ComponentScan}.
1774
1771
*/
1775
1772
@ Retention (RetentionPolicy .RUNTIME )
1776
1773
@interface ComponentScanSingleFilter {
0 commit comments