When you provide the expected exception for the Test annotation, the test will only succeed if the expected exception is selected from the test method. However, you encounter an exception before it propagates outside the method.
It looks like you want to test the exception message too, so throw exception e again to run the test. Depending on whether it is tested, you may need a throws in a method.
source share