@Test
  @SuppressWarnings("rawtypes")
  public void testSoapMessageWithAttachmentResourceVariablesSupportTest() throws Exception {
    SendSoapMessageAction soapMessageAction = new SendSoapMessageAction();
    soapMessageAction.setMessageSender(messageSender);

    PayloadTemplateMessageBuilder messageBuilder = new PayloadTemplateMessageBuilder();
    messageBuilder.setPayloadData("<TestRequest><Message>Hello World!</Message></TestRequest>");

    context.setVariable("myText", "Hello World!");

    soapMessageAction.setAttachmentResource(
        new ClassPathResource(
            "test-attachment-with-variables.xml", SendSoapMessageActionTest.class));

    soapMessageAction.setMessageBuilder(messageBuilder);

    reset(messageSender);

    messageSender.send((Message) anyObject(), (Attachment) anyObject());
    expectLastCall()
        .andAnswer(
            new IAnswer<Object>() {
              public Object answer() throws Throwable {
                SoapAttachment constructedAttachment =
                    (SoapAttachment) EasyMock.getCurrentArguments()[1];
                Assert.assertNull(constructedAttachment.getContentId());
                Assert.assertEquals(constructedAttachment.getContentType(), "text/plain");
                Assert.assertEquals(
                    constructedAttachment.getContent(),
                    "<TestAttachment><Message>Hello World!</Message></TestAttachment>");
                Assert.assertEquals(constructedAttachment.getCharsetName(), "UTF-8");

                return null;
              }
            })
        .once();

    replay(messageSender);

    soapMessageAction.execute(context);

    verify(messageSender);
  }