INT-1207 added support for the "http-method" attribute on <outbound-gateway> and <outbound-channel-adapter> elements in the http namespace
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
<outbound-channel-adapter id="fullConfig"
|
||||
url="http://localhost/test2"
|
||||
http-method="GET"
|
||||
channel="requests"
|
||||
charset="UTF-8"
|
||||
extract-payload="false"
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.springframework.beans.DirectFieldAccessor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.client.ClientHttpRequestFactory;
|
||||
import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
||||
import org.springframework.integration.endpoint.AbstractEndpoint;
|
||||
@@ -69,6 +70,7 @@ public class HttpOutboundChannelAdapterParserTests {
|
||||
assertTrue(requestFactory instanceof SimpleClientHttpRequestFactory);
|
||||
DirectFieldAccessor mapperAccessor = new DirectFieldAccessor(mapper);
|
||||
assertEquals("http://localhost/test1", handlerAccessor.getPropertyValue("uri"));
|
||||
assertEquals(HttpMethod.POST, handlerAccessor.getPropertyValue("httpMethod"));
|
||||
assertEquals("UTF-8", mapperAccessor.getPropertyValue("charset"));
|
||||
assertEquals(true, mapperAccessor.getPropertyValue("extractPayload"));
|
||||
}
|
||||
@@ -93,6 +95,7 @@ public class HttpOutboundChannelAdapterParserTests {
|
||||
assertEquals(requestFactoryBean, requestFactory);
|
||||
DirectFieldAccessor mapperAccessor = new DirectFieldAccessor(mapper);
|
||||
assertEquals("http://localhost/test2", handlerAccessor.getPropertyValue("uri"));
|
||||
assertEquals(HttpMethod.GET, handlerAccessor.getPropertyValue("httpMethod"));
|
||||
assertEquals("UTF-8", mapperAccessor.getPropertyValue("charset"));
|
||||
assertEquals(false, mapperAccessor.getPropertyValue("extractPayload"));
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
<outbound-gateway id="fullConfig"
|
||||
url="http://localhost/test2"
|
||||
http-method="PUT"
|
||||
request-channel="requests"
|
||||
request-factory="testRequestFactory"
|
||||
request-timeout="1234"
|
||||
|
||||
@@ -28,6 +28,7 @@ import org.springframework.beans.DirectFieldAccessor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.client.ClientHttpRequestFactory;
|
||||
import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
||||
import org.springframework.integration.core.MessageChannel;
|
||||
@@ -73,6 +74,7 @@ public class HttpOutboundGatewayParserTests {
|
||||
assertTrue(requestFactory instanceof SimpleClientHttpRequestFactory);
|
||||
DirectFieldAccessor mapperAccessor = new DirectFieldAccessor(mapper);
|
||||
assertEquals("http://localhost/test1", handlerAccessor.getPropertyValue("uri"));
|
||||
assertEquals(HttpMethod.POST, handlerAccessor.getPropertyValue("httpMethod"));
|
||||
assertEquals("UTF-8", mapperAccessor.getPropertyValue("charset"));
|
||||
assertEquals(true, mapperAccessor.getPropertyValue("extractPayload"));
|
||||
}
|
||||
@@ -98,6 +100,7 @@ public class HttpOutboundGatewayParserTests {
|
||||
assertTrue(requestFactory instanceof SimpleClientHttpRequestFactory);
|
||||
DirectFieldAccessor mapperAccessor = new DirectFieldAccessor(mapper);
|
||||
assertEquals("http://localhost/test2", handlerAccessor.getPropertyValue("uri"));
|
||||
assertEquals(HttpMethod.PUT, handlerAccessor.getPropertyValue("httpMethod"));
|
||||
assertEquals("UTF-8", mapperAccessor.getPropertyValue("charset"));
|
||||
assertEquals(false, mapperAccessor.getPropertyValue("extractPayload"));
|
||||
Object requestFactoryBean = this.applicationContext.getBean("testRequestFactory");
|
||||
|
||||
Reference in New Issue
Block a user