As ca camel route is defined by endpoints ( http://camel.apache.org/endpoint.html) where we send or receive messages = exchanges, you should define in your test case some mock endpoints ( http://camel.apache.org/testing.html) which is not the case in your example
On Thu, Jun 19, 2014 at 10:12 AM, Frankiboy <mail.to.fra...@gmail.com> wrote: > All i want is to call a Bean class, with a header and body , and check the > body if its correct when it returns. > > Her is the bean i try to call: > > public Document enrich(@Headers Map<?,?> requestHeaders, Document doc) > throws TransformerException { > > // There is some more code here... > > } > > > This is my test class... Byt get error that endpoint is missing... Is there > a simple example somewhere to call a bean ? > > public class FilterTest extends CamelTestSupport { > > String header = > > "<root><name>abc</name><mainRegistrationNumber>20</mainRegistrationNumber><technicalAddress></technicalAddress></root>"; > > @Test public void testSendMatchingMessage() throws Exception { > String expectedBody = "<matched/>"; > template.sendBodyAndHeader(expectedBody, "header", "header"); > > } > > > @Override protected RouteBuilder createRouteBuilder() { > return new RouteBuilder() { public void configure() { > from("direct:start").bean(AddIpBean.class).to("mock:result"); > } > }; > > } > > } > > Frank > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Test-a-single-Bean-with-CamelTestSupport-tp5752563.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Charles Moulliard Apache Committer / Architect @RedHat Twitter : @cmoulliard | Blog : http://cmoulliard.github.io