@Test public void testUpdateView() throws Exception { /** CALL METHOD UNDER TEST * */ uut.updateView(); verify(viewMock).mask(eq(appearanceMock.loadingMask())); verify(serviceFacadeMock).getMembers(memberListCallbackCaptor.capture()); memberListCallbackCaptor.getValue().onSuccess(memberListMock); verify(listStoreMock).replaceAll(eq(memberListMock)); verify(viewMock).unmask(); }
@Before public void setUp() throws Exception { when(appearanceMock.loadingMask()).thenReturn("mask"); when(appearanceMock.partialGroupSaveMsg()).thenReturn("partial"); when(viewFactoryMock.create(listStoreMock)).thenReturn(viewMock); uut = new WorkshopAdminPresenterImpl( viewFactoryMock, serviceFacadeMock, factoryMock, propertiesMock, appearanceMock) { @Override ListStore<Member> getMemberListStore(MemberProperties memberProperties) { return listStoreMock; } }; uut.listStore = listStoreMock; }
@Test public void testSaveMembers_NoFailures() { when(stringListMock.isEmpty()).thenReturn(true); when(memberSaveResultMock.getFailures()).thenReturn(stringListMock); when(memberSaveResultMock.getMembers()).thenReturn(memberListMock); /** CALL METHOD UNDER TEST * */ uut.saveMembers(memberListMock); verify(viewMock).mask(eq(appearanceMock.loadingMask())); verify(serviceFacadeMock).saveMembers(eq(memberListMock), memberSaveCallbackCaptor.capture()); memberSaveCallbackCaptor.getValue().onSuccess(memberSaveResultMock); verify(listStoreMock).replaceAll(eq(memberListMock)); verify(viewMock).unmask(); }