jeudi 29 janvier 2015

Mockito tries to invoke method when I set behaviour for it

I have following code line:



when(htmlEmailSpy.setFrom(anyString())).thenReturn(null);


Following code executes real htmlEmailSpy.setFrom(...) but it throws exception.



@Spy
HtmlEmail htmlEmailSpy = new HtmlEmail();


What do I wrong?


my aim - set new behaviour to spy object.


Aucun commentaire:

Enregistrer un commentaire