lundi 22 décembre 2014

How to Mock instanceof in Mockito

I have a piece of code, what I want test with Mockito:



mockedClass instanceof SampleInterface


The mockedClass is mocked object whats type is a MockedClass , and the SampleInterface is an Interface. This is the failing point:



Validate.isTrue(mockedClass instanceof SampleInterface, "The mockedClass is not a SampleInterface");


How to mock this code?


Aucun commentaire:

Enregistrer un commentaire