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 ;
27+ import org .junit .jupiter .api .function .Executable ;
2628
2729public class ObjectProviderInterceptorTest extends AbstractTestCase
2830{
@@ -37,9 +39,16 @@ 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+ // FIXME Simplification once upgraded to Java 1.8
46+ final Executable testMethod = new Executable () {
47+ @ Override
48+ public void execute () throws Throwable {
49+ new ObjectProviderInterceptor (null );
50+ }
51+ };
52+ assertThrows (NullPointerException .class , testMethod );
4453 }
4554}
You can’t perform that action at this time.
0 commit comments