Replace MockitoTestExecutionListener (TestNG projects)

MSAL

Replace MockitoTestExecutionListener in projects that have TestNG as a dependency. Uses MockitoAnnotations.openMocks(this) with @BeforeMethod/@AfterMethod as the replacement.

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

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. Replace MockitoTestExecutionListener with the equivalent Mockito test initialization