@Override public Path copy(final Path path, final String newName, final Path targetDirectory, final String comment) { return copyService.copy(path, newName, targetDirectory, comment); }
@Override public Path copy(final Path path, final String newName, final String comment) { return copyService.copy(path, newName, comment); }
@Override public Path copy(final Path path, final String newName, final Path targetDirectory, final String comment) { return copyService.copy(path, newName, targetDirectory, comment); }
@Override public Path copy(final Path path, final String newName, final String comment) { try { return copyService.copy(path, newName, comment); } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }
@Override public Path copy( final Path path, final String newName, final String comment ) { try { return copyService.copy( path, newName, comment ); } catch ( Exception e ) { throw ExceptionUtilities.handleException( e ); } }
@Override public Path copy(final Path path, final String newName, final String comment) { try { return copyService.copy(path, newName, comment); } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }
@Override public Path copy(final Path path, final String newName, final String comment) { try { return copyService.copy(path, newName, comment); } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }
@Override public Path copy(final Path path, final String newName, final String comment) { try { return copyService.copy(path, newName, comment); } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }
@Override public Path copy(final Path path, final String newName, final String comment) { try { return copyService.copy(path, newName, comment); } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }
@Override public Path copy(final Path path, final String newName, final String comment) { try { return copyService.copy(path, newName, comment); } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }
@Override public Path copy(final Path path, final String newName, final String comment) { try { return copyService.copy(path, newName, comment); } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }
@Override public Path copy(final Path path, final String newName, final String comment) { try { return copyService.copy(path, newName, comment); } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }
@Override public void copy(Path path, String newFileName, String commitMessage, boolean saveBeforeCopying, FormModelerContent content, Metadata metadata) { if (saveBeforeCopying) { save(path, content, metadata, commitMessage); } copyService.copy(path, newFileName, commitMessage); }
@Override public Path copy(final Path path, final String newName, final String comment) { try { return copyService.copy(path, newName, comment); } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }
@Override public Path copy(final Path path, final String newName, final String comment) { try { return copyService.copy(path, newName, comment); } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }
@Override public Path copy( final Path path, final String newName, final String comment ) { try { return copyService.copy( path, newName, comment ); } catch ( Exception e ) { throw ExceptionUtilities.handleException( e ); } }
@Test public void testCopyWithTargetDirectory() throws Exception { final Path targetDirectory = mock(Path.class); final Path expectedPath = mock(Path.class); doReturn(expectedPath).when(copyService).copy(path, newFileName, targetDirectory, comment); final Path actualPath = htmlEditorService.copy(path, newFileName, targetDirectory, comment); verify(copyService).copy(path, newFileName, targetDirectory, comment); assertEquals(expectedPath, actualPath); }
private void testCopy(boolean saveBeforeCopy) { FormModelerContent content = mock(FormModelerContent.class); doReturn(path).when(formEditorService).save(any(Path.class), any(FormModelerContent.class), any(Metadata.class), anyString()); when(content.getDefinition()).thenReturn(mock(FormDefinition.class)); Metadata metadata = mock(Metadata.class); formEditorService.copy(path, NEW_FORM_NAME, COMMIT_COMMENT, saveBeforeCopy, content, metadata); verify(formEditorService, saveBeforeCopy ? times(1) : never()).save(eq(path), eq(content), eq(metadata), eq(COMMIT_COMMENT)); verify(copyService).copy(eq(path), eq(NEW_FORM_NAME), eq(COMMIT_COMMENT)); }
@Test public void copyToAnotherPackageWithoutRefactorTest() { makeCopy(false); verify(dataModelerService, never()).refactorClass(eq(PATH), eq(NEW_PACKAGE_NAME), eq(NEW_NAME)); verify(copyService).copy(eq(PATH), eq(NEW_NAME), eq(TARGET_DIRECTORY), eq(COMMENT)); }
@Test public void testCopy() throws Exception { final Path scenarioPath = getEmptyScenarioPath(); final String newFileName = NEW_FILE_NAME; testEditorService.copy(scenarioPath, newFileName, COMMENT); verify(copyService).copy(scenarioPath, newFileName, COMMENT); }