use of com.epam.pipeline.entity.metadata.PipeConfValue in project cloud-pipeline by epam.
the class MetadataEntityMapperTest method shouldMapMetadataEntity.
@Test
void shouldMapMetadataEntity() throws IOException {
MetadataEntityMapper mapper = new MetadataEntityMapper();
MetadataClass metadataClass = new MetadataClass(1L, "Sample");
MetadataEntity metadataEntity = new MetadataEntity();
metadataEntity.setClassEntity(metadataClass);
metadataEntity.setId(1L);
metadataEntity.setExternalId("external");
metadataEntity.setParent(new Folder(1L));
metadataEntity.setName(TEST_NAME);
metadataEntity.setData(Collections.singletonMap(TEST_KEY, new PipeConfValue("string", TEST_VALUE)));
EntityContainer<MetadataEntity> container = EntityContainer.<MetadataEntity>builder().entity(metadataEntity).permissions(PERMISSIONS_CONTAINER).build();
XContentBuilder contentBuilder = mapper.map(container);
verifyMetadataEntity(metadataEntity, EXPECTED_METADATA, contentBuilder);
verifyPermissions(PERMISSIONS_CONTAINER, contentBuilder);
}
Aggregations