codegenomeproject
Search
MarketplaceModules
PackagesCLIMCP
Sign in
  1. Marketplace
  2. Java
  3. Testing
  4. Migrate from JMockit to Mockito

Migrate from JMockit to Mockito

MSAL

Applies changes commonly needed when migrating from JMockit to Mockito.

org.openrewrite.java.testing.jmockit.JMockitToMockito
mod run . --recipe=org.openrewrite.java.testing.jmockit.JMockitToMockito

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

Recipe
  1. Rewrite JMockit Expectations, NonStrictExpectations, Verifications, VerificationsInOrder, FullVerifications
  2. Rewrite JMockit MockUp to Mockito statements
  3. Convert JMockit @Mocked and @Injectable annotated arguments
  4. Change type Mocked to Mock
  5. Change type Injectable to Mock
  6. Change type Tested to InjectMocks
  7. Change type JMockitExtension to MockitoExtension
  8. Change type JMockit to MockitoJUnitRunner
  9. Adds Mockito extensions to Mockito tests
  10. Add Gradle or Maven dependency org.mockito:mockito-core:5.x
  11. Add Gradle or Maven dependency org.mockito:mockito-junit-jupiter:5.x
  12. Remove a Gradle or Maven dependency org.jmockit:jmockit
  13. Exclude Maven dependency org.jmockit:jmockit
  14. Mockito best practices
© Moderne, 2026
Recipe indexPrivacyTerms