use of org.eclipse.vorto.service.mapping.spec.SpecWithConditionFunction in project vorto by eclipse.
the class JsonMappingTest method testMapWithCustomFunctionCondition.
@Test
public void testMapWithCustomFunctionCondition() throws Exception {
IDataMapper<DittoData> mapper = IDataMapper.newBuilder().withSpecification(new SpecWithConditionFunction()).buildDittoMapper();
String json = "{\"data\" : \"aGFsbG8=\"}";
DittoData mappedDittoOutput = mapper.map(DataInput.newInstance().fromJson(json), MappingContext.empty());
assertEquals("hallo", mappedDittoOutput.getFeatures().get("button").getStatusProperties().get("sensor_value"));
}
Aggregations