Replace PowerMock Whitebox.setInternalState() with @InjectMocks

MSAL

Replaces 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.PowerMockWhiteboxSetInternalStateToInjectMocks
mod run . --recipe=org.openrewrite.java.testing.mockito.PowerMockWhiteboxSetInternalStateToInjectMocks

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