protected void save() { savePopUpPresenter.show(getCurrentPath(), getSaveCommand()); concurrentUpdateSessionInfo = null; }
protected void save() { final DataSetDef dataSetDef = currentWorkflow.getDataSetDef(); savePopUpPresenter.show(message -> onSave(dataSetDef, message)); }
@Override public void save(final Path path, final RemoteCallback<Path> saveSuccessCallback) { savePopUpPresenter.show(path, commitMessage -> { LayoutTemplate layoutTemplate = getLayout(); perspectiveServices.call(saveSuccessCallback) .saveLayoutTemplate(path, layoutTemplate, commitMessage); }); }
@Override protected void save() { savePopUpPresenter.show(versionRecordManager.getCurrentPath(), (commitMessage) -> { baseView.showSaving(); save(commitMessage); concurrentUpdateSessionInfo = null; }); concurrentUpdateSessionInfo = null; }
@Override public void save(final Path path, final RemoteCallback<Path> saveSuccessCallback) { savePopUpPresenter.show(path, commitMessage -> { LayoutTemplate layoutTemplate = getLayout(); perspectiveServices.call(saveSuccessCallback) .saveLayoutTemplate(path, layoutTemplate, commitMessage); }); }
public void show(final Path path, final ParameterizedCommand<String> command) { final ParameterizedCommand<String> wrappedCommand = wrapWithSaveInProgressEvent(path, command); if (isVersioned(path)) { show(wrappedCommand); } else { wrappedCommand.execute(""); } }
private void assertOnSaveSavedDiagram() { verify(savePopUpPresenter).show(eq(path), savePopupCommandCaptor.capture()); final ParameterizedCommand<String> savePopupCommand = savePopupCommandCaptor.getValue(); savePopupCommand.execute(SAVE_MESSAGE); verify(projectDiagramServices).saveOrUpdate(eq(path), eq(diagram), any(Metadata.class), eq(SAVE_MESSAGE), serviceCallbackCaptor.capture()); }
@Test public void saveNoValidationErrors() { when(validationService.validateForSave(any(Path.class), any(GlobalsModel.class))).thenReturn(Collections.emptyList()); presenter.save(); verify(validationService, times(1)).validateForSave(any(Path.class), any(GlobalsModel.class)); verify(savePopUpPresenter, times(1)).show(any(Path.class), any(ParameterizedCommand.class)); }
@Test public void saveNoValidationErrors() { when(validationService.validateForSave(any(Path.class), any(GlobalsModel.class))).thenReturn(Collections.emptyList()); presenter.save(); verify(validationService, times(1)).validateForSave(any(Path.class), any(GlobalsModel.class)); verify(savePopUpPresenter, times(1)).show(any(Path.class), any(ParameterizedCommand.class)); }
@Test public void testShowWithAPathThatIsNotVersioned() throws Exception { presenter.show(path, command); verifyNoMoreInteractions(view); verify(command).execute(""); verify(saveInProgressEvent).fire(new SaveInProgressEvent(any(Path.class))); }
@Test public void testShowWithAPathThatIsNotVersioned() throws Exception { presenter.show(path, command); verifyNoMoreInteractions(view); verify(command).execute(""); verify(saveInProgressEvent).fire(new SaveInProgressEvent(any(Path.class))); }
@Test public void testShowSaveModalWithoutPermission() { doReturn(false).when(libraryPermissions).userCanUpdateProject(any()); doReturn(promises.resolve()).when(sectionManager).validateAll(); presenter.showSaveModal(); verify(savePopUpPresenter, never()).show(any()); verify(sectionManager, never()).goTo(any()); }
@Test public void testShowSaveModal() { doReturn(true).when(libraryPermissions).userCanUpdateProject(any()); doReturn(promises.resolve()).when(sectionManager).validateAll(); presenter.showSaveModal(); verify(savePopUpPresenter).show(any()); verify(sectionManager, never()).goTo(any()); }
@Test(expected = IllegalArgumentException.class) public void testSaveWithoutCommand() throws Exception { presenter.show(null); presenter.save(); }
@Test public void testShowWithAPathThatIsVersioned() throws Exception { final Path versionedPath = getVersionedPath(); presenter.show(versionedPath, command); verify(view).show(); verifyNoMoreInteractions(saveInProgressEvent); }
@Test(expected = IllegalArgumentException.class) public void testSaveWithoutCommand() throws Exception { presenter.show(null); presenter.save(); }
@Test public void testShowSaveModalWithValidationError() { doReturn(true).when(libraryPermissions).userCanUpdateProject(any()); Section<ProjectScreenModel> section = newMockedSection(); doReturn(promises.reject(section)).when(sectionManager).validateAll(); presenter.showSaveModal(); verify(savePopUpPresenter, never()).show(any()); verify(view).hideBusyIndicator(); verify(sectionManager).goTo(section); }
@Test public void testSaveWithCommand() throws Exception { when(toggleCommentPresenter.getComment()).thenReturn("test"); presenter.show(command); presenter.save(); verify(command).execute("test"); verify(view).hide(); }
@Test public void testSaveWithCommand() throws Exception { when(toggleCommentPresenter.getComment()).thenReturn("test"); presenter.show(command); presenter.save(); verify(command).execute("test"); verify(view).hide(); }
@Test public void testShowWithoutPath() throws Exception { presenter.show(command); verify(view).show(); assertEquals(command, presenter.getCommand()); }