Swap the PowerMock dependencies for Mockito

MSAL

Replaces and then removes the PowerMock dependencies. Usage that cannot be migrated has been commented out by DisableUnsupportedPowerMockTests, so no code refers to PowerMock by the time this runs. Leaving PowerMock on the classpath is not an option: it registers its own MockMaker, which cannot create the static and construction mocks the migrated tests rely on.

org.openrewrite.java.testing.mockito.RemovePowerMockDependencies
mod run . --recipe=org.openrewrite.java.testing.mockito.RemovePowerMockDependencies

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.

  1. Change mockito-all to mockito-core along with the Mockito that replaces PowerMock
  2. Replace PowerMock dependencies with Mockito equivalents
  3. Upgrade mockito-core along with the Mockito that replaces PowerMock
  4. Add JUnit 4 where the PowerMock JUnit 4 module provided it
  5. Remove a Gradle or Maven dependency org.powermock:powermock*
  6. Remove Maven managed dependency org.powermock:powermock*
  7. Exclude a transitive mockito-all from modules that move off PowerMock
  8. Remove unused properties