I'm testing a method that call same method (db.getData()
) twice. But I must return two different values.
Mockito.when(db.someMethod()).thenReturn(valueOne).thenReturn(valueTwo);
Then I tried out multiple thenReturn()
.
Unfortunately I'm getting only valueTwo for first & second db.getData()
method call.
Aucun commentaire:
Enregistrer un commentaire