Skip to content

Commit 6f5d868

Browse files
committed
Migrated members to constants
1 parent cb738cc commit 6f5d868

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

sbm-support-rewrite/src/test/java/org/springframework/sbm/parsers/BuildFileParserTest.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class BuildFileParserTest {
4242
public class GivenSimpleMavenMultiModuleProject {
4343

4444
@Language("xml")
45-
private String pom1 =
45+
private static final String POM_1 =
4646
"""
4747
<?xml version="1.0" encoding="UTF-8"?>
4848
<project xmlns="http://maven.apache.org/POM/4.0.0"
@@ -60,7 +60,7 @@ public class GivenSimpleMavenMultiModuleProject {
6060
""";
6161

6262
@Language("xml")
63-
private String pom2 =
63+
private static final String POM_2 =
6464
"""
6565
<?xml version="1.0" encoding="UTF-8"?>
6666
<project xmlns="http://maven.apache.org/POM/4.0.0"
@@ -80,7 +80,7 @@ public class GivenSimpleMavenMultiModuleProject {
8080
""";
8181

8282
@Language("xml")
83-
private String pom3 =
83+
private static final String POM_3 =
8484
"""
8585
<project xmlns="http://maven.apache.org/POM/4.0.0"
8686
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -102,11 +102,11 @@ void filterAndSortBuildFiles_shouldReturnSortedListOfFilteredBuildFiles() {
102102

103103
// the poms have no order
104104
List<Resource> resources = List.of(
105-
new DummyResource("src/test/resources/dummy/pom.xml", ""),
106-
new DummyResource("module1/submodule/pom.xml", pom3),
107-
new DummyResource("pom.xml", pom1),
108-
new DummyResource("module1/pom.xml", pom2),
109-
new DummyResource("src/main/java/SomeJavaClass.java", "")
105+
new DummyResource("src/test/resources/dummy/pom.xml", ""), // filtered
106+
new DummyResource("module1/submodule/pom.xml", POM_3), // pos. 3
107+
new DummyResource("pom.xml", POM_1), // pos. 1
108+
new DummyResource("module1/pom.xml", POM_2), // pos. 2
109+
new DummyResource("src/main/java/SomeJavaClass.java", "") // filtered
110110
);
111111

112112
// filter and sort build files
@@ -129,9 +129,9 @@ void filterAndSortBuildFiles_shouldReturnSortedListOfFilteredBuildFiles() {
129129
void parseBuildFiles_shouldReturnSortedListOfParsedBuildFiles() {
130130
Path baseDir = Path.of(".").toAbsolutePath().normalize();
131131
List<Resource> filteredAndSortedBuildFiles = List.of(
132-
new DummyResource(baseDir, "module1/submodule/pom.xml", pom3),
133-
new DummyResource(baseDir, "pom.xml", pom1),
134-
new DummyResource(baseDir, "module1/pom.xml", pom2)
132+
new DummyResource(baseDir, "module1/submodule/pom.xml", POM_3),
133+
new DummyResource(baseDir, "pom.xml", POM_1),
134+
new DummyResource(baseDir, "module1/pom.xml", POM_2)
135135
);
136136
Map<Path, List<Marker>> provenanceMarkers = new HashMap<>();
137137
ExecutionContext executionContext = new InMemoryExecutionContext(t -> t.printStackTrace());

0 commit comments

Comments
 (0)