Prerequisite
So what is needed for testing? JUnit of course! What else? The Spring framework and Spring Integration itself provide many mocks and support classes, which help in testing the application. Let's add maven dependencies for these classes:
<dependency> <groupId>org.springframework.integration</groupId> <artifactId>spring-integration-test</artifactId> <version>${spring.integration.version}</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${junit.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>${spring.version}</version> <scope>test</scope> </dependency>