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?hello world weblogic – hello world tutorial on weblogic
Passing composite object parameter to jersey in Restful Java web
J2EE Maven Eclipse Hello World Tutorial Part Two
Check if two strings are anagrams or not
Java Tomcat error: can not access a member of class with modifiers
pass all the jars in classpath when compiling java