Class TestSupportBinder
java.lang.Object
org.springframework.cloud.stream.test.binder.TestSupportBinder
- All Implemented Interfaces:
Binder<org.springframework.messaging.MessageChannel,ConsumerProperties, ProducerProperties>
public class TestSupportBinder
extends Object
implements Binder<org.springframework.messaging.MessageChannel,ConsumerProperties,ProducerProperties>
A minimal binder that
- does nothing about binding consumers, leaving the channel as-is, so that a test author can interact with it directly,
- registers a queue channel on the producer side, so that it is easy to assert what is received.
- Author:
- Eric Bottard, Gary Russell, Mark Fisher, Oleg Zhurakousky, Soby Chacko
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBinding<org.springframework.messaging.MessageChannel>bindConsumer(String name, String group, org.springframework.messaging.MessageChannel inboundBindTarget, ConsumerProperties properties) Binding<org.springframework.messaging.MessageChannel>bindProducer(String name, org.springframework.messaging.MessageChannel outboundBindTarget, ProducerProperties properties) Registers a single subscriber to the channel, that enqueues messages for later retrieval and assertion in tests.org.springframework.messaging.MessageChannelgetChannelForName(String name)
-
Constructor Details
-
TestSupportBinder
public TestSupportBinder()
-
-
Method Details
-
bindConsumer
public Binding<org.springframework.messaging.MessageChannel> bindConsumer(String name, String group, org.springframework.messaging.MessageChannel inboundBindTarget, ConsumerProperties properties) - Specified by:
bindConsumerin interfaceBinder<org.springframework.messaging.MessageChannel,ConsumerProperties, ProducerProperties>
-
bindProducer
public Binding<org.springframework.messaging.MessageChannel> bindProducer(String name, org.springframework.messaging.MessageChannel outboundBindTarget, ProducerProperties properties) Registers a single subscriber to the channel, that enqueues messages for later retrieval and assertion in tests.- Specified by:
bindProducerin interfaceBinder<org.springframework.messaging.MessageChannel,ConsumerProperties, ProducerProperties>
-
messageCollector
-
getChannelForName
-