Replace field injection with constructor injection and replaced the deprecated MockBean with MockitoBean
MockBean
MockitoBean