i dunno if the question is already ask, but i couldn’t find it… i’m searching a way to mock my view in order to test my presenter ? i try to use mockito for the view, and set it in the presenter, but in result in presenter, when i call presenter.getDisplay() (the getter for the view) all of my widget is null ? as i believe it’s normal mockito will not mock the widget.
i’m 100% sure i mistaken something but i couldnt find it.
thanks for your enlightement 🙂
you need to make sure that you told mockito to return the mocked view when you call getDislay().
Sth like
when(presenter.getDisplay()).thenReturn(mockView);