Replace undeclared checked exceptions in thenThrow with RuntimeException

MSAL

In Mockito 3+, thenThrow() validates that checked exceptions are declared in the mocked method's throws clause. This recipe replaces checked exception class literals in thenThrow() calls with RuntimeException.class when the mocked method does not declare the exception.

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

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