Search in sources :

Example 6 with SourceContact

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

the class AtlasMapMultiNSTest method test.

@Test
@DirtiesContext
public void test() throws Exception {
    result.setExpectedCount(1);
    ProducerTemplate producerTemplate = camelContext.createProducerTemplate();
    SourceContact c = new SourceContact();
    c.setFirstName("Jackson");
    producerTemplate.sendBody("direct:start", c);
    MockEndpoint.assertIsSatisfied(camelContext);
    Message message = result.getExchanges().get(0).getIn();
    Assert.assertEquals("application/xml", message.getHeader(Exchange.CONTENT_TYPE));
    String out = message.getBody(String.class);
    Assert.assertNotNull(out);
    Diff d = DiffBuilder.compare(Input.fromString(XML_EXPECTED).build()).withTest(Input.fromString(out).build()).ignoreWhitespace().build();
    Assert.assertFalse(d.toString() + ": " + out, d.hasDifferences());
}
Also used : ProducerTemplate(org.apache.camel.ProducerTemplate) Message(org.apache.camel.Message) Diff(org.xmlunit.diff.Diff) SourceContact(io.atlasmap.java.test.SourceContact) Test(org.junit.Test) DirtiesContext(org.springframework.test.annotation.DirtiesContext)

Example 7 with SourceContact

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

the class ClassHelperTest method testParentObjectForPathParamChecking.

@Test
public void testParentObjectForPathParamChecking() throws Exception {
    assertNull(ClassHelper.parentObjectForPath(null, null, true));
    assertNull(ClassHelper.parentObjectForPath(null, new AtlasPath("foo.bar"), true));
    SourceContact targetObject = new SourceContact();
    Object parentObject = ClassHelper.parentObjectForPath(targetObject, null, true);
    assertNotNull(parentObject);
    assertTrue(parentObject instanceof SourceContact);
    assertEquals(targetObject, parentObject);
}
Also used : AtlasPath(io.atlasmap.core.AtlasPath) SourceContact(io.atlasmap.java.test.SourceContact) Test(org.junit.Test)

Aggregations

SourceContact (io.atlasmap.java.test.SourceContact)7 Test (org.junit.Test)7 SourceAddress (io.atlasmap.java.test.SourceAddress)3 SourceOrder (io.atlasmap.java.test.SourceOrder)3 Message (org.apache.camel.Message)2 ProducerTemplate (org.apache.camel.ProducerTemplate)2 DirtiesContext (org.springframework.test.annotation.DirtiesContext)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 AtlasPath (io.atlasmap.core.AtlasPath)1 SourceOrderArray (io.atlasmap.java.test.SourceOrderArray)1 SourceParentOrder (io.atlasmap.java.test.SourceParentOrder)1 TargetContact (io.atlasmap.java.test.TargetContact)1 JavaClass (io.atlasmap.java.v2.JavaClass)1 XmlContactAttribute (io.atlasmap.xml.test.v2.XmlContactAttribute)1 HashMap (java.util.HashMap)1 Exchange (org.apache.camel.Exchange)1 DefaultMessage (org.apache.camel.impl.DefaultMessage)1 Diff (org.xmlunit.diff.Diff)1