Find Spring testing smells

Proprietary

@MockBean / @SpyBean lateinit-var fields (often a plain unit test would do), MockMvcBuilders.standaloneSetup (consider @AutoConfigureMockMvc), and WebTestClient tests that don't drain the publisher with StepVerifier.

org.openrewrite.kotlin.spring.FindSpringTestingSmells$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.spring.FindSpringTestingSmells$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.

Recipe list

It runs these recipes, in this order.

  1. Find @MockBean on lateinit var fields
  2. Find @SpyBean on lateinit var fields
  3. Find MockMvcBuilders.standaloneSetup(...) calls
  4. Find WebTestClient test classes that don't use StepVerifier