This test should have an expectation of throwing the exception. This can be done with something like: @Test(expected = ArithmeticException.class)