Replace PowerMock Whitebox.getField() with Java reflection
MSALReplace Whitebox.getField(Class, String) with Class.getDeclaredField(String) plus setAccessible(true). Unlike PowerMock, getDeclaredField does not traverse the class hierarchy for fields inherited from a superclass.
org. openrewrite. java. testing. mockito. PowerMockWhiteboxGetFieldToJavaReflectionmod run . --recipe= org. openrewrite. java. testing. mockito. PowerMockWhiteboxGetFieldToJavaReflectionInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.