I am dealing with following problem I created a service class that has a repository (Spring Data) as dependency, I am injecting by constructor. In this example I am using Lombok
I would like to know how can I test it with Mockito, I tried this way but it didn't work, the repository interface passed by parameter is getting null at the constructor.
I remove the Lombok to be possible to see the value getting null at the constructor.
If I change the dependency injection to @Autowired it works but I want to know how to test it this way.
Thank you so much I am a beginner on that...
CodePudding user response:
I found a solution, I changed my test class this way: