I have an interface with a method that expects an array of Foo
:
public interface IBar {
void doStuff(Foo[] arr);
}
I am mocking this interface using Mockito, and I'd like to assert that doStuff()
is called, but I don't want to validate what argument are passed - "don't care".
How do I write the following code using any()
, the generic method, instead of anyObject()
?
IBar bar = mock(IBar.class);
...
verify(bar).doStuff((Foo[]) anyObject());
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…