Class PartitionCapableBinderTests<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>
java.lang.Object
org.springframework.cloud.stream.binder.AbstractBinderTests<B,CP,PP>
org.springframework.cloud.stream.binder.PartitionCapableBinderTests<B,CP,PP>
public abstract class PartitionCapableBinderTests<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 AbstractBinderTests<B,CP,PP>
Tests for binders that support partitioning.
- Author:
- Gary Russell, Mark Fisher, Marius Bogoevici, Vinicius Carvalho
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.cloud.stream.binder.AbstractBinderTests
AbstractBinderTests.Station -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.springframework.expression.spel.standard.SpelExpressionParserFields inherited from class org.springframework.cloud.stream.binder.AbstractBinderTests
applicationContext, logger, messageConverter, testBinder, timeoutMultiplier -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected org.springframework.context.LifecycleextractEndpoint(org.springframework.cloud.stream.binder.Binding<org.springframework.messaging.MessageChannel> binding) protected abstract Stringprotected StringgetEndpointRouting(Object endpoint) For implementations that rely on explicit routing, return the routing expression.protected StringgetExpectedRoutingBaseDestination(String name, String group) For implementations that rely on explicit routing, return the expected base destination (the part that precedes '-partition' within the expression).voidtestAnonymousGroup(org.junit.jupiter.api.TestInfo testInfo) voidtestOneRequiredGroup(org.junit.jupiter.api.TestInfo testInfo) voidtestPartitionedModuleSpEL(org.junit.jupiter.api.TestInfo testInfo) voidtestTwoRequiredGroups(org.junit.jupiter.api.TestInfo testInfo) protected abstract booleanImplementations should return whether the binder under test uses "explicit" routing (e.g.Methods inherited from class org.springframework.cloud.stream.binder.AbstractBinderTests
before, binderBindUnbindLatency, cleanup, createBindableChannel, createBindableChannel, createBindableMessageSource, createConsumerBindingProperties, createConsumerProperties, createProducerBindingProperties, createProducerProperties, getBinder, getDestinationNameDelimiter, receive, receive, spyOn, testClean, testSendAndReceive, testSendAndReceiveMultipleTopics, testSendAndReceiveNoOriginalContentType
-
Field Details
-
spelExpressionParser
protected static final org.springframework.expression.spel.standard.SpelExpressionParser spelExpressionParser
-
-
Constructor Details
-
PartitionCapableBinderTests
public PartitionCapableBinderTests()
-
-
Method Details
-
testAnonymousGroup
- Throws:
Exception
-
testOneRequiredGroup
- Throws:
Exception
-
testTwoRequiredGroups
- Throws:
Exception
-
testPartitionedModuleSpEL
@Test public void testPartitionedModuleSpEL(org.junit.jupiter.api.TestInfo testInfo) throws Exception - Throws:
Exception
-
checkRkExpressionForPartitionedModuleSpEL
-
usesExplicitRouting
protected abstract boolean usesExplicitRouting()Implementations should return whether the binder under test uses "explicit" routing (e.g. Rabbit) whereby Spring Cloud Stream is responsible for assigning a partition and knows which exact consumer will receive the message (i.e. honor "partitionIndex") or "implicit" routing (e.g. Kafka) whereby the only guarantee is that messages will be spread, but we don't control exactly which consumer gets which message. -
getEndpointRouting
For implementations that rely on explicit routing, return the routing expression. -
getExpectedRoutingBaseDestination
For implementations that rely on explicit routing, return the expected base destination (the part that precedes '-partition' within the expression). -
getClassUnderTestName
-
extractEndpoint
protected org.springframework.context.Lifecycle extractEndpoint(org.springframework.cloud.stream.binder.Binding<org.springframework.messaging.MessageChannel> binding)
-