mardi 28 juillet 2015

Test Camel Route that starts by waiting for a file to arrive

I have a Camel route that waits for a zip file to be received in a directory. It unzips it and then iterates over the files it contains, parsing their contents before sending them on to one of a number of message queues.

I have got the route to work end to end, but now I want to write unit tests to handle the different cases that might arise. And I'm falling at the first hurdle.

All the unit tests that I have been able to find on the internet seem to start with a message being received by the first component in the route. I need to simulate the existence of a file.

My route is configured in a Spring context file, and I can see that my routes are being adviced ( for example : Adviced endpoint [file:///tmp/dta/xml_source?antInclude=*.zip&move=.done&moveFailed=.error] with mock endpoint [mock:file:/tmp/dta/xml_source] )

I just don't know how to kick it into action.

Aucun commentaire:

Enregistrer un commentaire