@Override public void renameItem( final Path path, final Validator validator, final CommandWithFileNameAndCommitMessage command ) { renamePopUpPresenter.show( path, validator, command ); }
@Test public void testShowWithDefaultValidator() throws Exception { presenter.show(path, renameCommand); assertNotNull(presenter.getPath()); assertNotNull(presenter.getValidator()); assertNotNull(presenter.getRenameCommand()); verify(presenter).setupView(); verify(presenter).showView(); }
public void show(final Path path, final Validator validator, final boolean isDirty, final CommandWithFileNameAndCommitMessage renameCommand, final CommandWithFileNameAndCommitMessage saveAndRenameCommand) { show(path, validator, renameCommand, saveAndRenameCommand, isDirty, DEFAULT_FILE_NAME); }
@Test public void testShow() throws Exception { presenter.show(path, validator, renameCommand); assertNotNull(presenter.getPath()); assertNotNull(presenter.getValidator()); assertNotNull(presenter.getRenameCommand()); verify(presenter).setupView(); verify(presenter).showView(); }
public void show(final Path path, final Validator validator, final boolean isDirty, final CommandWithFileNameAndCommitMessage renameCommand, final CommandWithFileNameAndCommitMessage saveAndRenameCommand) { show(path, validator, renameCommand, saveAndRenameCommand, isDirty, DEFAULT_FILE_NAME); }
public void show(final Path path, final CommandWithFileNameAndCommitMessage renameCommand) { final Validator validator = defaultValidator(); show(path, validator, renameCommand, DEFAULT_COMMAND, DEFAULT_DIRTY_STATUS, DEFAULT_FILE_NAME); }
public void show(final Path path, final CommandWithFileNameAndCommitMessage renameCommand) { final Validator validator = defaultValidator(); show(path, validator, renameCommand, DEFAULT_COMMAND, DEFAULT_DIRTY_STATUS, DEFAULT_FILE_NAME); }
public void show(final Path path, final CommandWithFileNameAndCommitMessage renameCommand, final String originalFileName) { final Validator validator = defaultValidator(); show(path, validator, renameCommand, DEFAULT_COMMAND, DEFAULT_DIRTY_STATUS, originalFileName); }
public void rename(boolean save) { if (save) { synchronizeFormLayout(); } renamePopUpPresenter.show(versionRecordManager.getPathToLatest(), assetUpdateValidator, getRenameCommand(save)); }
@Test(expected = IllegalArgumentException.class) public void testShowMissingValidator() throws Exception { presenter.show(path, null, renameCommand); }
@Test(expected = IllegalArgumentException.class) public void testShowMissingRenameCommand() throws Exception { final boolean isDirty = true; final String fileName = "file.plugin"; presenter.show(path, validator, null, saveAndRenameCommand, isDirty, fileName); }
@Test(expected = IllegalArgumentException.class) public void testShowMissingPath() throws Exception { presenter.show(null, validator, renameCommand); }
@Test(expected = IllegalArgumentException.class) public void testShowMissingSaveAndRenameCommand() throws Exception { final boolean isDirty = true; final String fileName = "file.plugin"; presenter.show(path, validator, renameCommand, null, isDirty, fileName); }
@Test(expected = IllegalArgumentException.class) public void testShowMissingCommand() throws Exception { presenter.show(path, validator, null); }
@Override public BasicFileMenuBuilder addRename(final Path path, final Caller<? extends SupportsRename> renameCaller) { return addRename(() -> { CommandWithFileNameAndCommitMessage command = getRenamePopupCommand(renameCaller, path, renamePopUpPresenter.getView()); renamePopUpPresenter.show(path, command); }); }
@Override public BasicFileMenuBuilder addRename(final Path path, final Caller<? extends SupportsRename> renameCaller) { return addRename(() -> { CommandWithFileNameAndCommitMessage command = getRenamePopupCommand(renameCaller, path, renamePopUpPresenter.getView()); renamePopUpPresenter.show(path, command); }); }
private void renamePopUpPresenterShowMock() { final ArgumentCaptor<CommandWithFileNameAndCommitMessage> commandCaptor = ArgumentCaptor.forClass(CommandWithFileNameAndCommitMessage.class); doAnswer(invocation -> { commandCaptor.getValue().execute(new FileNameAndCommitMessage("fileName", "message")); return null; }).when(renamePopUpPresenterMock).show(any(Path.class), any(Validator.class), commandCaptor.capture()); }
private void testRename(boolean saving) { loadContent(); presenter.rename(saving); verify(renamePopUpPresenter).show(any(Path.class), any(DefaultFileNameValidator.class), any(CommandWithFileNameAndCommitMessage.class)); }
@Test public void testRename() throws Exception { when(path.getFileName()).thenReturn("file.plugin"); presenter.show(path, validator, renameCommand); presenter.rename("newFile"); verify(validator).validate(eq("newFile.plugin"), any(ValidatorWithReasonCallback.class)); }
@Test public void testSaveAndRename() throws Exception { final boolean isDirty = true; when(path.getFileName()).thenReturn("file.plugin"); presenter.show(path, validator, isDirty, renameCommand, saveAndRenameCommand); presenter.saveAndRename("newFile"); verify(validator).validate(eq("newFile.plugin"), any(ValidatorWithReasonCallback.class)); }