is it an error or failure in test if exception is thrown when you are getting the document here? If it's an error then there is no need to catch it and fail the test. JUnit test will catch this exception and show an error (not a failure).