How do you test exceptions in JUnit 5?
In Junit5 assertThrows method is for handling expected exception on that particular Method . Here is the Syntax Exception exception = assertThrows(NumberFormatException.class, () → { Integer.parseInt(“1a”); });
How do you test exceptions in JUnit 5?
In Junit5 assertThrows method is for handling expected exception on that particular Method . Here is the Syntax Exception exception = assertThrows(NumberFormatException.class, () → { Integer.parseInt(“1a”); });