Search in sources :

Example 1 with SourceOrderArray

use of io.atlasmap.java.test.SourceOrderArray in project atlasmap by atlasmap.

the class JavaConstructServiceComplexArrayTest method testConstructSourceOrderArray.

@Test
public void testConstructSourceOrderArray() throws Exception {
    Object targetObject = constructService.constructClass(generateOrderArray("Source"), null);
    assertNotNull(targetObject);
    assertTrue(targetObject instanceof SourceOrderArray);
    SourceOrderArray orderArray = (SourceOrderArray) targetObject;
    assertNotNull(orderArray.getOrders());
    assertTrue(orderArray.getOrders().length > 0);
    for (int i = 0; i < orderArray.getOrders().length; i++) {
        SourceOrder order = (SourceOrder) orderArray.getOrders()[i];
        assertNotNull(order.getAddress());
        assertTrue(order.getAddress() instanceof SourceAddress);
        SourceAddress address = (SourceAddress) order.getAddress();
        assertNull(address.getAddressLine1());
        assertNull(address.getAddressLine2());
        assertNull(address.getCity());
        assertNull(address.getState());
        assertNull(address.getZipCode());
        assertNotNull(order.getContact());
        assertTrue(order.getContact() instanceof SourceContact);
        SourceContact contact = (SourceContact) order.getContact();
        assertNull(contact.getFirstName());
        assertNull(contact.getLastName());
        assertNull(contact.getPhoneNumber());
        assertNull(contact.getZipCode());
    }
}
Also used : SourceAddress(io.atlasmap.java.test.SourceAddress) SourceOrderArray(io.atlasmap.java.test.SourceOrderArray) SourceOrder(io.atlasmap.java.test.SourceOrder) SourceContact(io.atlasmap.java.test.SourceContact) Test(org.junit.Test)

Aggregations

SourceAddress (io.atlasmap.java.test.SourceAddress)1 SourceContact (io.atlasmap.java.test.SourceContact)1 SourceOrder (io.atlasmap.java.test.SourceOrder)1 SourceOrderArray (io.atlasmap.java.test.SourceOrderArray)1 Test (org.junit.Test)1