Skip to content

Commit eaae16e

Browse files
committed
Refactor test, edit changelog
1 parent 4d7be90 commit eaae16e

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

.changes/next-release/feature-AWSSDKforJavav2-382b343.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
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
}

codegen/src/test/java/software/amazon/awssdk/codegen/poet/client/ServiceVersionInfoSpecTest.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package software.amazon.awssdk.codegen.poet.client;
1717

1818
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
19+
import static org.hamcrest.Matchers.equalToIgnoringWhiteSpace;
1920

2021
import com.squareup.javapoet.JavaFile;
2122
import 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) {

0 commit comments

Comments
 (0)