use of io.atlasmap.java.test.TargetContact in project atlasmap by atlasmap.
the class JsonJavaCombineTest method testProcessCombineSkip.
@Test
public void testProcessCombineSkip() throws Exception {
AtlasSession session = processCombineMapping("src/test/resources/jsonToJava/atlasmapping-combine-skip.xml", new String(Files.readAllBytes(Paths.get("src/test/resources/jsonToJava/atlas-json-combine.json"))));
TargetContact targetContact = (TargetContact) session.getDefaultTargetDocument();
assertEquals("Ozzie Smith 5551212 81111", targetContact.getFirstName());
assertNull(targetContact.getLastName());
assertNull(targetContact.getPhoneNumber());
assertNull(targetContact.getZipCode());
assertFalse(session.hasErrors());
}
use of io.atlasmap.java.test.TargetContact in project atlasmap by atlasmap.
the class XmlJavaCombineTest method testProcessCombineSkip.
@Test
public void testProcessCombineSkip() throws Exception {
AtlasSession session = processCombineMapping("src/test/resources/xmlToJava/atlasmapping-combine-skip.xml", new String(Files.readAllBytes(Paths.get("src/test/resources/xmlToJava/atlas-xml-combine.xml"))));
TargetContact targetContact = (TargetContact) session.getDefaultTargetDocument();
assertEquals("Ozzie Smith 5551212 81111", targetContact.getFirstName());
assertNull(targetContact.getLastName());
assertNull(targetContact.getPhoneNumber());
assertNull(targetContact.getZipCode());
assertFalse(session.hasErrors());
}
use of io.atlasmap.java.test.TargetContact in project atlasmap by atlasmap.
the class XmlJavaCombineTest method testProcessCombineSimple.
@Test
public void testProcessCombineSimple() throws Exception {
AtlasSession session = processCombineMapping("src/test/resources/xmlToJava/atlasmapping-combine-simple.xml", new String(Files.readAllBytes(Paths.get("src/test/resources/xmlToJava/atlas-xml-combine.xml"))));
TargetContact targetContact = (TargetContact) session.getDefaultTargetDocument();
assertEquals("Ozzie Smith 5551212 81111", targetContact.getFirstName());
assertNull(targetContact.getLastName());
assertNull(targetContact.getPhoneNumber());
assertNull(targetContact.getZipCode());
assertFalse(session.hasErrors());
}
use of io.atlasmap.java.test.TargetContact in project atlasmap by atlasmap.
the class JavaConstructServiceComplexTest method testConstructTargetParentOrder.
@Test
public void testConstructTargetParentOrder() throws Exception {
JavaClass javaClass = generateParentOrder("Target");
Object targetObject = constructService.constructClass(javaClass, null);
assertNotNull(targetObject);
assertTrue(targetObject instanceof TargetParentOrder);
TargetParentOrder parentOrder = (TargetParentOrder) targetObject;
assertNotNull(parentOrder.getOrder());
TargetOrder order = (TargetOrder) parentOrder.getOrder();
assertNotNull(order.getAddress());
assertTrue(order.getAddress() instanceof TargetAddress);
TargetAddress address = (TargetAddress) order.getAddress();
assertNull(address.getAddressLine1());
assertNull(address.getAddressLine2());
assertNull(address.getCity());
assertNull(address.getState());
assertNull(address.getZipCode());
assertNotNull(order.getContact());
assertTrue(order.getContact() instanceof TargetContact);
TargetContact contact = (TargetContact) order.getContact();
assertNull(contact.getFirstName());
assertNull(contact.getLastName());
assertNull(contact.getPhoneNumber());
assertNull(contact.getZipCode());
}
use of io.atlasmap.java.test.TargetContact in project atlasmap by atlasmap.
the class JavaConstructServiceComplexTest method testConstructTargetOrder.
@Test
public void testConstructTargetOrder() throws Exception {
Object targetObject = constructService.constructClass(generateOrder("Target"), null);
assertNotNull(targetObject);
assertTrue(targetObject instanceof TargetOrder);
TargetOrder order = (TargetOrder) targetObject;
assertNotNull(order.getAddress());
assertTrue(order.getAddress() instanceof TargetAddress);
TargetAddress address = (TargetAddress) order.getAddress();
assertNull(address.getAddressLine1());
assertNull(address.getAddressLine2());
assertNull(address.getCity());
assertNull(address.getState());
assertNull(address.getZipCode());
assertNotNull(order.getContact());
assertTrue(order.getContact() instanceof TargetContact);
TargetContact contact = (TargetContact) order.getContact();
assertNull(contact.getFirstName());
assertNull(contact.getLastName());
assertNull(contact.getPhoneNumber());
assertNull(contact.getZipCode());
}
Aggregations