@Test public void canConfirmSavedOnSavedState() { selectedTU = currentPageRows.get(1); when(display.getId()).thenReturn(selectedTU.getId()); when(display.getEditingState()).thenReturn(TargetContentsDisplay.EditingState.SAVED); presenter.setStatesForTesting(selectedTU.getId(), 0, display); presenter.confirmSaved(selectedTU); InOrder inOrder = Mockito.inOrder(display); inOrder.verify(display).setValueAndCreateNewEditors(selectedTU); inOrder.verify(display).refresh(); inOrder.verify(display).setState(TargetContentsDisplay.EditingState.SAVED); }
@Test public void canConfirmSavedOnSavingState() { selectedTU = currentPageRows.get(1); when(display.getId()).thenReturn(selectedTU.getId()); when(display.getEditingState()).thenReturn(TargetContentsDisplay.EditingState.SAVING); presenter.setStatesForTesting(selectedTU.getId(), 0, display); presenter.confirmSaved(selectedTU); verify(display) .updateCachedTargetsAndVersion( selectedTU.getTargets(), selectedTU.getVerNum(), selectedTU.getStatus()); verify(display).setState(TargetContentsDisplay.EditingState.SAVED); }