AsyncMessageIdExtractor { protected Element getSoapHeaderElement(WebServiceContext context, String headerName) { if (context == null) { return null; } MessageContext mContext = context.getMessageContext(); if (mContext == null) { return null; } return getSoapHeaderFromContext(headerName, mContext); }  String getMessageId(WebServiceContext context); String getOrCreateAsyncMessageId(WebServiceContext context); List<String> getAsyncRelatesTo(WebServiceContext context); String getAction(WebServiceContext context);  }
@Test public void pullsFirstSoapHeader() { List<Header> headers = new ArrayList<>(); Element mockElement = addHeader(headers, "local"); WebServiceContext mockServiceContext = createContextWithHeaders(headers); AsyncMessageIdExtractor extractor = new AsyncMessageIdExtractor(); Element extractedElement = extractor.getSoapHeaderElement(mockServiceContext, "local"); assertSame(mockElement, extractedElement); }