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 00e8f111 Reuse TestConstants in test
00e8f111 is described below

commit 00e8f11182be0253ceed7e51fecd8d8a72ed67b9
Author: Gary Gregory <[email protected]>
AuthorDate: Wed Jul 27 14:55:53 2022 -0400

    Reuse TestConstants in test
---
 src/test/java/org/apache/commons/io/function/IOPredicateTest.java | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/test/java/org/apache/commons/io/function/IOPredicateTest.java 
b/src/test/java/org/apache/commons/io/function/IOPredicateTest.java
index db7d6f9e..7f2d29ba 100644
--- a/src/test/java/org/apache/commons/io/function/IOPredicateTest.java
+++ b/src/test/java/org/apache/commons/io/function/IOPredicateTest.java
@@ -50,11 +50,7 @@ public class IOPredicateTest {
         }
     };
 
-    private static IOPredicate<Object> THROWING_IOPREDICATE = e -> {
-        throw new IOException("Failure");
-    };
-
-    private static final Predicate<Object> THROWING_UNCHECKED_PREDICATE = 
THROWING_IOPREDICATE.asPredicate();
+    private static final Predicate<Object> THROWING_UNCHECKED_PREDICATE = 
TestConstants.THROWING_IO_PREDICATE.asPredicate();
 
     private void assertThrowsChecked(final Executable executable) {
         assertThrows(IOException.class, executable);
@@ -145,7 +141,7 @@ public class IOPredicateTest {
 
     @Test
     public void testTestChecked() throws IOException {
-        assertThrowsChecked(() -> THROWING_IOPREDICATE.test(null));
+        assertThrowsChecked(() -> 
TestConstants.THROWING_IO_PREDICATE.test(null));
         assertTrue(Constants.IO_PREDICATE_TRUE.test("A"));
     }
 

Reply via email to