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 5e4e6fbb Fix some tests. 5e4e6fbb is described below commit 5e4e6fbbd0a4b7872aedbc47fd04d00342677b6b Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Thu May 5 14:37:14 2022 -0400 Fix some tests. --- .../commons/compress/archivers/examples/SevenZArchiverTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/apache/commons/compress/archivers/examples/SevenZArchiverTest.java b/src/test/java/org/apache/commons/compress/archivers/examples/SevenZArchiverTest.java index 66551593..a66f6f3c 100644 --- a/src/test/java/org/apache/commons/compress/archivers/examples/SevenZArchiverTest.java +++ b/src/test/java/org/apache/commons/compress/archivers/examples/SevenZArchiverTest.java @@ -19,6 +19,7 @@ package org.apache.commons.compress.archivers.examples; import static java.nio.charset.StandardCharsets.UTF_8; +import static org.junit.Assert.assertThrows; import static org.junit.jupiter.api.Assertions.assertNotNull; import java.io.File; @@ -80,9 +81,9 @@ public class SevenZArchiverTest extends AbstractTestCase { // not really a 7z test but I didn't feel like adding a new test just for this @Test public void unknownFormat() throws IOException, ArchiveException { - try (SeekableByteChannel c = FileChannel.open(target.toPath(), StandardOpenOption.WRITE, - StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)) { - new Archiver().create("unknown format", c, dir); + try (SeekableByteChannel c = FileChannel.open(target.toPath(), StandardOpenOption.WRITE, StandardOpenOption.CREATE, + StandardOpenOption.TRUNCATE_EXISTING)) { + assertThrows(ArchiveException.class, () -> new Archiver().create("unknown format", c, dir)); } }