use of com.epam.pipeline.controller.vo.configuration.RunConfigurationVO in project cloud-pipeline by epam.
the class ObjectCreatorUtils method createRunConfigurationVO.
public static RunConfigurationVO createRunConfigurationVO(String name, String description, Long parentFolderId, List<AbstractRunConfigurationEntry> entries) {
RunConfigurationVO runConfigurationVO = new RunConfigurationVO();
runConfigurationVO.setName(name);
runConfigurationVO.setDescription(description);
runConfigurationVO.setParentId(parentFolderId);
runConfigurationVO.setEntries(entries);
return runConfigurationVO;
}
use of com.epam.pipeline.controller.vo.configuration.RunConfigurationVO in project cloud-pipeline by epam.
the class FolderManagerTest method shouldCloneWithRunConfiguration.
@Test
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void shouldCloneWithRunConfiguration() {
Folder sourceFolder = new Folder();
sourceFolder.setName(FOLDER_TO_CLONE);
folderManager.create(sourceFolder);
PipelineConfiguration pipelineConfiguration = new PipelineConfiguration();
pipelineConfiguration.setCmdTemplate(TEST_NAME);
RunConfigurationEntry entry = createConfigEntry(TEST_NAME, true, pipelineConfiguration);
RunConfigurationVO runConfigurationVO = createRunConfigurationVO(TEST_NAME, TEST_DESCRIPTION, sourceFolder.getId(), Collections.singletonList(entry));
RunConfiguration expectedRunConfiguration = runConfigurationManager.create(runConfigurationVO);
Folder childSourceFolder = new Folder();
childSourceFolder.setName(CHILD_FOLDER_TO_CLONE);
childSourceFolder.setParentId(sourceFolder.getId());
folderManager.create(childSourceFolder);
runConfigurationVO.setParentId(childSourceFolder.getId());
runConfigurationManager.create(runConfigurationVO);
Folder destinationFolder = new Folder();
destinationFolder.setName(TEST_NAME);
folderManager.create(destinationFolder);
folderManager.cloneFolder(sourceFolder.getId(), destinationFolder.getId(), TEST_CLONE_PREFIX);
destinationFolder = folderManager.loadByNameOrId(TEST_NAME);
destinationFolder = folderManager.load(destinationFolder.getId());
Folder clonedFolder = destinationFolder.getChildFolders().get(0);
RunConfiguration clonedRunConfiguration = runConfigurationManager.loadAll().stream().filter(conf -> Objects.equals(conf.getParent().getId(), clonedFolder.getId())).collect(Collectors.toList()).get(0);
assertRunConfiguration(expectedRunConfiguration, clonedRunConfiguration);
Folder clonedChildFolder = clonedFolder.getChildFolders().get(0);
clonedRunConfiguration = runConfigurationManager.loadAll().stream().filter(conf -> Objects.equals(conf.getParent().getId(), clonedChildFolder.getId())).collect(Collectors.toList()).get(0);
assertRunConfiguration(expectedRunConfiguration, clonedRunConfiguration);
}
Aggregations