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
Hi @jpraet ! Thanks for the suggestion; looking at the gist link this appears relatively straightforward:
sed -i 's/org.easymock.EasyMock.createNiceMock/org.mockito.Mockito.mock/g'$item
sed -i 's/org.easymock.EasyMock.createMock/org.mockito.Mockito.mock/g'$item
sed -i 's/org.easymock.EasyMock.expect/org.mockito.Mockito.when/g'$item
sed -i 's/org.easymock.EasyMock/org.mockito.Mockito/g'$item
sed -i 's/EasyMock/Mockito/g'$item
sed -i 's/createNiceMock/mock/g'$item
sed -i 's/createMock/mock/g'$item
sed -i 's/expect(/when(/g'$item
sed -i 's/andReturn/thenReturn/g'$item
sed -i 's/\.anyTimes()//g'$item
sed -i '/replay[^A-Za-z0-9]/d'$item
At first glance most, if not all of these can be converted to use recipes we already have which you can compose in our recipe builder at https://app.moderne.io/recipes/builder
For instance the first conversion could be replaced by
type: specs.openrewrite.org/v1beta/recipename: java.testing.easymock.EasyMockToMockitodisplayName: Migrate from EasyMock to Mockitodescription: This recipe will apply changes commonly needed when migrating from EasyMock to Mockito.recipeList:
- org.openrewrite.java.ChangeMethodTargetToStatic:
methodPattern: org.easymock.EasyMock createNiceMock(..)fullyQualifiedTargetTypeName: org.mockito.Mockito
- org.openrewrite.java.ChangeMethodName:
methodPattern: org.mockito.Mockito createNiceMock(..)newMethodName: mock
...
What problem are you trying to solve?
Migrate from EasyMock to Mockito.
Resources:
The text was updated successfully, but these errors were encountered: