Class ConstraintUtils
java.lang.Object
io.kroxylicious.testing.kafka.common.ConstraintUtils
Functions for creating constraint instances without reflecting on annotated members.
-
Method Summary
Modifier and TypeMethodDescriptionstatic BrokerClusterbrokerCluster(int numBrokers) The Broker cluster constraint instance.static BrokerConfigbrokerConfig(String name, String value) Creates a constraint to ensure the broker is configured with a particular configuration property.static BrokerConfig.ListbrokerConfigs(Map<String, String> configs) Creates a constraint to ensure the broker is configured with a list of configuration properties.static ClusterIdThe cluster id constraint instancestatic KRaftClusterkraftCluster(int numControllers) Creates a constraint to supply a cluster with a configured number of Kraft controller nodes.static SaslMechanismsaslMechanism(String saslMechanism) The SASL mechanism constraint instancestatic SaslMechanismsaslMechanism(String saslMechanism, Map<String, String> userPasswordPairs) The SASL mechanism constraint instancestatic Tlstls()The Broker cluster TLS instance.static VersionThe version constraint instance.static ZooKeeperClusterCreates a constraint to supply a cluster using ZooKeeper for controller nodes.
-
Method Details
-
brokerCluster
The Broker cluster constraint instance.- Parameters:
numBrokers- the number of brokers to form the cluster with- Returns:
- the broker cluster
-
version
The version constraint instance.- Parameters:
value- the value of the version- Returns:
- the version
-
brokerConfig
Creates a constraint to ensure the broker is configured with a particular configuration property.- Parameters:
name- the namevalue- the value- Returns:
- the broker config
-
brokerConfigs
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
The cluster id constraint instance- Parameters:
clusterId- the cluster id- Returns:
- the cluster id
-
kraftCluster
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
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
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 nameuserPasswordPairs- username/password pairs- Returns:
- the SASL mechanism
-
tls
The Broker cluster TLS instance.- Returns:
- the TLS annotation
-