Hi All,

Any help is appreciated as i am trying to solve this for 2 days now.

Trying to unit test a CXF end point secured with Spring Authentication. I
tried passing in as below the Authentication header however when it reaches
my CXF Endpoint and down to route. The header is missing.

I tried a lot of combinations and i did read some where that it doesn't
pass it via CXF endpoint. Is this a bug?, that was a post from 2012 though.
any workarounds?.

How should i test my whole integration flow?.


Exchange responseExchange = producerTemplate.request("cxfrs://
http://localhost:9001/";, new Processor() {


    @Override
    public void process(Exchange exchange) throws Exception {


        exchange.setPattern(ExchangePattern.InOut);
        Message inMessage = exchange.getIn();
        inMessage.setHeader("CamelCxfRsUsingHttpAPI", Boolean.TRUE);
        inMessage.setHeader("CamelHttpMethod", "POST");
        inMessage.setHeader("operationName", "getAccounts");
        inMessage.setHeader(Exchange.CONTENT_TYPE,"application/json");
        inMessage.setHeader("CamelAuthentication",subject);
        inMessage.setHeader("CamelHttpPath", "/v1/core/getAccounts");
        inMessage.setBody( new ObjectMapper().writeValueAsString(bo));


*exchange.getIn().setHeader(Exchange.AUTHENTICATION,subject);*
    }
});

Regards,
Aravind

Reply via email to