title: Camel CXF Junit Testing failing with 404
body: <p>I am trying to Unit test my camel route and i am getting a 404 from test code after a successful invocation of route, meaning am not able to read response from test, always throws 404 not found</p>
  
  <p>Here is my test code</p>
  
  <pre><code>    final Exchange send = template.send("cxfrs://http://localhost:9001/v1/core/handshake", new Processor() {
          public void process(Exchange exchange) throws Exception {
              exchange.setPattern(ExchangePattern.OutOnly);
              Message inMessage = exchange.getIn();
              //  setupDestinationURL(inMessage);
  
              final String uuid = UUID.randomUUID().toString().replace("-", "");
              System.out.println("uuid = " + uuid);
  
              final GenerateTestHeaders headerGenerator = new GenerateTestHeaders();
              final Map&lt;String, Object&gt; outboundHeaderMap = headerGenerator.getOutboundHeaderMap(API_KEY, ACCESS_ID, PRIVATE_ACCESS_KEY, "utf-8", "POST", "2016-08-31T10:40:55.979-0400", uuid);
  
              // set a customer header
              inMessage.setHeaders(outboundHeaderMap);
  
              // using the http central client API
              inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_USING_HTTP_API, Boolean.TRUE);
  
              inMessage.setHeader("HOST", "localhost:9001");
  
              // set the Http method
              inMessage.setHeader(Exchange.HTTP_METHOD, "POST");
  
              // set the operation name
              inMessage.setHeader(CxfConstants.OPERATION_NAME, "handshake");
  
              inMessage.setHeader(Exchange.ACCEPT_CONTENT_TYPE, "application/json");
  
              // set the relative path
              // inMessage.setHeader(Exchange.HTTP_PATH, "/IMP/v1/core/handshake");
  
              // Specify the response class , cxfrs will use InputStream as the response object type
              inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS, HandshakeResponse.class);
  
              // since we use the Get method, so we don't need to set the message body
              inMessage.setBody(null);
  
  
          }
      });
  </code></pre>
  
  <p>My Route is defines as below</p>
  
  <pre><code>&lt;cxf:rsServer id="coreEndPoint" address="http://localhost:9001/v1/core" staticSubresourceResolution="true"
                serviceClass="com.incomm.imp.neo.core.incoming.Framework"
                loggingFeatureEnabled="true" loggingSizeLimit="20"&gt;
      &lt;cxf:providers&gt;
          &lt;bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider"&gt;
          &lt;/bean&gt;
      &lt;/cxf:providers&gt;
      &lt;cxf:inInterceptors&gt;
          &lt;ref bean="loggingInInterceptor"&gt;&lt;/ref&gt;
      &lt;/cxf:inInterceptors&gt;
      &lt;cxf:outInterceptors&gt;
  
          &lt;ref bean="loggingOutInterceptor"&gt;&lt;/ref&gt;
      &lt;/cxf:outInterceptors&gt;
       &lt;cxf:features &gt;
          &lt;ref bean="swagger2Feature"&gt;&lt;/ref&gt;
      &lt;/cxf:features&gt;
  &lt;/cxf:rsServer&gt;
  </code></pre>
  
  <p>So my route gets invoked, The logging inteceptor logs a 200 Success with payload however when producer template is returned it has 404 Exception.</p>
  
  <p>Any idea what i am doing wrong?.</p>