use of io.atlasmap.json.test.TargetContact in project atlasmap by atlasmap.
the class JsonJsonMultiSourceTest method testProcessBasic.
@Test
public void testProcessBasic() throws Exception {
AtlasContext context = atlasContextFactory.createContext(new File("src/test/resources/jsonToJson/atlasmapping-multisource-basic.xml").toURI());
AtlasSession session = context.createSession();
String sourceContact = AtlasTestUtil.loadFileAsString("src/test/resources/jsonToJson/atlas-json-contact-unrooted.json");
String sourceAddress = AtlasTestUtil.loadFileAsString("src/test/resources/jsonToJson/atlas-json-address-unrooted.json");
session.setSourceDocument("con", sourceContact);
session.setSourceDocument("addr", sourceAddress);
context.process(session);
Object object = session.getDefaultTargetDocument();
assertNotNull(object);
assertTrue(object instanceof String);
AtlasJsonTestUnrootedMapper testMapper = new AtlasJsonTestUnrootedMapper();
TargetContact targetContact = testMapper.readValue((String) object, TargetContact.class);
assertEquals("Ozzie", targetContact.getFirstName());
assertNull(targetContact.getLastName());
assertNull(targetContact.getPhoneNumber());
assertEquals("90210", targetContact.getZipCode());
}
Aggregations