use of com.epam.pipeline.controller.vo.DataStorageVO 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.DataStorageVO 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.DataStorageVO in project cloud-pipeline by epam.
the class FolderManagerTest method generateDataStorage.
private void generateDataStorage(Long parentId) {
DataStorageVO dataStorageVO = constructDataStorageVO(generateRandomString(10), TEST_DESCRIPTION, DataStorageType.S3, generateRandomString(10), STS_DURATION, LTS_DURATION, parentId, TEST_MOUNT_POINT, TEST_MOUNT_OPTIONS);
dataStorageManager.create(dataStorageVO, true, true, false);
}
Aggregations