Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing 1 changed file with 4 additions and 8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
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 |