use of com.epam.pipeline.entity.metadata.FolderWithMetadata in project cloud-pipeline by epam.
the class FolderDaoTest method createObjectMetadata.
private List<FolderWithMetadata> createObjectMetadata(List<Folder> folders) {
Map<String, PipeConfValue> data = new HashMap<>();
data.put(DATA_KEY_1, new PipeConfValue(DATA_TYPE_1, DATA_VALUE_1));
MetadataEntry metadataToSave = new MetadataEntry();
List<FolderWithMetadata> foldersWithMetadata = new ArrayList<>();
folders.forEach(folder -> {
metadataToSave.setEntity(new EntityVO(folder.getId(), AclClass.FOLDER));
metadataToSave.setData(data);
metadataDao.registerMetadataItem(metadataToSave);
FolderWithMetadata folderWithMetadata = convertToFolderWithMetadata(folder);
folderWithMetadata.setData(data);
foldersWithMetadata.add(folderWithMetadata);
});
return foldersWithMetadata;
}
use of com.epam.pipeline.entity.metadata.FolderWithMetadata in project cloud-pipeline by epam.
the class FolderApiServiceTest method createTemplateAndGetProject.
private void createTemplateAndGetProject() {
Folder folder = new Folder();
folder.setName(FOLDER_NAME);
folder.setParentId(parent.getId());
when(folderManager.create(folder)).thenReturn(folder);
folderApiService.create(folder);
when(folderManager.createFromTemplate(anyObject(), anyString())).thenReturn(folder);
folderApiService.createFromTemplate(folder, "template");
FolderWithMetadata folderWithMetadata = new FolderWithMetadata();
folderWithMetadata.setId(parent.getId());
when(folderManager.getProject(anyLong(), anyObject())).thenReturn(folderWithMetadata);
folderApiService.getProject(folderWithMetadata.getId(), AclClass.FOLDER);
}
Aggregations