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
In Jmockit to Mockito recipe, when migrating JMockit Expectation, if times=0 then it is migrated to verify(obj, times(0)).method() but Mockito.never() is more appropriate ie verify (obj, never()).method()
For Expectations with times=1 this should be migrated to a basic Mockito when with no times information, as that is the default when statement. Instead it is migrated to verify(obj, times(1)).method(); but should be verify(obj).method();
This may be quite easy to implement.
The text was updated successfully, but these errors were encountered:
Good improvements, thanks! Could even be separate recipes that are run after a migration, as they are just better patterns to use with Mockito, if we can make that work despite Mockito's troublesome type attribution at times. Could fold those into a Mockito best practices recipe to then improve the quality of Mockito usage independent of a migration, and is hopefully easier to manage going forward.
What problem are you trying to solve?
In Jmockit to Mockito recipe, when migrating JMockit Expectation, if times=0 then it is migrated to verify(obj, times(0)).method() but Mockito.never() is more appropriate ie verify (obj, never()).method()
For Expectations with times=1 this should be migrated to a basic Mockito when with no times information, as that is the default when statement. Instead it is migrated to verify(obj, times(1)).method(); but should be verify(obj).method();
This may be quite easy to implement.
The text was updated successfully, but these errors were encountered: