use of com.epam.pipeline.entity.datastorage.AbstractDataStorage in project cloud-pipeline by epam.
the class DataStorageDaoTest method shouldReturnStorageWithoutParentAsRoot.
@Test
public void shouldReturnStorageWithoutParentAsRoot() {
AbstractDataStorage rootBucket = s3Bucket;
rootBucket.setParentFolderId(null);
dataStorageDao.createDataStorage(rootBucket);
AbstractDataStorage storageInFolder = ObjectCreatorUtils.clone(s3Bucket);
storageInFolder.setParentFolderId(testFolder.getId());
dataStorageDao.createDataStorage(storageInFolder);
assertThat(dataStorageDao.loadRootDataStorages()).hasSize(1).doesNotContain(storageInFolder).contains(rootBucket);
}
use of com.epam.pipeline.entity.datastorage.AbstractDataStorage in project cloud-pipeline by epam.
the class DataStorageDaoTest method shouldLoadExistingNFSStorageById.
@Test
public void shouldLoadExistingNFSStorageById() {
dataStorageDao.createDataStorage(nfsStorage);
AbstractDataStorage loaded = dataStorageDao.loadDataStorage(nfsStorage.getId());
validateNFSStorage(loaded, nfsStorage);
}
use of com.epam.pipeline.entity.datastorage.AbstractDataStorage in project cloud-pipeline by epam.
the class DataStorageDaoTest method shouldNotReturnStorageByPathWithWrongParent.
@Test
public void shouldNotReturnStorageByPathWithWrongParent() {
s3Bucket.setParentFolderId(null);
dataStorageDao.createDataStorage(s3Bucket);
AbstractDataStorage loaded = dataStorageDao.loadDataStorageByNameAndParentId(s3Bucket.getPath(), testFolder.getId());
assertThat(loaded).isNull();
}
use of com.epam.pipeline.entity.datastorage.AbstractDataStorage in project cloud-pipeline by epam.
the class DataStorageDaoTest method shouldReturnStorageByNameAndParent.
@Test
public void shouldReturnStorageByNameAndParent() {
dataStorageDao.createDataStorage(s3Bucket);
AbstractDataStorage loaded = dataStorageDao.loadDataStorageByNameAndParentId(s3Bucket.getName(), testFolder.getId());
validateS3Storage(loaded, s3Bucket);
}
use of com.epam.pipeline.entity.datastorage.AbstractDataStorage in project cloud-pipeline by epam.
the class FolderDaoTest method testCreateAndLoadFolderWithStorages.
@Test
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void testCreateAndLoadFolderWithStorages() {
Folder folder = getFolder();
// add datastorage
AbstractDataStorage storage = addStorage(folder);
Folder loaded = folderDao.loadFolder(folder.getId());
assertEquals(folder.getId(), loaded.getId());
assertEquals(folder.getName(), loaded.getName());
assertNull(folder.getParentId());
checkStorageIsPresent(storage, loaded);
}
Aggregations