use of io.atlasmap.java.test.TargetParentOrder 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());
}
Aggregations