Class ContainerTestUtils

java.lang.Object
org.springframework.kafka.test.utils.ContainerTestUtils

public final class ContainerTestUtils extends Object
Utilities for testing listener containers. No hard references to container classes are used to avoid circular project dependencies.
Since:
1.0.3
Author:
Gary Russell
  • Method Details

    • waitForAssignment

      public static void waitForAssignment(Object container, int partitions)
      Wait until the container has the required number of assigned partitions.
      Parameters:
      container - the container.
      partitions - the number of partitions.
      Throws:
      IllegalStateException - if the operation cannot be completed (since 2.3.4) as expected.
      org.springframework.kafka.test.utils.ContainerTestUtils.ContainerTestUtilsException - if the call to the container's getAssignedPartitions() method fails.