What do you want to save?
Add Code snippet
New code examples
-
Java 2021-11-07 21:21:20
how to assert that an exception is thrown java
@Test public void whenExceptionThrown_thenAssertionSucceeds() { Exception exception = assertThrows(NumberFormatException.class, () -> { Integer.parseInt("1a"); }); String expectedMessage = "For input string"; ... Add solution