source: class RelayUtilsTest {
  
      private static final Charset UTF8;
      private final String xml;
      private final QName payloadQName;
       MessageContext msgCtx;
  
      @Test
      public void testBinaryRelayPayloadExpandsToOriginalPayload()
              throws IOException, XMLStreamException {
  
target: 
          // Transform request soap message into a binary payload
          BinaryRelayBuilder builder = new BinaryRelayBuilder();
          InputStream stream = new ReaderInputStream(new StringReader(xml), UTF8);
          OMElement element = builder.processDocument(stream, "text/xml", msgCtx);
          msgCtx.setEnvelope((SOAPEnvelope)element);
  
          // Build message when using pass through pipe or binary relay builder
          RelayUtils.buildMessage(msgCtx);
  
          // Ensure that the binary payload is transformed to the appropriate element
          assertEquals(payloadQName, msgCtx.getEnvelope().getBody().getFirstElement().getQName());
  
          // Ensure that the body isn't fully build to support the use of deferred building
          assertFalse(msgCtx.getEnvelope().getBody().isComplete());
      }
  
  }