Search in sources :

Example 86 with DirtiesContext

use of org.springframework.test.annotation.DirtiesContext 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)

Aggregations

DirtiesContext (org.springframework.test.annotation.DirtiesContext)86 Test (org.junit.Test)83 Exchange (org.apache.camel.Exchange)21 Event (org.opennms.netmgt.xml.event.Event)19 Processor (org.apache.camel.Processor)11 DroolsCorrelationEngine (org.opennms.netmgt.correlation.drools.DroolsCorrelationEngine)10 IOException (java.io.IOException)9 NCSComponent (org.opennms.netmgt.model.ncs.NCSComponent)9 ProducerTemplate (org.apache.camel.ProducerTemplate)7 Ignore (org.junit.Ignore)7 SnmpValue (org.opennms.netmgt.snmp.SnmpValue)6 JsonNode (com.fasterxml.jackson.databind.JsonNode)5 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)5 LinkedHashMap (java.util.LinkedHashMap)5 CommonBindyTest (org.apache.camel.dataformat.bindy.CommonBindyTest)5 FactHandle (org.kie.api.runtime.rule.FactHandle)5 SnmpValueFactory (org.opennms.netmgt.snmp.SnmpValueFactory)5 Message (org.apache.camel.Message)4 BigDecimal (java.math.BigDecimal)3 Registration (org.opennms.core.soa.Registration)3