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
By default Mockito 5.x use a new MockMaker that is not compatible with any WO subclasses. It is still possible to create mock and spy by specifying the old MockMaker like this:
Replacing @mock with @mock(mockMaker = MockMakers.SUBCLASS) in field declaration;
Replacing mock(...) with mock(..., withSettings().mockMaker(MockMakers.SUBCLASS));
Replacing spy(instance) with instance = mock(InstanceClass.class, withSettings()
.mockMaker(MockMakers.SUBCLASS)
.spiedInstance(instance).defaultAnswer(CALLS_REAL_METHODS));
I suggest to adjust the wounits behaviour when detecting @SPY annotation to specify the old MockMaker and creating a new @EOMock (or WOMock) annotation to help creating compatible mock with the old MockMaker.
The text was updated successfully, but these errors were encountered:
By default Mockito 5.x use a new MockMaker that is not compatible with any WO subclasses. It is still possible to create mock and spy by specifying the old MockMaker like this:
.mockMaker(MockMakers.SUBCLASS)
.spiedInstance(instance).defaultAnswer(CALLS_REAL_METHODS));
I suggest to adjust the wounits behaviour when detecting @SPY annotation to specify the old MockMaker and creating a new @EOMock (or WOMock) annotation to help creating compatible mock with the old MockMaker.
The text was updated successfully, but these errors were encountered: