I'm not totally sure because you didn't show an actual test but I guess you should use @MockBean
and not @Mock
.
@Mock
is used for plain Unit Test when you do the dependency injection yourself.
@MockBean
is used for integration tests when you want to use your Mock as a regular Bean.
Long story shot. Try this:
@MockBean
FactureService factureService;
For more information have a look on this article.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…