You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/08/13 19:11:28 UTC

(commons-compress) branch master updated: Make test less verbose test

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git


The following commit(s) were added to refs/heads/master by this push:
     new e920d2dd5 Make test less verbose test
e920d2dd5 is described below

commit e920d2dd5b0bcdfc6d271183f145cb76f346be60
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Wed Aug 13 15:11:23 2025 -0400

    Make test less verbose test
---
 .../commons/compress/archivers/zip/ZipArchiveInputStreamTest.java  | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java
index 03508eaaf..42e3a8f2e 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java
@@ -245,12 +245,7 @@ void testGetUncompressedCountEmptyZip() throws IOException {
     @Test
     void testMessageWithCorruptFileName() throws Exception {
         try (ZipArchiveInputStream in = new ZipArchiveInputStream(newInputStream("COMPRESS-351.zip"))) {
-            final EOFException ex = assertThrows(EOFException.class, () -> {
-                ZipArchiveEntry ze = in.getNextZipEntry();
-                while (ze != null) {
-                    ze = in.getNextZipEntry();
-                }
-            }, "expected EOFException");
+            final EOFException ex = assertThrows(EOFException.class, () -> in.forEach(IOConsumer.noop()));
             final String m = ex.getMessage();
             assertTrue(m.startsWith("Truncated ZIP entry: ?2016")); // the first character is not printable
         }