Add @MockitoSettings(strictness = Strictness.WARN) to @ExtendWith(MockitoExtension.class) classes
MSALAdds @MockitoSettings(strictness = Strictness.WARN) to test classes that have @ExtendWith(MockitoExtension.class) but do not already have a @MockitoSettings annotation. This preserves the lenient stubbing behavior from Mockito 1.x/2.x migrations and prevents UnnecessaryStubbingException from strict stubbing defaults.
org. openrewrite. java. testing. mockito. AddMockitoSettingsWithWarnStrictnessmod run . --recipe= org. openrewrite. java. testing. mockito. AddMockitoSettingsWithWarnStrictnessInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.