use of org.eclipse.vorto.mapping.engine.decoder.CSVDeserializer in project vorto by eclipse.
the class DataMapperTest method testStringArrayWithSimpleCondition.
@Test
public void testStringArrayWithSimpleCondition() throws Exception {
IDataMapper mapper = IDataMapper.newBuilder().withSpecification(new SpecWithConditionFunction()).build();
IPayloadDeserializer deserializer = new CSVDeserializer();
InfomodelValue mappedOutput = mapper.mapSource(deserializer.deserialize(",2,3"));
assertNull(mappedOutput.get("button"));
mappedOutput = mapper.mapSource(deserializer.deserialize("1,2,3"));
System.out.println(mappedOutput.get("button").getStatusProperty("sensor_value"));
assertTrue(mappedOutput.get("button").getStatusProperty("sensor_value").isPresent());
}
Aggregations