Using mockito to test methods which throw uncaught custom exceptions July 25, 2023 by Tarik Declare the exception in the test method. public void testAddUser() throws ServiceException { ... }