use of de.fraunhofer.iosb.ilt.faaast.service.model.value.BlobValue in project FAAAST-Service by FraunhoferIOSB.
the class ElementValueMapperTest method testBlobSetValueMapping.
@Test
public void testBlobSetValueMapping() {
SubmodelElement actual = new DefaultBlob.Builder().build();
BlobValue value = BlobValue.builder().mimeType("application/json").value("foo").build();
SubmodelElement expected = new DefaultBlob.Builder().mimeType(value.getMimeType()).value(value.getValue()).build();
ElementValueMapper.setValue(actual, value);
Assert.assertEquals(expected, actual);
}
use of de.fraunhofer.iosb.ilt.faaast.service.model.value.BlobValue in project FAAAST-Service by FraunhoferIOSB.
the class BlobValueMapper method toValue.
@Override
public BlobValue toValue(Blob submodelElement) {
if (submodelElement == null) {
return null;
}
BlobValue blobValue = new BlobValue();
blobValue.setValue(submodelElement.getValue());
blobValue.setMimeType(submodelElement.getMimeType());
return blobValue;
}
use of de.fraunhofer.iosb.ilt.faaast.service.model.value.BlobValue in project FAAAST-Service by FraunhoferIOSB.
the class ElementValueMapperTest method testBlobToValueMapping.
@Test
public void testBlobToValueMapping() {
BlobValue expected = BlobValue.builder().mimeType("application/json").value("foo").build();
SubmodelElement input = new DefaultBlob.Builder().mimeType(expected.getMimeType()).value(expected.getValue()).build();
ElementValue actual = ElementValueMapper.toValue(input);
Assert.assertEquals(expected, actual);
}
Aggregations