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 9712184925ce7a0367127f671be383b023819de6
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Thu May 5 14:07:07 2022 -0400

    Fix broken tests.
---
 .../commons/compress/archivers/cpio/CpioUtilTest.java      | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git 
a/src/test/java/org/apache/commons/compress/archivers/cpio/CpioUtilTest.java 
b/src/test/java/org/apache/commons/compress/archivers/cpio/CpioUtilTest.java
index f453c00f..1147f22c 100644
--- a/src/test/java/org/apache/commons/compress/archivers/cpio/CpioUtilTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/cpio/CpioUtilTest.java
@@ -22,6 +22,7 @@ import org.junit.jupiter.api.Test;
 
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThrows;
 
 public class CpioUtilTest {
 
@@ -56,26 +57,19 @@ public class CpioUtilTest {
 
     @Test
     public void 
testLong2byteArrayWithZeroThrowsUnsupportedOperationException() {
-
-        CpioUtil.long2byteArray(0L, 0, false);
-
+        assertThrows(UnsupportedOperationException.class, () -> 
CpioUtil.long2byteArray(0L, 0, false));
     }
 
 
     @Test
     public void 
testLong2byteArrayWithPositiveThrowsUnsupportedOperationException() {
-
-        CpioUtil.long2byteArray(0L, 1021, false);
-
+        assertThrows(UnsupportedOperationException.class, () -> 
CpioUtil.long2byteArray(0L, 1021, false));
     }
 
 
     @Test
     public void testByteArray2longThrowsUnsupportedOperationException() {
-
-        final byte[] byteArray = new byte[1];
-
-        CpioUtil.byteArray2long(byteArray, true);
+        assertThrows(UnsupportedOperationException.class, () -> 
CpioUtil.byteArray2long(new byte[1], true));
 
     }
 

Reply via email to