@@ -1262,7 +1262,7 @@ public void getDefaultValueFromNonPublicAnnotation() {
1262
1262
1263
1263
@ Test
1264
1264
public void getDefaultValueFromAnnotationType () {
1265
- MergedAnnotation <?> annotation = MergedAnnotation .from (Order .class );
1265
+ MergedAnnotation <?> annotation = MergedAnnotation .of (Order .class );
1266
1266
assertThat (annotation .getDefaultValue ("value" )).contains (
1267
1267
Ordered .LOWEST_PRECEDENCE );
1268
1268
}
@@ -1681,7 +1681,7 @@ public void synthesizeFromMapWithoutAttributeAliases() throws Exception {
1681
1681
Component component = WebController .class .getAnnotation (Component .class );
1682
1682
assertThat (component ).isNotNull ();
1683
1683
Map <String , Object > map = Collections .singletonMap ("value" , "webController" );
1684
- MergedAnnotation <Component > annotation = MergedAnnotation .from (Component .class ,
1684
+ MergedAnnotation <Component > annotation = MergedAnnotation .of (Component .class ,
1685
1685
map );
1686
1686
Component synthesizedComponent = annotation .synthesize ();
1687
1687
assertThat (synthesizedComponent ).isInstanceOf (SynthesizedAnnotation .class );
@@ -1702,7 +1702,7 @@ public void synthesizeFromMapWithNestedMap() throws Exception {
1702
1702
assertThat (filterMap .get ("pattern" )).isEqualTo ("*Foo" );
1703
1703
filterMap .put ("pattern" , "newFoo" );
1704
1704
filterMap .put ("enigma" , 42 );
1705
- MergedAnnotation <ComponentScanSingleFilter > annotation = MergedAnnotation .from (
1705
+ MergedAnnotation <ComponentScanSingleFilter > annotation = MergedAnnotation .of (
1706
1706
ComponentScanSingleFilter .class , map );
1707
1707
ComponentScanSingleFilter synthesizedComponentScan = annotation .synthesize ();
1708
1708
assertThat (synthesizedComponentScan ).isInstanceOf (SynthesizedAnnotation .class );
@@ -1726,7 +1726,7 @@ public void synthesizeFromMapWithNestedArrayOfMaps() throws Exception {
1726
1726
filters [0 ].put ("enigma" , 42 );
1727
1727
filters [1 ].put ("pattern" , "newBar" );
1728
1728
filters [1 ].put ("enigma" , 42 );
1729
- MergedAnnotation <ComponentScan > annotation = MergedAnnotation .from (
1729
+ MergedAnnotation <ComponentScan > annotation = MergedAnnotation .of (
1730
1730
ComponentScan .class , map );
1731
1731
ComponentScan synthesizedComponentScan = annotation .synthesize ();
1732
1732
assertThat (synthesizedComponentScan ).isInstanceOf (SynthesizedAnnotation .class );
@@ -1736,7 +1736,7 @@ public void synthesizeFromMapWithNestedArrayOfMaps() throws Exception {
1736
1736
1737
1737
@ Test
1738
1738
public void synthesizeFromDefaultsWithoutAttributeAliases () throws Exception {
1739
- MergedAnnotation <AnnotationWithDefaults > annotation = MergedAnnotation .from (
1739
+ MergedAnnotation <AnnotationWithDefaults > annotation = MergedAnnotation .of (
1740
1740
AnnotationWithDefaults .class );
1741
1741
AnnotationWithDefaults synthesized = annotation .synthesize ();
1742
1742
assertThat (synthesized .text ()).isEqualTo ("enigma" );
@@ -1746,7 +1746,7 @@ public void synthesizeFromDefaultsWithoutAttributeAliases() throws Exception {
1746
1746
1747
1747
@ Test
1748
1748
public void synthesizeFromDefaultsWithAttributeAliases () throws Exception {
1749
- MergedAnnotation <TestConfiguration > annotation = MergedAnnotation .from (
1749
+ MergedAnnotation <TestConfiguration > annotation = MergedAnnotation .of (
1750
1750
TestConfiguration .class );
1751
1751
TestConfiguration synthesized = annotation .synthesize ();
1752
1752
assertThat (synthesized .value ()).isEqualTo ("" );
@@ -1764,7 +1764,7 @@ public void synthesizeWhenAttributeAliasesWithDifferentValues() throws Exception
1764
1764
public void synthesizeFromMapWithMinimalAttributesWithAttributeAliases ()
1765
1765
throws Exception {
1766
1766
Map <String , Object > map = Collections .singletonMap ("location" , "test.xml" );
1767
- MergedAnnotation <TestConfiguration > annotation = MergedAnnotation .from (
1767
+ MergedAnnotation <TestConfiguration > annotation = MergedAnnotation .of (
1768
1768
TestConfiguration .class , map );
1769
1769
TestConfiguration synthesized = annotation .synthesize ();
1770
1770
assertThat (synthesized .value ()).isEqualTo ("test.xml" );
@@ -1782,7 +1782,7 @@ public void synthesizeFromMapWithAttributeAliasesThatOverrideArraysWithSingleEle
1782
1782
1783
1783
private void synthesizeFromMapWithAttributeAliasesThatOverrideArraysWithSingleElements (
1784
1784
Map <String , Object > map ) {
1785
- MergedAnnotation <GetMapping > annotation = MergedAnnotation .from (GetMapping .class ,
1785
+ MergedAnnotation <GetMapping > annotation = MergedAnnotation .of (GetMapping .class ,
1786
1786
map );
1787
1787
GetMapping synthesized = annotation .synthesize ();
1788
1788
assertThat (synthesized .value ()).isEqualTo ("/foo" );
@@ -1803,7 +1803,7 @@ private void testSynthesisFromMapWithImplicitAliases(String attributeNameAndValu
1803
1803
throws Exception {
1804
1804
Map <String , Object > map = Collections .singletonMap (attributeNameAndValue ,
1805
1805
attributeNameAndValue );
1806
- MergedAnnotation <ImplicitAliasesTestConfiguration > annotation = MergedAnnotation .from (
1806
+ MergedAnnotation <ImplicitAliasesTestConfiguration > annotation = MergedAnnotation .of (
1807
1807
ImplicitAliasesTestConfiguration .class , map );
1808
1808
ImplicitAliasesTestConfiguration synthesized = annotation .synthesize ();
1809
1809
assertThat (synthesized .value ()).isEqualTo (attributeNameAndValue );
@@ -1828,7 +1828,7 @@ public void synthesizeFromMapWithNullAttributeValue() throws Exception {
1828
1828
1829
1829
private void testMissingTextAttribute (Map <String , Object > attributes ) {
1830
1830
assertThatExceptionOfType (NoSuchElementException .class ).isThrownBy (() -> {
1831
- MergedAnnotation <AnnotationWithoutDefaults > annotation = MergedAnnotation .from (
1831
+ MergedAnnotation <AnnotationWithoutDefaults > annotation = MergedAnnotation .of (
1832
1832
AnnotationWithoutDefaults .class , attributes );
1833
1833
annotation .synthesize ();
1834
1834
}).withMessage ("No value found for attribute named 'text' in merged annotation "
@@ -1838,7 +1838,7 @@ private void testMissingTextAttribute(Map<String, Object> attributes) {
1838
1838
@ Test
1839
1839
public void synthesizeFromMapWithAttributeOfIncorrectType () throws Exception {
1840
1840
Map <String , Object > map = Collections .singletonMap ("value" , 42L );
1841
- MergedAnnotation <Component > annotation = MergedAnnotation .from (Component .class ,
1841
+ MergedAnnotation <Component > annotation = MergedAnnotation .of (Component .class ,
1842
1842
map );
1843
1843
// annotation.synthesize();
1844
1844
assertThatIllegalStateException ().isThrownBy (
@@ -1853,7 +1853,7 @@ public void synthesizeFromAnnotationAttributesWithoutAttributeAliases()
1853
1853
Component component = WebController .class .getAnnotation (Component .class );
1854
1854
assertThat (component ).isNotNull ();
1855
1855
Map <String , Object > attributes = MergedAnnotation .from (component ).asMap ();
1856
- Component synthesized = MergedAnnotation .from (Component .class ,
1856
+ Component synthesized = MergedAnnotation .of (Component .class ,
1857
1857
attributes ).synthesize ();
1858
1858
assertThat (synthesized ).isInstanceOf (SynthesizedAnnotation .class );
1859
1859
assertThat (synthesized ).isEqualTo (component );
0 commit comments