Close unclosed static mocks
MSALEnsures that all mockStatic calls are properly closed. If mockStatic is in lifecycle methods like @BeforeEach or @BeforeAll, creates a class variable and closes it in @AfterEach or @AfterAll. If mockStatic is inside a test method, wraps it in a try-with-resources block.
org. openrewrite. java. testing. mockito. CloseUnclosedStaticMocksmod run . --recipe= org. openrewrite. java. testing. mockito. CloseUnclosedStaticMocksInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.