Hi Yeah if you have Camel in Action book, read chapter 6.
And see bottom of this page http://camel.apache.org/testing The advice builder is quite nifty and can "rework" the routes before testing. On Wed, Jun 11, 2014 at 8:10 PM, Matt Raible <[email protected]> wrote: > 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 -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
