I have a simple Apache Camel RouteBuilder
class that roughly looks like:
from("an FTP server")
// log stuff
.to("direct:split");
from("direct:split")
// split CSV and aggregate the messages into separate files
.to("direct:save");
from("direct:save")
// save the files to a different FTP server
.end();
In tests that I'm going to write though, I want to use pretty much test the direct:split
endpoint only -- I'll load the CSV and save the new CSVs locally, and then write tests to compare the output with what I'd expect the output to be. Would I just rewrite the RouteBuilder
in my tests? Or would I somehow pull in the direct:split
endpoint, and then just specify different starting and ending locations?
You could make some "sub" routes such as:
from("direct:split")
// make two subroutes
.to("direct:splitSubRouteOne")
.to("direct:splitSubRouteTwo");
from("direct:splitSubRouteOne")
// split CSV and aggregate the messages into separate files
// etc
;
from("direct:splitSubRouteTwo")
.to("direct:save");
Then you can test just the portion that you want (presumably) by sending to "direct:splitSubRouteOne" which will test that piece, but not the second piece.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.