camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From idioma <>
Subject Help in testing a custom processor
Date Wed, 09 Nov 2016 08:19:13 GMT
I have the following route:

<camelContext xmlns="">
            <from uri="activemq:topic:inbox" />
            <log message="To: ${in.header.recipients}" />
            <to uri="bean:myLogger" />

bean:myLogger is my custom processor for formatting the log messages I am
getting. The process method in my custom processor simply calls a private
method that appends the type of message (e.g. CC) and the recipients' email.
I am struggling to see how to test the actual resulting logs. I am using
CamelSpringTestSupportand I am OK when it comes to testing the myLogger

@Produce(uri = "activemq:topic:inbox")
    protected ProducerTemplate template;

    protected AbstractApplicationContext createApplicationContext() {
        return new

        public void testLogEndpoint() throws Exception {
            String body = "Hello World";
            template.sendBody("activemq:topic:inbox", body);
  "This is the message body we sent {} ", body);
However, I am not really sure how to test the format of the returned logs.
Do I send the email of the recipients in a similar fashion as the example
above? But then how do I check whether the format is the correct one? I am
really looking more for the approach than the actual solution.

Thank you so much for your help,

View this message in context:
Sent from the Camel Development mailing list archive at

View raw message