Skip to content

Commit 549e884

Browse files
committed
Use Assertions.assertInstanceOf()
1 parent 3f8d21f commit 549e884

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import static org.hamcrest.Matchers.lessThanOrEqualTo;
2222
import static org.junit.jupiter.api.Assertions.assertEquals;
2323
import static org.junit.jupiter.api.Assertions.assertFalse;
24+
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
2425
import static org.junit.jupiter.api.Assertions.assertNotEquals;
2526
import static org.junit.jupiter.api.Assertions.assertNotNull;
2627
import static org.junit.jupiter.api.Assertions.assertNull;
@@ -1160,7 +1161,7 @@ public void testBrokenFactoryShouldNotBlockPool() throws Exception {
11601161
}
11611162
// Failure expected
11621163
assertNotNull(ex);
1163-
assertTrue(ex instanceof NoSuchElementException);
1164+
assertInstanceOf(NoSuchElementException.class, ex);
11641165
assertNull(obj);
11651166

11661167
// Configure factory to create valid objects so subsequent borrows work

0 commit comments

Comments
 (0)