Assert.assertEquals("Doe", getChildElement(targetMessage, LAST_NAME).getTextContent());
}
@Test
public void testDomContextMapping() throws Exception {
SOAPContextMapper mapper = new SOAPContextMapper();
mapper.setSOAPHeadersType(SOAPHeadersType.DOM);
// test mapFrom
SOAPMessage sourceMessage = newSourceMessage();
Context targetContext = newContext();
mapper.mapFrom(new SOAPBindingData(sourceMessage), targetContext);
Assert.assertEquals("<first xmlns=\"urn:names:1.0\">John</first>", toString((Element)getPropertyValue(targetContext, FIRST_NAME)));
Assert.assertEquals("<last xmlns=\"urn:names:1.0\">Doe</last>", toString((Element)getPropertyValue(targetContext, LAST_NAME)));
// test mapTo
Context sourceContext = newSourceContext();
SOAPMessage targetMesssage = newTargetMessage();
mapper.mapTo(sourceContext, new SOAPBindingData(targetMesssage));
Assert.assertEquals("John", getChildElement(targetMesssage, FIRST_NAME).getTextContent());
Assert.assertEquals("Doe", getChildElement(targetMesssage, LAST_NAME).getTextContent());
}