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 ac7b6221 Fix broken tests.
ac7b6221 is described below
commit ac7b6221c6c7608e4a098e3809e7b205f219c5fb
Author: Gary Gregory <[email protected]>
AuthorDate: Thu May 5 15:05:46 2022 -0400
Fix broken tests.
---
.../commons/compress/changes/ChangeTest.java | 25 ++++++----------------
1 file changed, 7 insertions(+), 18 deletions(-)
diff --git a/src/test/java/org/apache/commons/compress/changes/ChangeTest.java
b/src/test/java/org/apache/commons/compress/changes/ChangeTest.java
index a6a02c89..12636d0e 100644
--- a/src/test/java/org/apache/commons/compress/changes/ChangeTest.java
+++ b/src/test/java/org/apache/commons/compress/changes/ChangeTest.java
@@ -18,11 +18,12 @@
*/
package org.apache.commons.compress.changes;
-import org.apache.commons.compress.archivers.memory.MemoryArchiveEntry;
-import org.junit.jupiter.api.Test;
+import static org.junit.Assert.assertThrows;
import java.io.PipedInputStream;
+import org.apache.commons.compress.archivers.memory.MemoryArchiveEntry;
+import org.junit.jupiter.api.Test;
/**
* Unit tests for class {@link Change}.
@@ -32,33 +33,21 @@ import java.io.PipedInputStream;
**/
public class ChangeTest {
-
@Test
public void
testFailsToCreateChangeTakingFourArgumentsThrowsNullPointerExceptionOne() {
-
final MemoryArchiveEntry memoryArchiveEntry = new
MemoryArchiveEntry("x");
-
- final Change change = new Change(memoryArchiveEntry, null, false);
-
+ assertThrows(NullPointerException.class, () -> new
Change(memoryArchiveEntry, null, false));
}
-
@Test
public void
testFailsToCreateChangeTakingFourArgumentsThrowsNullPointerExceptionTwo() {
-
final PipedInputStream pipedInputStream = new PipedInputStream(1);
-
- final Change change = new Change(null, pipedInputStream, false);
-
+ assertThrows(NullPointerException.class, () -> new Change(null,
pipedInputStream, false));
}
-
@Test
public void
testFailsToCreateChangeTakingThreeArgumentsThrowsNullPointerException() {
-
- final Change change = new Change(null, (-407));
-
+ assertThrows(NullPointerException.class, () -> new Change(null,
(-407)));
}
-
-}
\ No newline at end of file
+}