Replace PowerMock with raw Mockito
MSALReplace PowerMockito with raw Mockito; best executed as part of a Mockito upgrade.
Tests that mock, stub or verify private members are disabled rather than migrated. Mockito does not support reaching into private state by design, and a test that depends on it is testing an implementation detail, so the intended follow-up is a review that reworks each one to exercise the type through its public API -- not a like-for-like translation. Each disabled test keeps its original body as a comment for that review, is annotated @Disabled, @Ignore or TestNG's @Ignore, and is listed as an action item in the PowerMockTestsDisabled data table. Commenting the body out is what lets the PowerMock dependency be removed, so the rest of the repository moves off PowerMock and its tests keep running: PowerMock registers its own Mockito MockMaker, which cannot create the static and construction mocks the migrated tests rely on, so the two cannot share a classpath.
org. openrewrite. java. testing. mockito. ReplacePowerMockitomod run . --recipe= org. openrewrite. java. testing. mockito. ReplacePowerMockitoInstall 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.