I\'ve started my project by creating entities, services and JUnit tests for services using Spring and Hibernate. All of this works great. Then I\'ve added spring-mvc to make
Instead of @Autowire MailManager mailManager, you can mock the bean as given below:
import org.springframework.boot.test.mock.mockito.MockBean;
::
::
@MockBean MailManager mailManager;
Also, you can configure @MockBean MailManager mailManager; separately in the @SpringBootConfiguration class and initialize like below:
@Autowire MailManager mailManager