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
  • Field Details

    • spelExpressionParser

      protected static final org.springframework.expression.spel.standard.SpelExpressionParser spelExpressionParser
  • Constructor Details

    • PartitionCapableBinderTests

      public PartitionCapableBinderTests()
  • Method Details

    • testAnonymousGroup

      @Test public void testAnonymousGroup(org.junit.jupiter.api.TestInfo testInfo) throws Exception
      Throws:
      Exception
    • testOneRequiredGroup

      @Test public void testOneRequiredGroup(org.junit.jupiter.api.TestInfo testInfo) throws Exception
      Throws:
      Exception
    • testTwoRequiredGroups

      @Test public void testTwoRequiredGroups(org.junit.jupiter.api.TestInfo testInfo) throws Exception
      Throws:
      Exception
    • testPartitionedModuleSpEL

      @Test public void testPartitionedModuleSpEL(org.junit.jupiter.api.TestInfo testInfo) throws Exception
      Throws:
      Exception
    • checkRkExpressionForPartitionedModuleSpEL

      protected void checkRkExpressionForPartitionedModuleSpEL(Object endpoint)
    • 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

      protected String getEndpointRouting(Object endpoint)
      For implementations that rely on explicit routing, return the routing expression.
    • getExpectedRoutingBaseDestination

      protected String getExpectedRoutingBaseDestination(String name, String group)
      For implementations that rely on explicit routing, return the expected base destination (the part that precedes '-partition' within the expression).
    • getClassUnderTestName

      protected abstract String getClassUnderTestName()
    • extractEndpoint

      protected org.springframework.context.Lifecycle extractEndpoint(org.springframework.cloud.stream.binder.Binding<org.springframework.messaging.MessageChannel> binding)