Green light but i dosent work ?
I Want to go thrue my bean AddIpBean, and give som input and get some
output.
Its not running in a server, i want to test this offline, is this possible ?
I dont go thrue my AddIpBean, what is wrong here ?
public class FilterTest extends CamelTestSupport {
String header =
"<root><name>abc</name><mainRegistrationNumber>20</mainRegistrationNumber><technicalAddress></technicalAddress></root>";
protected MockEndpoint resultEndpoint;
protected ProducerTemplate template;
@Test public void testSendMatchingMessage() throws Exception {
resultEndpoint = context.getEndpoint("mock:result",
MockEndpoint.class);
template = context.createProducerTemplate();
String expectedBody = "<matched/>";
resultEndpoint.expectedBodiesReceived(expectedBody);
template.setDefaultEndpoint(resultEndpoint);
template.sendBodyAndHeader(expectedBody, header, header);
resultEndpoint.assertIsSatisfied();
}
@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-tp5752563p5752577.html
Sent from the Camel - Users mailing list archive at Nabble.com.