You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/05/10 19:44:54 UTC
[commons-io] branch master updated: No need for a block.
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-io.git
The following commit(s) were added to refs/heads/master by this push:
new e8905998 No need for a block.
e8905998 is described below
commit e890599830c483d960d742dddd00938efec04012
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue May 10 15:44:48 2022 -0400
No need for a block.
---
src/test/java/org/apache/commons/io/function/IOFunctionTest.java | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/test/java/org/apache/commons/io/function/IOFunctionTest.java b/src/test/java/org/apache/commons/io/function/IOFunctionTest.java
index f192c336..e59684fa 100644
--- a/src/test/java/org/apache/commons/io/function/IOFunctionTest.java
+++ b/src/test/java/org/apache/commons/io/function/IOFunctionTest.java
@@ -27,6 +27,7 @@ import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
+import org.apache.commons.lang3.ArrayUtils;
import org.junit.jupiter.api.Test;
/**
@@ -104,13 +105,10 @@ public class IOFunctionTest {
@Test
public void testApplyThrowsException() {
- final IOFunction<InputStream, Integer> throwException = is -> {
+ final IOFunction<InputStream, Integer> throwException = function -> {
throw new IOException("Boom!");
};
- final InputStream is = new ByteArrayInputStream(new byte[] {(byte) 0xa, (byte) 0xb, (byte) 0xc});
- assertThrows(IOException.class, () -> {
- throwException.apply(is);
- });
+ assertThrows(IOException.class, () -> throwException.apply(new ByteArrayInputStream(ArrayUtils.EMPTY_BYTE_ARRAY)));
}
@Test