EasyMock.expect(inMsg.getAttachments()).andReturn(new HashMap<String, Object>());
EasyMock.expect(inMsg.getHeaders()).andReturn(new HashMap<String, Object>());
Source source = new StreamSource(new ByteArrayInputStream(
"<message>TestHelloWorld</message>".getBytes()));
EasyMock.expect(inMsg.getBody(Source.class)).andReturn(source);
EndpointRegistry endpoints = control.createMock(EndpointRegistry.class);
EasyMock.expect(nmr.getEndpointRegistry()).andReturn(endpoints);
EasyMock.expect(nmrTransportFactory.getNmr().getEndpointRegistry()).andReturn(endpoints);
control.replay();
observer = new MessageObserver() {
public void onMessage(Message m) {