mockito dothrow void code example
Example 1: mockito throw exception void method
doThrow(new Exception()).when(mockedObject).methodReturningVoid(...);
Example 2: java doreturn void
doNothing().when(yourMock).yourMockedMethod();
doThrow(new Exception()).when(mockedObject).methodReturningVoid(...);
doNothing().when(yourMock).yourMockedMethod();