QName relatesToQN = new QName(WSAddressingConstants.WSA_NAMESPACE_200408, WSAddressingConstants.EL_RELATES_TO, WSAddressingConstants.WSA_PREFIX);
// create messages and add them to the context
Context msgContext = new Context();
SoapMessage inMessage = new SoapMessage();
SoapMessage outMessage = new SoapMessage();
msgContext.setInMessage(inMessage);
msgContext.setOutMessage(outMessage);
// add wsa MessageID header to in message
String messageId = "uuid:1234567890";
DocumentFragment wsaMessageId = this.handler.createHeader(messageIdQN, messageId);
inMessage.addHeader(messageIdQN, wsaMessageId);
// run handler
this.handler.onReply(msgContext);
// verify relates-to
DocumentFragment wsaRelatesTo = (DocumentFragment) outMessage.getHeaders().get(relatesToQN);
assertNotNull("No RelatesTo header", wsaRelatesTo);
assertEquals("Value", messageId, wsaRelatesTo.getTextContent());
}