expect(consumer.receive(anyObject(TestContext.class), anyLong())).andReturn(message);
expect(endpoint.getActor()).andReturn(null).anyTimes();
replay(endpoint, consumer, endpointConfiguration);
PayloadTemplateMessageBuilder controlMessageBuilder = new PayloadTemplateMessageBuilder();
XmlMessageValidationContext validationContext = new XmlMessageValidationContext();
validationContext.setMessageBuilder(controlMessageBuilder);
controlMessageBuilder.setPayloadData("<ns0:root xmlns:ns0='http://citrus/default' xmlns:ns1='http://citrus/ns1' xmlns:ns2='http://citrus/ns2'>"
+ "<ns0:element attributeA='attribute-value' attributeB='attribute-value'>"
+ "<ns0:sub-element attribute='A'>text-value</ns0:sub-element>"
+ "</ns0:element>"
+ "</ns0:root>");
Map<String, String> expectedNamespaces = new HashMap<String, String>();
expectedNamespaces.put("", "http://citrus/default");
expectedNamespaces.put("ns1", "http://citrus/ns1");
expectedNamespaces.put("ns2", "http://citrus/ns2");
validationContext.setControlNamespaces(expectedNamespaces);
validationContext.setSchemaValidation(false);
List<ValidationContext> validationContexts = new ArrayList<ValidationContext>();
validationContexts.add(validationContext);
receiveMessageBean.setValidationContexts(validationContexts);
receiveMessageBean.execute(context);