What are exceptions in JUnit?

What are exceptions in JUnit?

assertThrows method in JUnit is for handling expected exception on that particular Method . Here is the Syntax Exception exception = assertThrows(NumberFormatException.class, () → { Integer.parseInt(“1a”); });

https://www.baeldung.com/junit-assert-exception