use of org.eclipse.vorto.service.mapping.spec.SpecWithConfiguration2 in project vorto by eclipse.
the class ConfigurationMappingTest method testMapConfigurationSource.
@Test
public void testMapConfigurationSource() throws Exception {
IMappingSpecification spec = new SpecWithConfiguration2();
IDataMapper mapper = IDataMapper.newBuilder().withSpecification(spec).registerConverterFunction(new ClassFunction("button", ConfigurationMappingTest.class)).build();
Map<String, Object> source = new HashMap<String, Object>(1);
source.put("e", true);
InfomodelValue mapped = mapper.mapSource(source);
assertEquals(1, mapped.get("button").getConfiguration().size());
assertEquals(true, mapped.get("button").getConfiguration().get(0).getValue());
}
Aggregations