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


	<int:channel id="in"/>
	<int:channel id="out"/>

	<int-mongodb:outbound-gateway id="gatewayWithCollectionCallbackAndQuery"
		mongo-template="mongoDbTemplate"
		collection-name="foo"
		collection-callback="mockCollectionCallback"
		query="{'name' : 'foo'}"
		request-channel="in"
		reply-channel="out"/>

	<bean id="mongoDbFactory" class="org.mockito.Mockito" factory-method="mock">
		<constructor-arg value="org.springframework.data.mongodb.MongoDatabaseFactory" type="java.lang.Class"/>
	</bean>

	<bean id="mongoDbTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
		<constructor-arg ref="mongoDbFactory"/>
	</bean>

	<bean id="mockCollectionCallback" class="org.mockito.Mockito" factory-method="mock">
		<constructor-arg value="org.springframework.data.mongodb.core.CollectionCallback" type="java.lang.Class"/>
	</bean>

</beans>
