Search in sources :

Example 6 with SourceAddress

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

the class JavaConstructServiceSimpleTest method testConstructSourceAddress.

@Test
public void testConstructSourceAddress() throws Exception {
    Object targetObject = constructService.constructClass(generateJavaClass("io.atlasmap.java.test.SourceAddress"), null);
    assertNotNull(targetObject);
    assertTrue(targetObject instanceof io.atlasmap.java.test.SourceAddress);
    SourceAddress source = (SourceAddress) targetObject;
    assertNull(source.getAddressLine1());
    assertNull(source.getAddressLine2());
    assertNull(source.getCity());
    assertNull(source.getState());
    assertNull(source.getZipCode());
}
Also used : SourceAddress(io.atlasmap.java.test.SourceAddress) SourceAddress(io.atlasmap.java.test.SourceAddress) Test(org.junit.Test)

Example 7 with SourceAddress

use of io.atlasmap.java.test.SourceAddress 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

SourceAddress (io.atlasmap.java.test.SourceAddress)7 Test (org.junit.Test)7 SourceOrder (io.atlasmap.java.test.SourceOrder)6 AtlasPath (io.atlasmap.core.AtlasPath)3 SourceContact (io.atlasmap.java.test.SourceContact)3 SourceParentOrder (io.atlasmap.java.test.SourceParentOrder)2 BaseOrder (io.atlasmap.java.test.BaseOrder)1 SourceOrderArray (io.atlasmap.java.test.SourceOrderArray)1 SourceOrderList (io.atlasmap.java.test.SourceOrderList)1 JavaClass (io.atlasmap.java.v2.JavaClass)1 ArrayList (java.util.ArrayList)1