Search in sources :

Example 1 with SourceOrderList

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

the class JavaConstructServiceComplexListTest method testConstructSourceOrderList.

@Test
public void testConstructSourceOrderList() throws Exception {
    Object targetObject = constructService.constructClass(generateOrderList("Source"), null);
    assertNotNull(targetObject);
    assertTrue(targetObject instanceof SourceOrderList);
    SourceOrderList orderList = (SourceOrderList) targetObject;
    assertNotNull(orderList.getOrders());
    assertTrue(orderList.getOrders().isEmpty());
    assertNull(orderList.getNumberOrders());
    assertNull(orderList.getOrderBatchNumber());
}
Also used : SourceOrderList(io.atlasmap.java.test.SourceOrderList) Test(org.junit.Test)

Example 2 with SourceOrderList

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

the class ClassHelperTest method testParentObjectForPathList.

@Test
public void testParentObjectForPathList() throws Exception {
    SourceOrderList sourceOrderList = new SourceOrderList();
    List<BaseOrder> sourceOrders = new ArrayList<>();
    sourceOrderList.setOrders(sourceOrders);
    SourceAddress sourceAddress = new SourceAddress();
    SourceOrder sourceOrder = new SourceOrder();
    sourceOrder.setAddress(sourceAddress);
    sourceOrderList.getOrders().add(sourceOrder);
    Object parentObject = ClassHelper.parentObjectForPath(sourceOrderList, new AtlasPath("orders<>"), true);
    assertNotNull(parentObject);
    assertTrue(parentObject instanceof List<?>);
    assertEquals(sourceOrders, parentObject);
}
Also used : SourceAddress(io.atlasmap.java.test.SourceAddress) BaseOrder(io.atlasmap.java.test.BaseOrder) ArrayList(java.util.ArrayList) SourceOrder(io.atlasmap.java.test.SourceOrder) AtlasPath(io.atlasmap.core.AtlasPath) SourceOrderList(io.atlasmap.java.test.SourceOrderList) Test(org.junit.Test)

Aggregations

SourceOrderList (io.atlasmap.java.test.SourceOrderList)2 Test (org.junit.Test)2 AtlasPath (io.atlasmap.core.AtlasPath)1 BaseOrder (io.atlasmap.java.test.BaseOrder)1 SourceAddress (io.atlasmap.java.test.SourceAddress)1 SourceOrder (io.atlasmap.java.test.SourceOrder)1 ArrayList (java.util.ArrayList)1