Hi,

I am trying to use camel-cdi-test framework and it is working in all
scenarios i have needed to test so far. However, now i need to send Headers
in as part of my message to a route but when i inspect the Exchange as soon
as it has entered to route (via a logEndpoint) the headers i provided are
not set.

@Inject
private CamelContext context;

@Produce(uri=RequestHandlerConstants.ROUTE_REQUEST_PREVALIDATION)
private ProducerTemplate template;

@Test
public void test() throws Exception {
    String xml = "<test>1<test>";
    Map<String, Object> headers = Maps.newHashMap();
    headers.put("TEST_HEADER","BLAH");
   
template.sendBodyAndHeaders(context.getEndpoint(RequestHandlerConstants.ROUTE_REQUEST_PREVALIDATION),
xml, headers);
}

my route has been simplified for the time being:

from(RequestHandlerConstants.ROUTE_REQUEST_PREVALIDATION)
    .log("------------ Received Message ------------")
    .log("${headers}")
    .to(logEndpoint);

Is anyone able to offer any assistance? Am i missing something obvious?



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-cdi-test-sendBodyAndHeaders-not-sending-headers-tp5781416.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to