You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm seeing an issue with Mockito.verifyNoMoreInteractions when used with MockitoSession.
In the example below, all tests should fail as we have an interaction with supplier1 that is not taken into account (verify(supplier1).getAsInt() is commented).
However testWithMockitoSession passes. It only exhibit this behaviour when a method on the mocked object is stubbed (when(supplier1.getAsInt()).thenReturn(100)).
which passes but I expect it to fail if I remove the first verify line and it does not. A similar test without when(...) fails on the last line if the method call is not verified.
I'm seeing an issue with
Mockito.verifyNoMoreInteractions
when used withMockitoSession
.In the example below, all tests should fail as we have an interaction with
supplier1
that is not taken into account (verify(supplier1).getAsInt()
is commented).However
testWithMockitoSession
passes. It only exhibit this behaviour when a method on the mocked object is stubbed (when(supplier1.getAsInt()).thenReturn(100)
).This test was done on
openjdk version "11.0.9.1" 2020-11-04
with Mockito 3.7.7.The text was updated successfully, but these errors were encountered: