My project is using spring-boot
, sping-data-jpa
, spring-data-rest
, hibernate
I have updated to spring boot 2.3.1
Firstly looking at your code you are injecting the mocks in to the test class rather than the actual service. Is this how your actual test looks or have you just copied this in so as to not share your actual code?
@InjectMocks
private MyServiceTest myServiceTest;
Secondly this is a unit test so remove the @SpringBootTest annotation. It is adding unnecessary overhead and is probably causing the error through lack of configuration for code you are not actually testing having mocked the repository anyway.