I was writing unit tests for our services classes in spring boot project. Where tests were properly running when I'am autowiring the class which am testing and it fails when I use @MockBean insead of @Autowire.
@SpringBootTest
class SignupServiceTest {
@Autowired SignupService signupService;
@MockBean DSService dsService;
@MockBean SignupHelper signupHelper;
@MockBean SessionHelper sessionHelper;
@MockBean CommonService commonService;
Can somehelp help me with difference and why @MockBean is failing. Also is there a way to mock methods of autowired class(Current class) in mockito.