Replace undeclared checked exceptions in thenThrow with RuntimeException
MSALIn 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. ThenThrowCheckedExceptionToRuntimeExceptionmod run . --recipe= org. openrewrite. java. testing. mockito. ThenThrowCheckedExceptionToRuntimeExceptionInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.