So, I want to mimic in Mockito a method that is making a network call and is waiting for it to complete before returning. I found this nice answer here: https://stackoverflow.com/a/50530261/4433222 that suggests using AnswersWithDelay
.
Issue is though that I struggle to define a method's behavior for a method that returns void. AnswersWithDelays
constructor requires a parameter of Answer<Object>
type, and I wasn't able to find how to set it as void. Any clues?