Class ContainerTestUtils


  • public final class ContainerTestUtils
    extends java.lang.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 Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void waitForAssignment​(java.lang.Object container, int partitions)
      Wait until the container has the required number of assigned partitions.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • waitForAssignment

        public static void waitForAssignment​(java.lang.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:
        java.lang.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.