PopUpCoachMarkPresenter { public void onViewCreated() { displayCoachMark(); } PopUpCoachMarkPresenter(final IStringResourceProvider stringResourceProvider,
                                   final IDimensionResourceProvider dimensionResourceProvider,
                                   final ITypeFaceProvider typeFaceProvider,
                                   final IScreenInfoProvider screenInfoProvider); void onCreate(CoachMarkBuilder coachMarkBuilder); void onCreateView(IPopUpCoachMarkPresentation popUpCoachMarkPresentation); void onViewCreated(); void onDestroyView(); void onDestroy(); void onOkButtonClicked(); void onShimClicked();  }
@Test public void onViewCreatedTest(){ PopUpCoachMarkPresenter spiedPopUpCoachMarkPresenter = Mockito.spy(new PopUpCoachMarkPresenter(mStringResourceProvider, mDimensionResourceProvider, mTypeFaceProvider, mScreenInfoProvider)); MockedPoint pointTop = new MockedPoint(400, 0); MockedPoint pointBottom = new MockedPoint(600,600); CoachMarkBuilder coachMarkBuilder = CoachMarkBuilder.create(pointTop, pointBottom, mockedStringRes).build(); spiedPopUpCoachMarkPresenter.onCreate(coachMarkBuilder); spiedPopUpCoachMarkPresenter.onCreateView(mPopUpCoachMarkPresentation); Mockito.doReturn(mCoachMarkPixelInfo).when(spiedPopUpCoachMarkPresenter) .createCoachMarkPixelInfo(); spiedPopUpCoachMarkPresenter.onViewCreated(); Mockito.verify(spiedPopUpCoachMarkPresenter, Mockito.times(1)) .displayCoachMark(); }