Find Mockito @Mock fields

Proprietary

@Mock-annotated fields are populated by MockitoAnnotations.openMocks(this) (or the MockitoExtension). In mockk the convention is an inline assignment: private val service = mockk<Service>(relaxed = true). Each match is a candidate for that conversion.

org.openrewrite.kotlin.testing.FindMockitoMockField$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.testing.FindMockitoMockField$KtRecipe'

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