diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/UriVariableTests-context.xml b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/UriVariableTests-context.xml
index 8ca7a40357..09516ce8b1 100644
--- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/UriVariableTests-context.xml
+++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/UriVariableTests-context.xml
@@ -10,9 +10,8 @@
-
+
diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/UriVariableTests.java b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/UriVariableTests.java
index 01735eaf9a..99c132053b 100644
--- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/UriVariableTests.java
+++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/UriVariableTests.java
@@ -17,12 +17,13 @@
package org.springframework.integration.ws.config;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
-
+import java.util.concurrent.atomic.AtomicReference;
import javax.jms.BytesMessage;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
@@ -32,26 +33,34 @@ import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
+import org.hamcrest.Matchers;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.packet.Packet;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+import org.springframework.beans.DirectFieldAccessor;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.Message;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.MessageHandlingException;
+import org.springframework.integration.core.MessageHandler;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.integration.test.util.TestUtils;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.ws.client.WebServiceClientException;
import org.springframework.ws.client.WebServiceIOException;
-import org.springframework.ws.client.WebServiceTransportException;
+import org.springframework.ws.client.core.WebServiceMessageCallback;
+import org.springframework.ws.client.core.WebServiceMessageExtractor;
+import org.springframework.ws.client.core.WebServiceTemplate;
import org.springframework.ws.client.support.interceptor.ClientInterceptor;
import org.springframework.ws.context.MessageContext;
-import org.springframework.ws.soap.SoapMessageCreationException;
import org.springframework.ws.transport.WebServiceConnection;
import org.springframework.ws.transport.WebServiceMessageSender;
import org.springframework.ws.transport.context.TransportContext;
@@ -67,6 +76,10 @@ import org.springframework.ws.transport.mail.MailSenderConnection;
@ContextConfiguration
public class UriVariableTests {
+ @Autowired
+ @Qualifier("httpOutboundGateway.handler")
+ private MessageHandler httpOutboundGateway;
+
@Autowired
private TestClientInterceptor interceptor;
@@ -95,7 +108,24 @@ public class UriVariableTests {
private Int2720EmailTestClientInterceptor emailInterceptor;
@Test
+ @SuppressWarnings("unchecked")
public void testHttpUriVariables() {
+ WebServiceTemplate webServiceTemplate = TestUtils.getPropertyValue(this.httpOutboundGateway, "webServiceTemplate", WebServiceTemplate.class);
+ webServiceTemplate = Mockito.spy(webServiceTemplate);
+ final AtomicReference uri = new AtomicReference();
+ Mockito.doAnswer(new Answer