Skip to content

Commit 114d455

Browse files
committed
Improved assertions
1 parent 3481170 commit 114d455

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

services-gateway/src/test/java/io/scalecube/services/gateway/files/FileDownloadTest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,9 @@ void testDownloadSuccessfully(long fileSize) throws Exception {
138138
final var file =
139139
downloadFile(
140140
"http://localhost:" + httpAddress.port() + "/" + reportResponse.reportPath());
141-
final var list = Files.readAllLines(file);
142-
141+
assertTrue(Files.exists(file), "File does not exist");
143142
assertTrue(file.toFile().length() >= fileSize, "fileSize: " + file.toFile().length());
144-
for (String s : list) {
143+
for (String s : Files.readAllLines(file)) {
145144
assertTrue(s.startsWith("export report @"), "line: " + s);
146145
}
147146
}
@@ -312,10 +311,9 @@ void successfulDownload(long fileSize) throws Exception {
312311
final var file =
313312
downloadFile(
314313
"http://localhost:" + httpAddress.port() + "/v1/api/successfulDownload/" + fileSize);
315-
final var list = Files.readAllLines(file);
316-
314+
assertTrue(Files.exists(file), "File does not exist");
317315
assertTrue(file.toFile().length() >= fileSize, "fileSize: " + file.toFile().length());
318-
for (String s : list) {
316+
for (String s : Files.readAllLines(file)) {
319317
assertTrue(s.startsWith("export report @"), "line: " + s);
320318
}
321319
}

0 commit comments

Comments
 (0)