how to test a void method using mockito code example Example: java doreturn void doNothing().when(yourMock).yourMockedMethod();