File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
codegen/src/test/java/software/amazon/awssdk/codegen/poet/client Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change 2
2
"type" : " feature" ,
3
3
"category" : " AWS SDK for Java v2" ,
4
4
"contributor" : " " ,
5
- "description" : " Adding compatibility tests between sdk-core and service packages "
5
+ "description" : " Adding constant to each SDK module to represent its version "
6
6
}
Original file line number Diff line number Diff line change 16
16
package software .amazon .awssdk .codegen .poet .client ;
17
17
18
18
import static org .assertj .core .api .AssertionsForClassTypes .assertThat ;
19
+ import static org .hamcrest .Matchers .equalToIgnoringWhiteSpace ;
19
20
20
21
import com .squareup .javapoet .JavaFile ;
21
22
import com .squareup .javapoet .TypeSpec ;
@@ -38,16 +39,11 @@ void testServiceVersionInfoClass() {
38
39
ClassSpec serviceVersionInfoSpec = new ServiceVersionInfoSpec (ClientTestModels .restJsonServiceModels ());
39
40
40
41
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 );
47
43
48
44
String actualContent = generateContent (serviceVersionInfoSpec );
49
45
50
- assertThat (actualContent ).isEqualTo (expectedContent );
46
+ assertThat (actualContent ).isEqualToIgnoringWhitespace (expectedContent );
51
47
}
52
48
53
49
private String loadFixtureFile (String filename ) {
You can’t perform that action at this time.
0 commit comments