Search in sources :

Example 1 with JmxTransOutputDefinitionTemplateBuilder

use of io.strimzi.api.kafka.model.template.JmxTransOutputDefinitionTemplateBuilder 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()));
}
Also used : SecretBuilder(io.fabric8.kubernetes.api.model.SecretBuilder) KafkaJmxOptionsBuilder(io.strimzi.api.kafka.model.KafkaJmxOptionsBuilder) JmxTransSpecBuilder(io.strimzi.api.kafka.model.JmxTransSpecBuilder) Kafka(io.strimzi.api.kafka.model.Kafka) KafkaJmxAuthenticationPasswordBuilder(io.strimzi.api.kafka.model.KafkaJmxAuthenticationPasswordBuilder) JmxTransQueryTemplateBuilder(io.strimzi.api.kafka.model.template.JmxTransQueryTemplateBuilder) JmxTransOutputDefinitionTemplateBuilder(io.strimzi.api.kafka.model.template.JmxTransOutputDefinitionTemplateBuilder) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 2 with JmxTransOutputDefinitionTemplateBuilder

use of io.strimzi.api.kafka.model.template.JmxTransOutputDefinitionTemplateBuilder 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()));
}
Also used : SecretBuilder(io.fabric8.kubernetes.api.model.SecretBuilder) KafkaJmxOptionsBuilder(io.strimzi.api.kafka.model.KafkaJmxOptionsBuilder) JmxTransSpecBuilder(io.strimzi.api.kafka.model.JmxTransSpecBuilder) Kafka(io.strimzi.api.kafka.model.Kafka) KafkaJmxAuthenticationPasswordBuilder(io.strimzi.api.kafka.model.KafkaJmxAuthenticationPasswordBuilder) JmxTransQueryTemplateBuilder(io.strimzi.api.kafka.model.template.JmxTransQueryTemplateBuilder) JmxTransOutputDefinitionTemplateBuilder(io.strimzi.api.kafka.model.template.JmxTransOutputDefinitionTemplateBuilder) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

SecretBuilder (io.fabric8.kubernetes.api.model.SecretBuilder)2 JmxTransSpecBuilder (io.strimzi.api.kafka.model.JmxTransSpecBuilder)2 Kafka (io.strimzi.api.kafka.model.Kafka)2 KafkaJmxAuthenticationPasswordBuilder (io.strimzi.api.kafka.model.KafkaJmxAuthenticationPasswordBuilder)2 KafkaJmxOptionsBuilder (io.strimzi.api.kafka.model.KafkaJmxOptionsBuilder)2 JmxTransOutputDefinitionTemplateBuilder (io.strimzi.api.kafka.model.template.JmxTransOutputDefinitionTemplateBuilder)2 JmxTransQueryTemplateBuilder (io.strimzi.api.kafka.model.template.JmxTransQueryTemplateBuilder)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 MethodSource (org.junit.jupiter.params.provider.MethodSource)2