Are you sending a Processor across? I've really no idea if that would work or not. It's an object so I suppose if you cast the object on the other side you'd end up with the Processor back(?)
Have you tried on of the methods like producerTemplate.request(endpointURI,body, Map<String,String>) where the map contains the headers? On Mon, Oct 24, 2016 at 9:45 AM, aravind r <[email protected]> wrote: > 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 >
