diff --git a/core/pom.xml b/core/pom.xml
index 9ab9db15..5f7196f4 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -40,6 +40,11 @@
junit
test
+
+ org.junit.jupiter
+ junit-jupiter-api
+ test
+
diff --git a/core/src/test/java/org/apache/commons/proxy2/interceptor/ObjectProviderInterceptorTest.java b/core/src/test/java/org/apache/commons/proxy2/interceptor/ObjectProviderInterceptorTest.java
index c4ef0646..52f67729 100644
--- a/core/src/test/java/org/apache/commons/proxy2/interceptor/ObjectProviderInterceptorTest.java
+++ b/core/src/test/java/org/apache/commons/proxy2/interceptor/ObjectProviderInterceptorTest.java
@@ -19,6 +19,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
import org.apache.commons.proxy2.provider.ObjectProviderUtils;
import org.apache.commons.proxy2.util.AbstractTestCase;
@@ -26,6 +27,7 @@
public class ObjectProviderInterceptorTest extends AbstractTestCase
{
+
//----------------------------------------------------------------------------------------------------------------------
// Other Methods
//----------------------------------------------------------------------------------------------------------------------
@@ -37,9 +39,10 @@ public void testIntercept() throws Throwable
assertEquals("Hello!", interceptor.intercept(null));
}
- @Test(expected = NullPointerException.class)
+ @Test
public void testWithNullProvider()
{
- assertNotNull(new ObjectProviderInterceptor(null)); // assert is used to avoid not used warning
+ assertThrows(NullPointerException.class, () -> new ObjectProviderInterceptor(null));
}
+
}