JUnit Exception Test
JUnit Exception Test In this tutorial, you will learn about JUnit Exception test. In JUnit we use “expected” with @Test annotation and specify the type of exceptions that are expected to be thrown when executing the test methods. Example @Test(expected=ArithmeticException.class) public void dividedByZeroExample(){ int result = 1/0; } A sample example which throws […]