I am trying to create a mock for a call.
Say I have this method I am trying to stub out:
class ClassA {
public String getString(String a) {
return a + "hey";
}
}
What I am trying to mock out is:
1st instance is
when(classA.getString(eq("a")).thenReturn(...);`
in the same test case
when(classA.getString([anything that is not a])).thenReturn(somethingelse);
The 2nd case is my question: How do I match anyString()
other than "a"?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…