Class ConstraintUtils

java.lang.Object
io.kroxylicious.testing.kafka.common.ConstraintUtils

public class ConstraintUtils extends Object
Functions for creating constraint instances without reflecting on annotated members.
  • Method Details

    • brokerCluster

      public static BrokerCluster brokerCluster(int numBrokers)
      The Broker cluster constraint instance.
      Parameters:
      numBrokers - the number of brokers to form the cluster with
      Returns:
      the broker cluster
    • version

      public static Version version(String value)
      The version constraint instance.
      Parameters:
      value - the value of the version
      Returns:
      the version
    • brokerConfig

      public static BrokerConfig brokerConfig(String name, String value)
      Creates a constraint to ensure the broker is configured with a particular configuration property.
      Parameters:
      name - the name
      value - the value
      Returns:
      the broker config
    • brokerConfigs

      public static BrokerConfig.List brokerConfigs(Map<String,String> configs)
      Creates a constraint to ensure the broker is configured with a list of configuration properties.
      Parameters:
      configs - the configs
      Returns:
      the broker config list
    • clusterId

      public static ClusterId clusterId(String clusterId)
      The cluster id constraint instance
      Parameters:
      clusterId - the cluster id
      Returns:
      the cluster id
    • kraftCluster

      public static KRaftCluster kraftCluster(int numControllers)
      Creates a constraint to supply a cluster with a configured number of Kraft controller nodes.
      Note this constraint is mutually exclusive with `ZooKeeperCluster` constraint.
      Parameters:
      numControllers - the number of controllers
      Returns:
      the kraft cluster
    • zooKeeperCluster

      public static ZooKeeperCluster zooKeeperCluster()
      Creates a constraint to supply a cluster using ZooKeeper for controller nodes.
      Note this constraint is mutually exclusive with `ZooKeeperCluster` constraint.
      Returns:
      the zookeeper cluster
    • saslMechanism

      public static SaslMechanism saslMechanism(String saslMechanism)
      The SASL mechanism constraint instance
      Parameters:
      saslMechanism - the SASL mechanism name
      Returns:
      the SASL mechanism
    • saslMechanism

      public static SaslMechanism saslMechanism(String saslMechanism, Map<String,String> userPasswordPairs)
      The SASL mechanism constraint instance
      Parameters:
      saslMechanism - the SASL mechanism name
      userPasswordPairs - username/password pairs
      Returns:
      the SASL mechanism
    • tls

      public static Tls tls()
      The Broker cluster TLS instance.
      Returns:
      the TLS annotation