Skip to content
Permalink
Browse files
Update BeanSettingTest.java
update exception assertion
icklesteve committed Sep 10, 2022
1 parent ffc2aac commit aabada3dff14f1933c9449801daec49628e9abb7
Showing 1 changed file with 4 additions and 8 deletions.
public class BeanSettingTest {

@Test
public void testCtorNullBean() {
// JUnit 5 assertThrows would be good here
boolean thrown = false;
try {
new BeanSetting(null, 0);
} catch (NullPointerException ex) {
thrown = true;
}
Assert.assertTrue("Expected exception thrown", thrown);
Exception ex = Assertions.assertThrows(NullPointerException.class, () -> {
Assertions.assertNotNull(new BeanSetting(null, 0));
});
Assertions.assertNotNull(ex, "Expected exception thrown");
}

@Test

0 comments on commit aabada3

Please sign in to comment.