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 c869faa0 Fix broken tests.
c869faa0 is described below

commit c869faa0585006e9f863ffeb2a7568fb213eab24
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Thu May 5 15:50:31 2022 -0400

    Fix broken tests.
---
 src/test/java/org/apache/commons/compress/utils/IOUtilsTest.java | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/test/java/org/apache/commons/compress/utils/IOUtilsTest.java 
b/src/test/java/org/apache/commons/compress/utils/IOUtilsTest.java
index 47b121b2..49fa601b 100644
--- a/src/test/java/org/apache/commons/compress/utils/IOUtilsTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/IOUtilsTest.java
@@ -17,6 +17,8 @@
 
 package org.apache.commons.compress.utils;
 
+import static org.junit.Assert.assertThrows;
+
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.EOFException;
@@ -85,17 +87,18 @@ public class IOUtilsTest {
         for (byte i = 0; i < 20; i++) {
             source[i] = i;
         }
-        readFully(source, b);
+        assertThrows(EOFException.class, () -> readFully(source, b));
     }
 
     @Test
     public void copyThrowsOnZeroBufferSize() throws IOException {
-        IOUtils.copy(new ByteArrayInputStream(ByteUtils.EMPTY_BYTE_ARRAY), new 
ByteArrayOutputStream(), 0);
+        assertThrows(IllegalArgumentException.class, () -> IOUtils.copy(new 
ByteArrayInputStream(ByteUtils.EMPTY_BYTE_ARRAY), new ByteArrayOutputStream(), 
0));
     }
 
     @Test
     public void copyRangeThrowsOnZeroBufferSize() throws IOException {
-        IOUtils.copyRange(new 
ByteArrayInputStream(ByteUtils.EMPTY_BYTE_ARRAY), 5, new 
ByteArrayOutputStream(), 0);
+        assertThrows(IllegalArgumentException.class,
+            () -> IOUtils.copyRange(new 
ByteArrayInputStream(ByteUtils.EMPTY_BYTE_ARRAY), 5, new 
ByteArrayOutputStream(), 0));
     }
 
     @Test

Reply via email to