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