Replace MockitoAnnotations.initMocks(this) to MockitoAnnotations.openMocks(this)

MSAL

Replace MockitoAnnotations.initMocks(this) to MockitoAnnotations.openMocks(this) and generate AutoCloseable mocks.

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

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