I'm doing unit tests for the first time in Spring Boot. It turns out that it shows me an Error:
Field cardRepository in ec.com.alquimiasoft.futgolazoback.service.CardService required a bean of type 'ec.com.alquimiasoft.futgolazoback.repository.CardRepository' that could not be found.
Within my driver test class I have only these references:
@Autowired
private MockMvc mockMvc;
@MockBean
private PrognosticService prognosticService;
And within the service class you are only
@Autowired
private PrognosticRepository prognosticRepository;
My doubt is related to that there may be some configuration that is checking in another service that I am not using from the test class. In short, if I'm running a unit of tests, because it could be happening I throw errors related to other components within the application that are unrelated to the test I'm running.