0
단위 테스트를 위해 낙타 경로를 테스트하고 있습니다. 경로를 성공적으로 호출 한 후 테스트 코드에서 404를 얻고 있습니다. 테스트에서 응답을 읽을 수 없으며 항상 404를 찾지 못합니다. 여기 Camel CXF Junit 테스팅이 404로 실패 함
내 경로가 호출됩니다 그래서<cxf:rsServer id="coreEndPoint" address="http://localhost:9001/v1/core" staticSubresourceResolution="true"
serviceClass="com.incomm.imp.neo.core.incoming.Framework"
loggingFeatureEnabled="true" loggingSizeLimit="20">
<cxf:providers>
<bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider">
</bean>
</cxf:providers>
<cxf:inInterceptors>
<ref bean="loggingInInterceptor"></ref>
</cxf:inInterceptors>
<cxf:outInterceptors>
<ref bean="loggingOutInterceptor"></ref>
</cxf:outInterceptors>
<cxf:features >
<ref bean="swagger2Feature"></ref>
</cxf:features>
</cxf:rsServer>
다음과 같이 정의
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<String, Object> 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);
}
});
내 경로가 내 테스트 코드, 로깅 inteceptor 페이로드와 200 개 성공 기록 그러나 제작자 템플릿이 반환되면 404 예외가 발생합니다.
내가 뭘 잘못하고 있는지 알기!