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

	<int-mail:imap-idle-channel-adapter id="customAdapter"
					store-uri="imaps://foo.com:password@imap.foo.com/INBOX"
					channel="nullChannel"
					auto-startup="false"
					should-delete-messages="false">
			<int-mail:transactional synchronization-factory="syncFactory"/>
	</int-mail:imap-idle-channel-adapter>

	<int:transaction-synchronization-factory id="syncFactory">
		<int:before-commit expression="@syncProcessor.process(payload)"/>
	</int:transaction-synchronization-factory>

	<bean id="syncProcessor" class="org.mockito.Mockito" factory-method="mock">
		<constructor-arg
				value="org.springframework.integration.mail.config.ImapIdleIntegrationTests.PostTransactionProcessor"
				type="java.lang.Class"/>
	</bean>

	<bean id="transactionManager" class="org.springframework.integration.transaction.PseudoTransactionManager"/>

</beans>
