Replace @MockBean and @SpyBean
MSALReplaces @MockBean and @SpyBean annotations with @MockitoBean and @MockitoSpyBean.
org. openrewrite. java. spring. boot4. ReplaceMockBeanAndSpyBeanmod run . --recipe= org. openrewrite. java. spring. boot4. ReplaceMockBeanAndSpyBeanInstall 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.
- Unwrap
@MockBeansand@SpyBeanscontainer annotations - Change annotation attribute name
@MockBean(answer)to@MockBean(answers) - Remove annotation attribute
@MockBean(classes) - Remove annotation attribute
@MockBean(value) - Change type
MockBeantoMockitoBean - Remove annotation attribute
@SpyBean(classes) - Remove annotation attribute
@SpyBean(value) - Remove annotation attribute
@SpyBean(proxyTargetAware) - Change type
SpyBeantoMockitoSpyBean - Change type
org.springframework.boot.test.mock.mockito.MockResettoorg.springframework.test.context.bean.override.mockito.MockReset