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
commit 231cce300a75a46b7c142ec1d1446d16a80adf86 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Wed May 21 19:11:11 2025 -0400 Add org.apache.commons.compress.archivers.zip.ZipArchiveOutputStreamTest.testOptionDefaults() --- .../archivers/zip/ZipArchiveOutputStreamTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStreamTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStreamTest.java index d6b9be21f..e6e75a3c7 100644 --- a/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStreamTest.java +++ b/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStreamTest.java @@ -26,6 +26,8 @@ import java.io.IOException; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; +import java.util.zip.Deflater; +import java.util.zip.ZipEntry; import org.apache.commons.compress.AbstractTempDirTest; import org.junit.jupiter.api.Test; @@ -45,6 +47,20 @@ public void testFileBasics() throws IOException { assertTrue(ref.isClosed()); } + @Test + public void testOptionDefaults() throws IOException { + final ZipArchiveOutputStream ref; + try (ZipArchiveOutputStream outputStream = new ZipArchiveOutputStream(createTempFile())) { + ref = outputStream; + assertTrue(outputStream.isSeekable()); + outputStream.setComment(""); + outputStream.setLevel(Deflater.DEFAULT_COMPRESSION); + outputStream.setMethod(ZipEntry.DEFLATED); + outputStream.setFallbackToUTF8(false); + } + assertTrue(ref.isClosed()); + } + @Test public void testOutputStreamBasics() throws IOException { try (ZipArchiveOutputStream outputStream = new ZipArchiveOutputStream(new ByteArrayOutputStream())) {