The JUnit method to do this is Assertions.assertThrows . So to test a NullPointerException is thrown we would use this: Assertions.
確定! 回上一頁