Wanted but not Invoked Error in mockito and its solution
This happens with mockito when trying to verify the invocation on an object with specific method.
But what happens is you have interacted with other method of that object but not the one mentioned.
If you have an object named
CustomerService and say it has two methods named
And mockito looks something like
But in your actual service you called the
saveCustomer() at least once.. BINGO you would get that error.
Also Recommended for you
Do you like Algorithms?