File tree Expand file tree Collapse file tree
core/src/test/java/org/apache/commons/proxy2/provider Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121import org .apache .commons .proxy2 .util .AbstractTestCase ;
2222import org .junit .Test ;
2323
24+ import static org .junit .jupiter .api .Assertions .assertThrows ;
25+
2426public class BeanProviderTest extends AbstractTestCase
2527{
2628 //**********************************************************************************************************************
2729 // Other Methods
2830 //**********************************************************************************************************************
2931
30- @ Test ( expected = ObjectProviderException . class )
32+ @ Test
3133 public void testAbstractBeanClass ()
3234 {
3335 final BeanProvider <Number > p = new BeanProvider <Number >(Number .class );
34- p .getObject ();
36+ assertThrows ( ObjectProviderException . class , () -> p .getObject () );
3537 }
3638
37- @ Test ( expected = ObjectProviderException . class )
39+ @ Test
3840 public void testNonAccessibleConstructor ()
3941 {
40- new BeanProvider <MyBean >(MyBean .class ).getObject ();
42+ assertThrows ( ObjectProviderException . class , () -> new BeanProvider <MyBean >(MyBean .class ).getObject () );
4143 }
4244
4345 @ Test
@@ -46,11 +48,11 @@ public void testSerialization()
4648 assertSerializable (new BeanProvider <MyBean >(MyBean .class ));
4749 }
4850
49- @ Test ( expected = NullPointerException . class )
51+ @ Test
5052 public void testWithNullBeanClass ()
5153 {
5254 final BeanProvider <Object > p = new BeanProvider <Object >(null );
53- p .getObject ();
55+ assertThrows ( NullPointerException . class , () -> p .getObject () );
5456 }
5557
5658 //**********************************************************************************************************************
You can’t perform that action at this time.
0 commit comments