Replace PowerMock Whitebox.setInternalState() with @InjectMocks
MSALReplaces Whitebox.setInternalState(objectUnderTest, "field", mock) with Mockito's own field injection, annotating the object under test with @InjectMocks. Only applies when the value is a @Mock or @Spy field whose name matches the field being set, so that Mockito injects the same mock the call did; other calls are left to the reflection-based recipe.
org. openrewrite. java. testing. mockito. PowerMockWhiteboxSetInternalStateToInjectMocksmod run . --recipe= org. openrewrite. java. testing. mockito. PowerMockWhiteboxSetInternalStateToInjectMocksInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.