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("<root xmlns='http://citrus/default' xmlns:ns1='http://citrus/ns1' xmlns:ns2='http://citrus/ns2'>"
+ "<element attributeA='attribute-value' attributeB='attribute-value'>"
+ "<sub-element attribute='A'>text-value</sub-element>"
+ "</element>"
+ "</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");
expectedNamespaces.put("ns4", "http://citrus/ns4");
validationContext.setControlNamespaces(expectedNamespaces);
validationContext.setSchemaValidation(false);
List<ValidationContext> validationContexts = new ArrayList<ValidationContext>();
validationContexts.add(validationContext);
receiveMessageBean.setValidationContexts(validationContexts);
receiveMessageBean.execute(context);