use of io.atlasmap.java.test.TargetAddress in project atlasmap by atlasmap.
the class JavaConstructServiceComplexArrayTest method testConstructTargetOrderArray.
@Test
public void testConstructTargetOrderArray() throws Exception {
Object targetObject = constructService.constructClass(generateOrderArray("Target"), null);
assertNotNull(targetObject);
assertTrue(targetObject instanceof TargetOrderArray);
TargetOrderArray orderArray = (TargetOrderArray) targetObject;
for (int i = 0; i < orderArray.getOrders().length; i++) {
TargetOrder order = (TargetOrder) orderArray.getOrders()[i];
assertNotNull(order);
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());
}
}
use of io.atlasmap.java.test.TargetAddress in project atlasmap by atlasmap.
the class DocumentJavaFieldWriterTest method testSimpleWrite.
@Test
public void testSimpleWrite() throws Exception {
addClassForFieldPath("/", TargetAddress.class);
write(createField("/addressLine1", "1234 some street."));
write(createField("/addressLine2", "po box wherever"));
write(createField("/city", "Round Rock"));
write(createField("/state", "VA"));
write(createField("/zipCode", "12345-6789"));
TargetAddress o = (TargetAddress) writer.getRootObject();
ensureNotNullAndClass(o, TargetAddress.class);
assertEquals("1234 some street.", o.getAddressLine1());
assertEquals("po box wherever", o.getAddressLine2());
assertEquals("Round Rock", o.getCity());
assertEquals("VA", o.getState());
assertEquals("12345-6789", o.getZipCode());
}
use of io.atlasmap.java.test.TargetAddress 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());
}
use of io.atlasmap.java.test.TargetAddress in project atlasmap by atlasmap.
the class JavaConstructServiceComplexTest method testConstructTargetOrder.
@Test
public void testConstructTargetOrder() throws Exception {
Object targetObject = constructService.constructClass(generateOrder("Target"), null);
assertNotNull(targetObject);
assertTrue(targetObject instanceof TargetOrder);
TargetOrder order = (TargetOrder) targetObject;
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());
}
use of io.atlasmap.java.test.TargetAddress in project atlasmap by atlasmap.
the class JavaConstructServiceComplexTest method testConstructTargetOrderFiltered.
@Test
public void testConstructTargetOrderFiltered() throws Exception {
JavaClass javaClass = generateOrder("Target");
Object targetObject = constructService.constructClass(javaClass, Arrays.asList("address"));
assertNotNull(targetObject);
assertTrue(targetObject instanceof TargetOrder);
TargetOrder order = (TargetOrder) targetObject;
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());
assertNull(order.getContact());
}
Aggregations