In the below snippet:
After the process block is done, the results are sent back to the caller.
How can I test this code snippet for the returned result?
In examples I've seen, tests generally follow the form of from().process().to(). With that format, I can test what comes from the process block easily.
You can use the producerTemplate API to send a request to the "direct:beginning" endpoint , and check the response as you want.
ProducerTemplate template = camelContext.createProducerTemplate(); Object response = template.requestBody(request); ......