Replace PowerMock Whitebox.setInternalState() with Java reflection
MSALReplace Whitebox.setInternalState(Object, String, Object) and Whitebox.setInternalState(Object, String, Object, Class) (and their Object[] overloads) with java.lang.reflect.Field access. The 3-arg overload looks up the field on the class declaring it, found through the target's declared type and its superclasses, falling back to the target's runtime class; the 4-arg where-overload uses the supplied Class.
org. openrewrite. java. testing. mockito. PowerMockWhiteboxSetInternalStateToJavaReflectionmod run . --recipe= org. openrewrite. java. testing. mockito. PowerMockWhiteboxSetInternalStateToJavaReflectionInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.