public abstract class AbstractBinderTests<B extends AbstractTestBinder<? extends org.springframework.cloud.stream.binder.AbstractBinder<org.springframework.messaging.MessageChannel,CP,PP>,CP,PP>,CP extends org.springframework.cloud.stream.binder.ConsumerProperties,PP extends org.springframework.cloud.stream.binder.ProducerProperties> extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractBinderTests.Station |
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
logger |
protected org.springframework.messaging.converter.SmartMessageConverter |
messageConverter |
protected B |
testBinder |
protected double |
timeoutMultiplier
Subclasses may override this default value to have tests wait longer for a message
receive, for example if running in an environment that is known to be slow (e.g.
|
| Constructor and Description |
|---|
AbstractBinderTests() |
| Modifier and Type | Method and Description |
|---|---|
void |
before() |
protected void |
binderBindUnbindLatency()
If appropriate, let the binder middleware settle down a bit while binding/unbinding
actually happens.
|
void |
cleanup() |
protected org.springframework.integration.channel.DirectChannel |
createBindableChannel(String channelName,
org.springframework.cloud.stream.config.BindingProperties bindingProperties) |
protected org.springframework.integration.channel.DirectChannel |
createBindableChannel(String channelName,
org.springframework.cloud.stream.config.BindingProperties bindingProperties,
boolean inputChannel) |
protected org.springframework.cloud.stream.binder.DefaultPollableMessageSource |
createBindableMessageSource(String bindingName,
org.springframework.cloud.stream.config.BindingProperties bindingProperties) |
protected org.springframework.cloud.stream.config.BindingProperties |
createConsumerBindingProperties(CP consumerProperties) |
protected abstract CP |
createConsumerProperties() |
protected org.springframework.cloud.stream.config.BindingProperties |
createProducerBindingProperties(PP producerProperties) |
protected abstract PP |
createProducerProperties() |
protected abstract B |
getBinder() |
protected String |
getDestinationNameDelimiter()
Set the delimiter that will be used in the message source/target name.
|
protected org.springframework.messaging.Message<?> |
receive(org.springframework.messaging.PollableChannel channel)
Attempt to receive a message on the given channel, waiting up to 1s (times the
timeoutMultiplier). |
protected org.springframework.messaging.Message<?> |
receive(org.springframework.messaging.PollableChannel channel,
int additionalMultiplier)
Attempt to receive a message on the given channel, waiting up to 1s *
additionalMultiplier *
timeoutMultiplier). |
abstract Spy |
spyOn(String name)
Create a new spy on the given 'queue'.
|
void |
testClean() |
void |
testSendAndReceive() |
void |
testSendAndReceiveJavaSerialization() |
void |
testSendAndReceiveKryo() |
void |
testSendAndReceiveMultipleTopics() |
void |
testSendAndReceiveNoOriginalContentType() |
void |
testSendJsonReceiveJsonWithStreamListener() |
void |
testSendJsonReceivePojoWithStreamListener() |
void |
testSendPojoReceivePojoKryoWithStreamListener() |
void |
testSendPojoReceivePojoWithStreamListener() |
void |
testSendPojoReceivePojoWithStreamListenerDefaultContentType() |
void |
testStreamListenerJavaSerializationNonSerializable() |
protected final org.apache.commons.logging.Log logger
protected B extends AbstractTestBinder<? extends org.springframework.cloud.stream.binder.AbstractBinder<org.springframework.messaging.MessageChannel,CP,PP>,CP,PP> testBinder
protected org.springframework.messaging.converter.SmartMessageConverter messageConverter
protected double timeoutMultiplier
public void before()
protected org.springframework.messaging.Message<?> receive(org.springframework.messaging.PollableChannel channel)
timeoutMultiplier).protected org.springframework.messaging.Message<?> receive(org.springframework.messaging.PollableChannel channel,
int additionalMultiplier)
timeoutMultiplier).
Allows accomodating tests which are slower than normal (e.g. retry).public void testSendAndReceiveJavaSerialization()
throws Exception
Exceptionpublic void testSendAndReceiveMultipleTopics()
throws Exception
Exceptionpublic void testSendAndReceiveNoOriginalContentType()
throws Exception
Exceptionprotected abstract CP createConsumerProperties()
protected abstract PP createProducerProperties()
protected final org.springframework.cloud.stream.config.BindingProperties createConsumerBindingProperties(CP consumerProperties)
protected org.springframework.cloud.stream.config.BindingProperties createProducerBindingProperties(PP producerProperties)
protected org.springframework.integration.channel.DirectChannel createBindableChannel(String channelName, org.springframework.cloud.stream.config.BindingProperties bindingProperties) throws Exception
Exceptionprotected org.springframework.integration.channel.DirectChannel createBindableChannel(String channelName, org.springframework.cloud.stream.config.BindingProperties bindingProperties, boolean inputChannel) throws Exception
Exceptionprotected org.springframework.cloud.stream.binder.DefaultPollableMessageSource createBindableMessageSource(String bindingName, org.springframework.cloud.stream.config.BindingProperties bindingProperties) throws Exception
Exceptionpublic void cleanup()
protected void binderBindUnbindLatency()
throws InterruptedException
InterruptedExceptionpublic abstract Spy spyOn(String name)
protected String getDestinationNameDelimiter()
public void testSendPojoReceivePojoWithStreamListenerDefaultContentType()
throws Exception
Exceptionpublic void testSendPojoReceivePojoKryoWithStreamListener()
throws Exception
Exceptionpublic void testStreamListenerJavaSerializationNonSerializable()
throws Exception
Exceptionpublic void testSendJsonReceivePojoWithStreamListener()
throws Exception
Exceptionpublic void testSendJsonReceiveJsonWithStreamListener()
throws Exception
ExceptionCopyright © 2019 Pivotal Software, Inc.. All rights reserved.