XPathParamAnnotationMethodEndpointAdapter extends AbstractMethodEndpointAdapter implements InitializingBean { public void setNamespaces(Map<String, String> namespaces) { this.namespaces = namespaces; }  void setNamespaces(Map<String, String> namespaces); @Override void afterPropertiesSet();  }
@Test public void testInvokeVoidDom() throws Exception { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactoryUtils.newInstance(); DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); Document document = documentBuilder.newDocument(); String rootNamespace = "http: Element rootElement = document.createElementNS(rootNamespace, "root"); document.appendChild(rootElement); String childNamespace = "http: Element first = document.createElementNS(childNamespace, "child"); rootElement.appendChild(first); Text text = document.createTextNode("value"); first.appendChild(text); Element second = document.createElementNS(rootNamespace, "other-child"); rootElement.appendChild(second); text = document.createTextNode("other-value"); second.appendChild(text); WebServiceMessage requestMock = createMock(WebServiceMessage.class); expect(requestMock.getPayloadSource()).andReturn(new DOMSource(first)); WebServiceMessageFactory factoryMock = createMock(WebServiceMessageFactory.class); replay(requestMock, factoryMock); Map<String, String> namespaces = new HashMap<String, String>(); namespaces.put("root", rootNamespace); namespaces.put("child", childNamespace); adapter.setNamespaces(namespaces); MessageContext messageContext = new DefaultMessageContext(requestMock, factoryMock); MethodEndpoint endpoint = new MethodEndpoint(this, "namespaces", new Class[] { Node.class }); adapter.invoke(messageContext, endpoint); Assert.assertTrue("Method not invoked", namespacesInvoked); }