package org.apache.servicemix.camel.nmr;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.Test;
public class NMRBodyTest extends AbstractComponentTest {
@Test
public void noBody() throws Exception {
MockEndpoint result = getMockEndpoint("mock:result");
result.expectedBodiesReceived("Bye World");
sendBody("direct:start", "Hello World");
assertMockEndpointsSatisfied();
}
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:start")
.to("nmr:child")
.to("mock:result");
from("nmr:child")
.setBody(constant("Bye World"));
}
};
}
}