From 549e884bef9131af170e9963dae5df77ce2392a9 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sun, 1 Sep 2024 19:03:33 -0400 Subject: [PATCH] Use Assertions.assertInstanceOf() --- .../org/apache/commons/pool2/impl/TestGenericObjectPool.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java index 3df97039ae..ef80c115dc 100644 --- a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java +++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java @@ -21,6 +21,7 @@ import static org.hamcrest.Matchers.lessThanOrEqualTo; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; @@ -1160,7 +1161,7 @@ public void testBrokenFactoryShouldNotBlockPool() throws Exception { } // Failure expected assertNotNull(ex); - assertTrue(ex instanceof NoSuchElementException); + assertInstanceOf(NoSuchElementException.class, ex); assertNull(obj); // Configure factory to create valid objects so subsequent borrows work