Skip to content

Commit 00e8f11

Browse files
author
Gary Gregory
committed
Reuse TestConstants in test
1 parent 17b7581 commit 00e8f11

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/test/java/org/apache/commons/io/function/IOPredicateTest.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,7 @@ public boolean equals(final Object obj) {
5050
}
5151
};
5252

53-
private static IOPredicate<Object> THROWING_IOPREDICATE = e -> {
54-
throw new IOException("Failure");
55-
};
56-
57-
private static final Predicate<Object> THROWING_UNCHECKED_PREDICATE = THROWING_IOPREDICATE.asPredicate();
53+
private static final Predicate<Object> THROWING_UNCHECKED_PREDICATE = TestConstants.THROWING_IO_PREDICATE.asPredicate();
5854

5955
private void assertThrowsChecked(final Executable executable) {
6056
assertThrows(IOException.class, executable);
@@ -145,7 +141,7 @@ public void testOrUnchecked() {
145141

146142
@Test
147143
public void testTestChecked() throws IOException {
148-
assertThrowsChecked(() -> THROWING_IOPREDICATE.test(null));
144+
assertThrowsChecked(() -> TestConstants.THROWING_IO_PREDICATE.test(null));
149145
assertTrue(Constants.IO_PREDICATE_TRUE.test("A"));
150146
}
151147

0 commit comments

Comments
 (0)