26
26
import org .junit .jupiter .params .ParameterizedTest ;
27
27
28
28
import static io .helidon .build .common .FileUtils .newZipFileSystem ;
29
+ import static io .helidon .build .common .Strings .normalizeNewLines ;
29
30
import static io .helidon .build .common .test .utils .FileMatchers .fileExists ;
31
+ import static java .nio .file .Files .readString ;
30
32
import static org .hamcrest .MatcherAssert .assertThat ;
31
- import static org .hamcrest .Matchers .contains ;
33
+ import static org .hamcrest .Matchers .containsInAnyOrder ;
32
34
import static org .hamcrest .Matchers .is ;
33
35
34
36
public class ProjectsTestIT {
@@ -45,7 +47,7 @@ void testArchive(String basedir) throws IOException {
45
47
try (FileSystem fs = newZipFileSystem (archive )) {
46
48
Path file = fs .getPath ("/" ).resolve ("versions.json" );
47
49
assertThat (file , fileExists ());
48
- assertThat (Files . readString (file ),
50
+ assertThat (normalizeNewLines ( readString (file ) ),
49
51
is ("""
50
52
{
51
53
"versions": [
@@ -70,7 +72,7 @@ void testTemplate(String basedir) throws IOException {
70
72
71
73
Path file1 = stageDir .resolve ("versions1.json" );
72
74
assertThat (file1 , fileExists ());
73
- assertThat (Files . readString (file1 ),
75
+ assertThat (normalizeNewLines ( readString (file1 ) ),
74
76
is ("""
75
77
{
76
78
"versions": [
@@ -97,7 +99,7 @@ void testTemplate(String basedir) throws IOException {
97
99
98
100
Path file2 = stageDir .resolve ("versions2.json" );
99
101
assertThat (file2 , fileExists ());
100
- assertThat (Files . readString (file2 ),
102
+ assertThat (normalizeNewLines ( readString (file2 ) ),
101
103
is ("""
102
104
{
103
105
"versions": [
@@ -140,19 +142,19 @@ void testFile(String basedir) throws IOException {
140
142
141
143
Path file1 = stageDir .resolve ("cli-data/latest" );
142
144
assertThat (file1 , fileExists ());
143
- assertThat (Files . readString (file1 ), is ("2.0.0-RC1" ));
145
+ assertThat (readString (file1 ), is ("2.0.0-RC1" ));
144
146
145
147
Path file2 = stageDir .resolve ("CNAME" );
146
148
assertThat (file2 , fileExists ());
147
- assertThat (Files . readString (file2 ), is ("helidon.io" ));
149
+ assertThat (readString (file2 ), is ("helidon.io" ));
148
150
149
151
assertThat (stageDir .resolve ("docs/v4/index.html" ), fileExists ());
150
152
assertThat (stageDir .resolve ("docs/v4/apidocs/index.html" ), fileExists ());
151
153
assertThat (stageDir .resolve ("docs/v4/images/foo.svg" ), fileExists ());
152
154
153
155
Path file3 = stageDir .resolve ("sitemap.txt" );
154
156
assertThat (file3 , fileExists ());
155
- assertThat (Files .readAllLines (file3 ), contains (
157
+ assertThat (Files .readAllLines (file3 ), containsInAnyOrder (
156
158
"docs/v4/" ,
157
159
"docs/v4/apidocs/"
158
160
));
0 commit comments