use of io.strimzi.api.kafka.model.MetricsConfig in project strimzi-kafka-operator by strimzi.
the class KafkaMirrorMaker2ClusterTest method testMetricsParsingFromConfigMap.
@ParallelTest
public void testMetricsParsingFromConfigMap() {
MetricsConfig metrics = new JmxPrometheusExporterMetricsBuilder().withNewValueFrom().withConfigMapKeyRef(new ConfigMapKeySelectorBuilder().withName("my-metrics-configuration").withKey("config.yaml").build()).endValueFrom().build();
KafkaMirrorMaker2 kafkaMirrorMaker2 = new KafkaMirrorMaker2Builder(this.resource).editSpec().withMetricsConfig(metrics).endSpec().build();
KafkaMirrorMaker2Cluster kmm = KafkaMirrorMaker2Cluster.fromCrd(Reconciliation.DUMMY_RECONCILIATION, kafkaMirrorMaker2, VERSIONS);
assertThat(kmm.isMetricsEnabled(), is(true));
assertThat(kmm.getMetricsConfigInCm(), is(metrics));
}
use of io.strimzi.api.kafka.model.MetricsConfig in project strimzi-kafka-operator by strimzi.
the class KafkaMirrorMakerClusterTest method testMetricsParsingFromConfigMap.
@ParallelTest
public void testMetricsParsingFromConfigMap() {
MetricsConfig metrics = new JmxPrometheusExporterMetricsBuilder().withNewValueFrom().withConfigMapKeyRef(new ConfigMapKeySelectorBuilder().withName("my-metrics-configuration").withKey("config.yaml").build()).endValueFrom().build();
KafkaMirrorMaker mirrorMaker = new KafkaMirrorMakerBuilder(this.resource).editSpec().withMetricsConfig(metrics).endSpec().build();
KafkaMirrorMakerCluster kmm = KafkaMirrorMakerCluster.fromCrd(Reconciliation.DUMMY_RECONCILIATION, mirrorMaker, VERSIONS);
assertThat(kmm.isMetricsEnabled(), is(true));
assertThat(kmm.getMetricsConfigInCm(), is(metrics));
}
Aggregations