return new RouteBuilder() {
public void configure() throws Exception {
from("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
Message input = exchange.getIn().getBody(Message.class);
assertEquals("2.4", input.getVersion());
QRD qrd = (QRD)input.get("QRD");
assertEquals("0101701234", qrd.getWhoSubjectFilter(0).getIDNumber().getValue());
Message response = createHL7AsMessage();
exchange.getOut().setBody(response);
}
})
.to("mock:result");
}