Search in sources :

Example 1 with TargetParentOrder

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());
}
Also used : JavaClass(io.atlasmap.java.v2.JavaClass) TargetContact(io.atlasmap.java.test.TargetContact) TargetAddress(io.atlasmap.java.test.TargetAddress) TargetOrder(io.atlasmap.java.test.TargetOrder) TargetParentOrder(io.atlasmap.java.test.TargetParentOrder) Test(org.junit.Test)

Aggregations

TargetAddress (io.atlasmap.java.test.TargetAddress)1 TargetContact (io.atlasmap.java.test.TargetContact)1 TargetOrder (io.atlasmap.java.test.TargetOrder)1 TargetParentOrder (io.atlasmap.java.test.TargetParentOrder)1 JavaClass (io.atlasmap.java.v2.JavaClass)1 Test (org.junit.Test)1