use of com.epam.pipeline.controller.vo.PipelineVO in project cloud-pipeline by epam.
the class ObjectCreatorUtils method constructPipelineVO.
public static PipelineVO constructPipelineVO(String name, String repo, Long parentFolderId) {
PipelineVO pipeline = new PipelineVO();
pipeline.setName(name);
pipeline.setRepository(repo);
pipeline.setParentFolderId(parentFolderId);
return pipeline;
}
use of com.epam.pipeline.controller.vo.PipelineVO in project cloud-pipeline by epam.
the class FolderManagerTest method deleteFolderWithPipeline.
@Test(expected = IllegalArgumentException.class)
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void deleteFolderWithPipeline() throws Exception {
folderManager.create(folder);
PipelineVO pipeline = constructPipelineVO(TEST_NAME, TEST_REPO, folder.getId());
pipelineManager.create(pipeline);
folderManager.delete(folder.getId());
}
use of com.epam.pipeline.controller.vo.PipelineVO in project cloud-pipeline by epam.
the class FolderManagerTest method loadFolderWithPipelineAndStorage.
@Test
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void loadFolderWithPipelineAndStorage() throws Exception {
folderManager.create(folder);
PipelineVO pipelineVO = constructPipelineVO(TEST_NAME, TEST_REPO, folder.getId());
DataStorageVO storageVO = constructDataStorageVO(TEST_NAME, TEST_DESCRIPTION, DataStorageType.S3, TEST_PATH, STS_DURATION, LTS_DURATION, folder.getId(), TEST_MOUNT_POINT, TEST_MOUNT_OPTIONS);
Pipeline pipeline = pipelineManager.create(pipelineVO);
AbstractDataStorage storage = dataStorageManager.create(storageVO, false, false, false);
Folder loaded = folderManager.load(folder.getId());
Pipeline loadedPipe = loaded.getPipelines().get(0);
assertNotNull(loadedPipe);
assertEquals(pipeline.getId(), loadedPipe.getId());
assertEquals(pipeline.getName(), loadedPipe.getName());
assertEquals(pipeline.getParentFolderId(), loadedPipe.getParentFolderId());
AbstractDataStorage loadedStorage = loaded.getStorages().get(0);
assertNotNull(loadedStorage);
assertEquals(storage.getId(), loadedStorage.getId());
assertEquals(storage.getName(), loadedStorage.getName());
assertEquals(storage.getParentFolderId(), loadedStorage.getParentFolderId());
}
use of com.epam.pipeline.controller.vo.PipelineVO in project cloud-pipeline by epam.
the class FolderManagerTest method deleteFolderAfterMovingPipelineAndStorage.
@Test
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void deleteFolderAfterMovingPipelineAndStorage() throws Exception {
folderManager.create(folder);
PipelineVO pipelineVO = constructPipelineVO(TEST_NAME, TEST_REPO, folder.getId());
DataStorageVO storageVO = constructDataStorageVO(TEST_NAME, TEST_DESCRIPTION, DataStorageType.S3, TEST_PATH, STS_DURATION, LTS_DURATION, folder.getId(), TEST_MOUNT_POINT, TEST_MOUNT_OPTIONS);
Pipeline pipeline = pipelineManager.create(pipelineVO);
AbstractDataStorage storage = dataStorageManager.create(storageVO, false, false, false);
pipelineVO.setId(pipeline.getId());
pipelineVO.setParentFolderId(null);
pipelineManager.update(pipelineVO);
storageVO.setParentFolderId(null);
storageVO.setId(storage.getId());
dataStorageManager.update(storageVO);
folderManager.delete(folder.getId());
}
use of com.epam.pipeline.controller.vo.PipelineVO in project cloud-pipeline by epam.
the class FolderManagerTest method deleteFolderWithChildrenForce.
@Test
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void deleteFolderWithChildrenForce() throws Exception {
folderManager.create(subFolder);
folder.setParent(subFolder);
folderManager.create(folder);
PipelineVO pipeline1 = constructPipelineVO(TEST_NAME, TEST_REPO, folder.getId());
pipelineManager.create(pipeline1);
generateDataStorage(folder.getId());
PipelineVO pipeline2 = constructPipelineVO(TEST_NAME, TEST_REPO, subFolder.getId());
pipelineManager.create(pipeline2);
generateDataStorage(subFolder.getId());
folderManager.deleteForce(folder.getId());
}
Aggregations