kotlin junit when then on void method code example Example: java doreturn void doNothing().when(yourMock).yourMockedMethod();