Search in sources :

Example 16 with DefaultExchange

use of org.apache.camel.support.DefaultExchange in project webofneeds by researchstudio-sat.

the class WonMessageSlipComputerTests method testSendMessageFromNode.

@Test
public void testSendMessageFromNode() throws Exception {
    Exchange exchange = new DefaultExchange(new DefaultCamelContext());
    exchange.getIn().setHeader(WonCamelConstants.MESSAGE_HEADER, dummyMessage);
    exchange.getIn().setHeader(WonCamelConstants.MESSAGE_TYPE_HEADER, URI.create(WONMSG.ConnectionMessageString));
    exchange.getIn().setHeader(WonCamelConstants.DIRECTION_HEADER, URI.create(WonMessageDirection.FROM_EXTERNAL.getResource().getURI().toString()));
    exchange.getIn().setHeader(WonCamelConstants.SOCKET_TYPE_URI_HEADER, WXCHAT.ChatSocket.asURI());
    String slip = fixedMessageProcessorSlip.evaluate(exchange, String.class);
    Assert.assertEquals("bean:sendMessageFromNodeProcessor?method=process", slip);
}
Also used : DefaultExchange(org.apache.camel.support.DefaultExchange) Exchange(org.apache.camel.Exchange) DefaultExchange(org.apache.camel.support.DefaultExchange) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) Test(org.junit.Test)

Aggregations

DefaultExchange (org.apache.camel.support.DefaultExchange)16 Exchange (org.apache.camel.Exchange)13 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)10 Test (org.junit.Test)10 URI (java.net.URI)2 WonMessage (won.protocol.message.WonMessage)2 IOException (java.io.IOException)1 java.util (java.util)1 Collectors (java.util.stream.Collectors)1 ServletException (javax.servlet.ServletException)1 CamelContext (org.apache.camel.CamelContext)1 Route (org.apache.camel.Route)1 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)1 HttpConsumer (org.apache.camel.http.common.HttpConsumer)1 HttpMessage (org.apache.camel.http.common.HttpMessage)1 Synchronization (org.apache.camel.spi.Synchronization)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1 AbstractCamelProcessor (won.node.camel.processor.AbstractCamelProcessor)1