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 67b4299a Fix broken tests.
67b4299a is described below
commit 67b4299acb16e2ae3537fce74787b3f2f3bf9e32
Author: Gary Gregory <[email protected]>
AuthorDate: Thu May 5 14:30:46 2022 -0400
Fix broken tests.
---
.../commons/compress/archivers/ar/ArArchiveInputStreamTest.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git
a/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java
b/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java
index 4fc13848..7c6568b9 100644
---
a/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java
+++
b/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java
@@ -21,9 +21,10 @@ package org.apache.commons.compress.archivers.ar;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.nullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertThrows;
import java.io.BufferedInputStream;
import java.io.IOException;
@@ -123,7 +124,7 @@ public class ArArchiveInputStreamTest extends
AbstractTestCase {
public void cantReadWithoutOpeningAnEntry() throws Exception {
try (InputStream in = Files.newInputStream(getFile("bla.ar").toPath());
ArArchiveInputStream archive = new ArArchiveInputStream(in)) {
- archive.read();
+ assertThrows(IllegalStateException.class, () -> archive.read());
}
}
@@ -132,7 +133,7 @@ public class ArArchiveInputStreamTest extends
AbstractTestCase {
try (InputStream in = Files.newInputStream(getFile("bla.ar").toPath());
ArArchiveInputStream archive = new ArArchiveInputStream(in)) {
archive.close();
- archive.read();
+ assertThrows(IllegalStateException.class, () -> archive.read());
}
}
}