lundi 29 août 2016

Mockito conditions for several arguments

I'm trying to mock the results of a method. There should be two variations of the result:

Mockito.when(class.method(a,b)).thenReturn(c);

  • if a-b equals 20
  • if a-b is not 20.

How can I achieve to write two different statements and return different results?

Aucun commentaire:

Enregistrer un commentaire