Exclude a transitive mockito-all from modules that move off PowerMock
MSALExcludes mockito-all from the dependencies that bring it into a module that depends on the PowerMock Mockito API. mockito-all is a 1.x-only uber jar with its own org.mockito.Mockito, which shadows the one of the Mockito 3.x that replaces PowerMock wherever it comes first on the classpath, so that Mockito.mockStatic and MockedStatic do not resolve. The Hamcrest 1.1 and Objenesis classes bundled in mockito-all go with it. Only the Maven dependencies declared in the module itself are excluded from, not those it inherits from a parent that does not depend on PowerMock. Where ChangeMockitoAllToMockitoCoreReplacingPowerMock runs again in a later cycle, it pairs the exclusion with one of mockito-core, which is harmless as the module declares the Mockito that replaces PowerMock.
org. openrewrite. java. testing. mockito. ExcludeMockitoAllReplacingPowerMockmod run . --recipe= org. openrewrite. java. testing. mockito. ExcludeMockitoAllReplacingPowerMockInstall 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.