<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:int-http="http://www.springframework.org/schema/integration/http"
			 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
			 xmlns:beans="http://www.springframework.org/schema/beans"
			 xmlns:util="http://www.springframework.org/schema/util"
			 xmlns:int="http://www.springframework.org/schema/integration"
			 xsi:schemaLocation="http://www.springframework.org/schema/beans
			https://www.springframework.org/schema/beans/spring-beans.xsd
			http://www.springframework.org/schema/util
			https://www.springframework.org/schema/util/spring-util.xsd
			http://www.springframework.org/schema/integration
			https://www.springframework.org/schema/integration/spring-integration.xsd
			http://www.springframework.org/schema/integration/http
			https://www.springframework.org/schema/integration/http/spring-integration-http.xsd">

	<!-- Allow Matrix Variables -->
	<beans:bean id="integrationRequestMappingHandlerMapping"
				class="org.springframework.integration.http.inbound.IntegrationRequestMappingHandlerMapping">
		<beans:property name="removeSemicolonContent" value="false"/>
	</beans:bean>

	<int-http:inbound-gateway path="/path1,/path2"
					 request-channel="multiplePathsChannel"/>



	<int:transformer input-channel="multiplePathsChannel"
					expression="T(org.springframework.integration.http.inbound.Int2312RequestMappingIntegrationTests).TEST_STRING_MULTIPLE_PATHS"/>

	<util:constant id="TEST_PATH"
				   static-field="org.springframework.integration.http.inbound.Int2312RequestMappingIntegrationTests.TEST_PATH"/>

	<int-http:inbound-gateway path="#{TEST_PATH}"
					 request-channel="toLowerCaseChannel"
					 payload-expression="#pathVariables.value">
		<int-http:request-mapping headers="toLowerCase"/>

		<int-http:header name="requestAttributes" expression="#requestAttributes"/>
		<int-http:header name="requestParams" expression="#requestParams"/>
		<int-http:header name="requestHeaders" expression="#requestHeaders"/>
		<int-http:header name="matrixVariables" expression="#matrixVariables"/>
		<int-http:header name="cookies" expression="#cookies"/>
	</int-http:inbound-gateway>

	<int:publish-subscribe-channel id="toLowerCaseChannel"/>

	<int:transformer input-channel="toLowerCaseChannel" expression="payload.toLowerCase()"/>

	<int-http:inbound-gateway path="#{TEST_PATH}"
					 request-channel="toUpperCaseChannel"
					 payload-expression="#pathVariables.value">
		<int-http:request-mapping headers="toUpperCase"/>
	</int-http:inbound-gateway>

	<int:transformer input-channel="toUpperCaseChannel" expression="payload.toUpperCase()"/>

	<int-http:inbound-gateway path="/params"
					 request-channel="twoParamsChannel">
		<int-http:request-mapping params="param1,param2"/>
	</int-http:inbound-gateway>

	<int:transformer input-channel="twoParamsChannel" expression="'User=1;account=1'"/>

	<int-http:inbound-gateway path="/params"
					 request-channel="onlyOneParamChannel">
		<int-http:request-mapping params="param1,!param2"/>
	</int-http:inbound-gateway>

	<int:transformer input-channel="onlyOneParamChannel" expression="'User=1'"/>


	<int-http:inbound-gateway path="/consumes"
					 request-channel="consumesNonXmlChannel"
					 supported-methods="GET,PUT">
		<int-http:request-mapping consumes="!text/xml,text/*"/>
	</int-http:inbound-gateway>

	<int:transformer input-channel="consumesNonXmlChannel" expression="'BAR'"/>

	<int-http:inbound-gateway path="/consumes"
					 request-channel="consumesXmlChannel"
					 supported-methods="GET,PUT">
		<int-http:request-mapping consumes="text/xml"/>
	</int-http:inbound-gateway>

	<int:transformer input-channel="consumesXmlChannel" expression="'&lt;test&gt;TEXT_XML&lt;/test&gt;'"/>

	<int-http:inbound-gateway path="/produces"
					 request-channel="contentXmlChannel">
		<int-http:request-mapping produces="application/xml"/>
	</int-http:inbound-gateway>

	<int:transformer input-channel="contentXmlChannel" expression="'&lt;test&gt;XML&lt;/test&gt;'"/>

	<int-http:inbound-gateway path="/produces"
					 request-channel="contentNonXmlChannel">
		<int-http:request-mapping produces="!application/xml"/>
	</int-http:inbound-gateway>

	<int:transformer input-channel="contentNonXmlChannel" expression="'{&quot;json&quot;:&quot;body&quot;}'"/>

</beans:beans>
