Hello,
I have a route that looks as follows:
from(uri)
.to("log:input")
.recipientList(simple("direct:${header.operationName}"));
from("direct:lookup")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
// grab parameters from request and set as headers for SQL statement
})
.recipientList(simple("sql:{{sql.lookup}}")).delimiter("false")
.to("log:output")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
List<HashMap> data = (ArrayList<HashMap>) exchange.getIn().getBody();
// convert data to response
exchange.getOut().setBody(response);
})
Is it possible to unit test this route and mock the data returned from the "sql" call? It'd love to be able to verify headers after the first .process, mock the results from the SQL call and verify the results from the 2nd .process method.
All of the routes I've developed with Camel so far make SQL calls, but I see SOAP calls in the future. I'll eventually need to mock SOAP calls as well.
Thanks,
Matt
I have a route that looks as follows:
from(uri)
.to("log:input")
.recipientList(simple("direct:${header.operationName}"));
from("direct:lookup")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
// grab parameters from request and set as headers for SQL statement
})
.recipientList(simple("sql:{{sql.lookup}}")).delimiter("false")
.to("log:output")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
List<HashMap> data = (ArrayList<HashMap>) exchange.getIn().getBody();
// convert data to response
exchange.getOut().setBody(response);
})
Is it possible to unit test this route and mock the data returned from the "sql" call? It'd love to be able to verify headers after the first .process, mock the results from the SQL call and verify the results from the 2nd .process method.
All of the routes I've developed with Camel so far make SQL calls, but I see SOAP calls in the future. I'll eventually need to mock SOAP calls as well.
Thanks,
Matt