Add @MockitoSettings(strictness = Strictness.WARN) for legacy Mockito modules

MSAL

Adds @MockitoSettings(strictness = Strictness.WARN) to test classes annotated with @ExtendWith(MockitoExtension.class) only when the module depends on a pre-3.0 version of Mockito. This preserves the lenient stubbing behavior from Mockito 1.x/2.x and prevents UnnecessaryStubbingException errors once MockitoExtension's strict stubbing default kicks in.

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

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. Add @MockitoSettings(strictness = Strictness.WARN) to @ExtendWith(MockitoExtension.class) classes