File tree Expand file tree Collapse file tree
codegen/src/test/java/software/amazon/awssdk/codegen/poet/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 "type" : " feature" ,
33 "category" : " AWS SDK for Java v2" ,
44 "contributor" : " " ,
5- "description" : " Adding compatibility tests between sdk-core and service packages "
5+ "description" : " Adding constant to each SDK module to represent its version "
66}
Original file line number Diff line number Diff line change 1616package software .amazon .awssdk .codegen .poet .client ;
1717
1818import static org .assertj .core .api .AssertionsForClassTypes .assertThat ;
19+ import static org .hamcrest .Matchers .equalToIgnoringWhiteSpace ;
1920
2021import com .squareup .javapoet .JavaFile ;
2122import com .squareup .javapoet .TypeSpec ;
@@ -38,16 +39,11 @@ void testServiceVersionInfoClass() {
3839 ClassSpec serviceVersionInfoSpec = new ServiceVersionInfoSpec (ClientTestModels .restJsonServiceModels ());
3940
4041 String expectedContent = loadFixtureFile ("test-service-version-info-class.java" );
41- String [] parts = expectedContent .split ("public static final String VERSION = \" " );
42- if (parts .length == 2 ) {
43- String privateConstructor = parts [1 ].substring (parts [1 ].indexOf ("\" " ));
44- expectedContent = parts [0 ] + "public static final String VERSION = \" " + currVersion
45- + privateConstructor ;
46- }
42+ expectedContent = expectedContent .replace ("{{VERSION}}" , currVersion );
4743
4844 String actualContent = generateContent (serviceVersionInfoSpec );
4945
50- assertThat (actualContent ).isEqualTo (expectedContent );
46+ assertThat (actualContent ).isEqualToIgnoringWhitespace (expectedContent );
5147 }
5248
5349 private String loadFixtureFile (String filename ) {
You can’t perform that action at this time.
0 commit comments