diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/spring-cloud-stream-overview.adoc b/spring-cloud-stream-core-docs/src/main/asciidoc/spring-cloud-stream-overview.adoc index 1ae0e9b85..0c1e92ca8 100644 --- a/spring-cloud-stream-core-docs/src/main/asciidoc/spring-cloud-stream-overview.adoc +++ b/spring-cloud-stream-core-docs/src/main/asciidoc/spring-cloud-stream-overview.adoc @@ -1759,8 +1759,22 @@ While a scenario which using multiple instances for partitioned data processing == Testing Spring Cloud Stream provides support for testing your microservice applications without connecting to a messaging system. -You can do that by using the `TestSupportBinder`. -This is useful especially for unit testing your microservices. +You can do that by using the `TestSupportBinder` provided by the `spring-cloud-stream-test-support` library, which can be added as a test dependency to the application: + +[source,xml] +---- + + org.springframework.cloud + spring-cloud-stream-test-support + test + +---- + +[NOTE] +==== +The `TestSupportBinder` uses the Spring Boot autoconfiguration mechanism to supersede the other binders found on the classpath. +Therefore, when adding a binder as a dependency, make sure that the `test` scope is being used. +==== The `TestSupportBinder` allows users to interact with the bound channels and inspect what messages are sent and received by the application @@ -1772,18 +1786,13 @@ The following example shows how to test both input and output channels on a proc [source,java] ---- -@RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = ExampleTest.MyProcessor.class) -@IntegrationTest({"server.port=-1"}) -@DirtiesContext +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment= SpringBootTest.WebEnvironment.RANDOM_PORT) public class ExampleTest { @Autowired private Processor processor; - @Autowired - private BinderFactory binderFactory; - @Autowired private MessageCollector messageCollector;