File tree Expand file tree Collapse file tree
core/src/test/java/org/apache/commons/proxy2/interceptor Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919
2020import static org .junit .Assert .assertEquals ;
2121import static org .junit .Assert .assertNotNull ;
22+ import static org .junit .jupiter .api .Assertions .assertThrows ;
2223
2324import org .apache .commons .proxy2 .provider .ObjectProviderUtils ;
2425import org .apache .commons .proxy2 .util .AbstractTestCase ;
2526import org .junit .Test ;
2627
2728public 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}
You can’t perform that action at this time.
0 commit comments