I have a method with a void return type. It can also throw a number of exceptions so I\'d like to test those exceptions being thrown. All attempts have failed w
void
The parentheses are poorly placed.
You need to use:
doThrow(new Exception()).when(mockedObject).methodReturningVoid(...); ^
and NOT use:
doThrow(new Exception()).when(mockedObject.methodReturningVoid(...)); ^
This is explained in the documentation