Skip to content

Commit 4997bc6

Browse files
Fix windows tests
1 parent 1fa3c85 commit 4997bc6

File tree

1 file changed

+9
-7
lines changed
  • maven-plugins/stager-maven-plugin/src/test/java/io/helidon/build/maven/stager

1 file changed

+9
-7
lines changed

maven-plugins/stager-maven-plugin/src/test/java/io/helidon/build/maven/stager/ProjectsTestIT.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626
import org.junit.jupiter.params.ParameterizedTest;
2727

2828
import static io.helidon.build.common.FileUtils.newZipFileSystem;
29+
import static io.helidon.build.common.Strings.normalizeNewLines;
2930
import static io.helidon.build.common.test.utils.FileMatchers.fileExists;
31+
import static java.nio.file.Files.readString;
3032
import static org.hamcrest.MatcherAssert.assertThat;
31-
import static org.hamcrest.Matchers.contains;
33+
import static org.hamcrest.Matchers.containsInAnyOrder;
3234
import static org.hamcrest.Matchers.is;
3335

3436
public class ProjectsTestIT {
@@ -45,7 +47,7 @@ void testArchive(String basedir) throws IOException {
4547
try (FileSystem fs = newZipFileSystem(archive)) {
4648
Path file = fs.getPath("/").resolve("versions.json");
4749
assertThat(file, fileExists());
48-
assertThat(Files.readString(file),
50+
assertThat(normalizeNewLines(readString(file)),
4951
is("""
5052
{
5153
"versions": [
@@ -70,7 +72,7 @@ void testTemplate(String basedir) throws IOException {
7072

7173
Path file1 = stageDir.resolve("versions1.json");
7274
assertThat(file1, fileExists());
73-
assertThat(Files.readString(file1),
75+
assertThat(normalizeNewLines(readString(file1)),
7476
is("""
7577
{
7678
"versions": [
@@ -97,7 +99,7 @@ void testTemplate(String basedir) throws IOException {
9799

98100
Path file2 = stageDir.resolve("versions2.json");
99101
assertThat(file2, fileExists());
100-
assertThat(Files.readString(file2),
102+
assertThat(normalizeNewLines(readString(file2)),
101103
is("""
102104
{
103105
"versions": [
@@ -140,19 +142,19 @@ void testFile(String basedir) throws IOException {
140142

141143
Path file1 = stageDir.resolve("cli-data/latest");
142144
assertThat(file1, fileExists());
143-
assertThat(Files.readString(file1), is("2.0.0-RC1"));
145+
assertThat(readString(file1), is("2.0.0-RC1"));
144146

145147
Path file2 = stageDir.resolve("CNAME");
146148
assertThat(file2, fileExists());
147-
assertThat(Files.readString(file2), is("helidon.io"));
149+
assertThat(readString(file2), is("helidon.io"));
148150

149151
assertThat(stageDir.resolve("docs/v4/index.html"), fileExists());
150152
assertThat(stageDir.resolve("docs/v4/apidocs/index.html"), fileExists());
151153
assertThat(stageDir.resolve("docs/v4/images/foo.svg"), fileExists());
152154

153155
Path file3 = stageDir.resolve("sitemap.txt");
154156
assertThat(file3, fileExists());
155-
assertThat(Files.readAllLines(file3), contains(
157+
assertThat(Files.readAllLines(file3), containsInAnyOrder(
156158
"docs/v4/",
157159
"docs/v4/apidocs/"
158160
));

0 commit comments

Comments
 (0)