camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hadrian Zbarcea (JIRA)" <j...@apache.org>
Subject [jira] Updated: (CAMEL-2061) Make MockEndpoint double as a bean for use in Camel route tests
Date Fri, 21 May 2010 16:19:54 GMT

     [ https://issues.apache.org/activemq/browse/CAMEL-2061?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Hadrian Zbarcea updated CAMEL-2061:
-----------------------------------

    Fix Version/s: 2.3.0
                       (was: 2.4.0)

> Make MockEndpoint double as a bean for use in Camel route tests
> ---------------------------------------------------------------
>
>                 Key: CAMEL-2061
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2061
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0.0
>            Reporter: Chris Purcell
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.3.0
>
>
> The following class turns a MockEndpoint into a very capable bean for use in Camel route
unit tests:
> public class MockEndpointBean extends MockEndpoint {
>     @Handler
>     public void handle(Exchange exchange) throws Exception {
>         onExchange(exchange);
>     }
> }
> If this public method were added to MockEndpont, the subclass would not be necessary.
A Spring Camel route could use the following bean:
>     <bean id="myBean" class="org.apache.camel.component.mock.MockEndpoint" />
> and inject the endpoint into any unit test:
>     @EndpointInject
>     private MockEndpoint myBean;
> and then control the behaviour of the bean like any other MockEndpoint using the powerful
when and assert methods.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message