Replace Mockito 1.x anyString()/any() with nullable(Class)

MSAL

Since Mockito 2.10 anyString() and any(Class) no longer match null values. Use nullable(Class) instead in modules that still depend on mockito-all.

org.openrewrite.java.testing.mockito.AnyToNullable
mod run . --recipe=org.openrewrite.java.testing.mockito.AnyToNullable

Install 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.

  1. Change method name org.mockito.* any(java.lang.Class) to nullable
  2. Change method target to static
  3. Change method target to static
  4. Change method target to static
  5. Change method target to static
  6. Replace Mockito 1.x anyString() with nullable(String.class)