I have service class with method which calls ie. repository.save() multiple times. I am testing said service method. Is it possible to capture save() method call on x time and get its passed/returned arguments?
Example:
class MyService{
void doSomething(){
myRepository.save(obj1);
// some code;
myRepository.save(obj2);
}
}
I am testing doSomething method and would like to get result and/or passed argument of the first save method. I am using mockito.