<?xml version="1.0" encoding="UTF-8"?>
<beans:beans
		xmlns="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:si="http://www.springframework.org/schema/integration"
		xmlns:util="http://www.springframework.org/schema/util"
		xsi:schemaLocation="http://www.springframework.org/schema/beans
			https://www.springframework.org/schema/beans/spring-beans.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
			http://www.springframework.org/schema/util
			https://www.springframework.org/schema/util/spring-util.xsd">

	<si:message-history/>

	<si:channel id="requests">
		<si:queue capacity="1"/>
	</si:channel>

	<beans:bean id="validator" class="org.mockito.Mockito" factory-method="mock">
		<beans:constructor-arg value="org.springframework.validation.Validator" type="java.lang.Class"/>
	</beans:bean>

	<inbound-channel-adapter id="defaultAdapter" channel="requests" error-channel="errorChannel"
							 auto-startup="false"
							 phase="1001"
							 status-code-expression="'101'"
							 validator="validator"/>

	<inbound-channel-adapter id="postOnlyAdapter" path="/postOnly" channel="requests" supported-methods="POST"/>

	<inbound-channel-adapter id="adapterWithCustomConverterWithDefaults" message-converters="customConverters"
							 channel="requests" supported-methods="DELETE" merge-with-default-converters="true"/>

	<inbound-channel-adapter id="adapterWithCustomConverterNoDefaults" message-converters="customConverters"
							 channel="requests" supported-methods="HEAD"/>

	<inbound-channel-adapter id="adapterNoCustomConverterNoDefaults" channel="requests" supported-methods="POST"/>

	<util:list id="customConverters">
		<beans:bean class="org.springframework.integration.http.converter.SerializingHttpMessageConverter"/>
	</util:list>

	<inbound-channel-adapter id="putOrDeleteAdapter" channel="requests" supported-methods="PUT, delete"/>

	<inbound-channel-adapter id="inboundController" channel="requests" view-name="foo" error-code="oops"
							 status-code-expression="T(org.springframework.http.HttpStatus).ACCEPTED">
		<request-mapping headers="BAR"/>
	</inbound-channel-adapter>

	<inbound-channel-adapter id="inboundControllerViewExp" channel="requests" view-expression="'foo'">
		<request-mapping headers="BAR2"/>
	</inbound-channel-adapter>

	<inbound-channel-adapter id="withMappedHeaders" channel="requests"
							 mapped-request-headers="foo,bar">
		<request-mapping headers="foo=bar"/>
	</inbound-channel-adapter>

	<inbound-channel-adapter id="inboundAdapterWithExpressions"
							 path="/fname/{f}/lname/{l}"
							 channel="requests"
							 mapped-request-headers="foo,bar"
							 payload-expression="#pathVariables.f">
		<header name="lname" expression="#pathVariables.l"/>
	</inbound-channel-adapter>

	<inbound-channel-adapter channel="requests"
							 mapped-request-headers="foo,bar"
							 payload-expression="#pathVariables.f">
		<request-mapping headers="invalid"/>
		<header name="lname" expression="#pathVariables.l"/>
	</inbound-channel-adapter>

	<inbound-channel-adapter id="autoChannel"
							 path="/fname/{f}/lname2/{l}"
							 mapped-request-headers="foo,bar"
							 payload-expression="#pathVariables.f">
		<header name="lname" expression="#pathVariables.l"/>
	</inbound-channel-adapter>

	<si:bridge input-channel="autoChannel" output-channel="nullChannel"/>

</beans:beans>
