use of com.epam.pipeline.entity.datastorage.AbstractDataStorage in project cloud-pipeline by epam.
the class DataStorageDaoTest method shouldReturnStorageWithParents.
@Test
public void shouldReturnStorageWithParents() {
Folder childFolder = new Folder();
childFolder.setName("childFolder");
childFolder.setOwner(TEST_OWNER);
childFolder.setParentId(testFolder.getId());
folderDao.createFolder(childFolder);
s3Bucket.setParentFolderId(childFolder.getId());
dataStorageDao.createDataStorage(s3Bucket);
Collection<AbstractDataStorage> storages = dataStorageDao.loadAllWithParents(1, 10);
assertThat(storages).hasSize(1).containsOnly(s3Bucket).extracting(AbstractDataStorage::getParent).containsOnly(childFolder).extracting(Folder::getParent).containsOnly(testFolder);
}
use of com.epam.pipeline.entity.datastorage.AbstractDataStorage in project cloud-pipeline by epam.
the class DataStorageDaoTest method shouldLoadExistingS3StorageByPath.
@Test
public void shouldLoadExistingS3StorageByPath() {
dataStorageDao.createDataStorage(s3Bucket);
AbstractDataStorage loaded = dataStorageDao.loadDataStorageByNameOrPath(TEST_STORAGE_PATH, TEST_STORAGE_PATH);
validateS3Storage(loaded, s3Bucket);
}
use of com.epam.pipeline.entity.datastorage.AbstractDataStorage in project cloud-pipeline by epam.
the class DataStorageDaoTest method shouldReturnStorageByPathAndParent.
@Test
public void shouldReturnStorageByPathAndParent() {
dataStorageDao.createDataStorage(s3Bucket);
AbstractDataStorage loaded = dataStorageDao.loadDataStorageByNameAndParentId(s3Bucket.getPath(), testFolder.getId());
validateS3Storage(loaded, s3Bucket);
}
use of com.epam.pipeline.entity.datastorage.AbstractDataStorage in project cloud-pipeline by epam.
the class FolderDaoTest method testCreateAndLoadFolderWithConfigurations.
@Test
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void testCreateAndLoadFolderWithConfigurations() {
Folder folder = getFolder();
AbstractDataStorage storage = addStorage(folder);
RunConfiguration configuration = addConfiguration(folder);
Folder loaded = folderDao.loadFolder(folder.getId());
assertEquals(folder.getId(), loaded.getId());
assertEquals(folder.getName(), loaded.getName());
assertNull(folder.getParentId());
checkStorageIsPresent(storage, loaded);
checkConfigIsPresent(configuration, loaded);
}
use of com.epam.pipeline.entity.datastorage.AbstractDataStorage in project cloud-pipeline by epam.
the class DataStorageManagerTest method testCreateENSDataStorage.
@Test
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Throwable.class)
public void testCreateENSDataStorage() {
DataStorageVO storageVO = ObjectCreatorUtils.constructDataStorageVO(NAME, DESCRIPTION, DataStorageType.NFS, PATH, WITHOUT_PARENT_ID, TEST_MOUNT_POINT, TEST_MOUNT_OPTIONS);
AbstractDataStorage saved = storageManager.create(storageVO, false, false, false);
AbstractDataStorage loaded = storageManager.load(saved.getId());
compareDataStorage(saved, loaded);
}
Aggregations