use of io.strimzi.api.kafka.model.template.JmxTransQueryTemplateBuilder in project strimzi by strimzi.
the class KafkaAssemblyOperatorTest method testCreateClusterWithJmxTrans.
@ParameterizedTest
@MethodSource("data")
public void testCreateClusterWithJmxTrans(Params params, VertxTestContext context) {
setFields(params);
Kafka kafka = getKafkaAssembly("foo");
kafka.getSpec().getKafka().setJmxOptions(new KafkaJmxOptionsBuilder().withAuthentication(new KafkaJmxAuthenticationPasswordBuilder().build()).build());
kafka.getSpec().setJmxTrans(new JmxTransSpecBuilder().withKafkaQueries(new JmxTransQueryTemplateBuilder().withTargetMBean("mbean").withAttributes("attribute").withOutputs("output").build()).withOutputDefinitions(new JmxTransOutputDefinitionTemplateBuilder().withOutputType("host").withName("output").build()).build());
createCluster(context, kafka, Collections.singletonList(new SecretBuilder().withNewMetadata().withName(KafkaCluster.jmxSecretName("foo")).withNamespace("test").endMetadata().withData(Collections.singletonMap("foo", "bar")).build()));
}
use of io.strimzi.api.kafka.model.template.JmxTransQueryTemplateBuilder in project strimzi-kafka-operator by strimzi.
the class KafkaAssemblyOperatorTest method testCreateClusterWithJmxTrans.
@ParameterizedTest
@MethodSource("data")
public void testCreateClusterWithJmxTrans(Params params, VertxTestContext context) {
setFields(params);
Kafka kafka = getKafkaAssembly("foo");
kafka.getSpec().getKafka().setJmxOptions(new KafkaJmxOptionsBuilder().withAuthentication(new KafkaJmxAuthenticationPasswordBuilder().build()).build());
kafka.getSpec().setJmxTrans(new JmxTransSpecBuilder().withKafkaQueries(new JmxTransQueryTemplateBuilder().withTargetMBean("mbean").withAttributes("attribute").withOutputs("output").build()).withOutputDefinitions(new JmxTransOutputDefinitionTemplateBuilder().withOutputType("host").withName("output").build()).build());
createCluster(context, kafka, Collections.singletonList(new SecretBuilder().withNewMetadata().withName(KafkaCluster.jmxSecretName("foo")).withNamespace("test").endMetadata().withData(Collections.singletonMap("foo", "bar")).build()));
}
Aggregations