Skip to content

Commit c4a9f8d

Browse files
committed
JUnit5 assertThrows ObjectProviderInterceptorTest
1 parent 20212a8 commit c4a9f8d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

core/src/test/java/org/apache/commons/proxy2/interceptor/ObjectProviderInterceptorTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@
1919

2020
import static org.junit.Assert.assertEquals;
2121
import static org.junit.Assert.assertNotNull;
22+
import static org.junit.jupiter.api.Assertions.assertThrows;
2223

2324
import org.apache.commons.proxy2.provider.ObjectProviderUtils;
2425
import org.apache.commons.proxy2.util.AbstractTestCase;
2526
import org.junit.Test;
2627

2728
public class ObjectProviderInterceptorTest extends AbstractTestCase
2829
{
30+
2931
//----------------------------------------------------------------------------------------------------------------------
3032
// Other Methods
3133
//----------------------------------------------------------------------------------------------------------------------
@@ -37,9 +39,10 @@ public void testIntercept() throws Throwable
3739
assertEquals("Hello!", interceptor.intercept(null));
3840
}
3941

40-
@Test(expected = NullPointerException.class)
42+
@Test
4143
public void testWithNullProvider()
4244
{
43-
assertNotNull(new ObjectProviderInterceptor(null)); // assert is used to avoid not used warning
45+
assertThrows(NullPointerException.class, () -> new ObjectProviderInterceptor(null));
4446
}
47+
4548
}

0 commit comments

Comments
 (0)