Replace PowerMock Whitebox with Java reflection
MSALReplace org.powermock.reflect.Whitebox calls (setInternalState, getInternalState, invokeMethod, getField, getMethod, invokeConstructor) with plain Java reflection using java.lang.reflect.Field, java.lang.reflect.Method, and java.lang.reflect.Constructor.
org. openrewrite. java. testing. mockito. PowerMockWhiteboxToJavaReflectionmod run . --recipe= org. openrewrite. java. testing. mockito. PowerMockWhiteboxToJavaReflectionInstall 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.
- Replace PowerMock
Whitebox.setInternalState()with Java reflection - Replace PowerMock
Whitebox.getInternalState()with Java reflection - Replace PowerMock
Whitebox.invokeMethod()with Java reflection - Replace PowerMock
Whitebox.getField()with Java reflection - Replace PowerMock
Whitebox.getMethod()with Java reflection - Replace PowerMock
Whitebox.invokeConstructor()with Java reflection