diff options
Diffstat (limited to 'sources/hv-collector-kafka-consumer/src/test')
2 files changed, 5 insertions, 3 deletions
diff --git a/sources/hv-collector-kafka-consumer/src/test/kotlin/org/onap/dcae/collectors/veshv/kafkaconsumer/metrics/MicrometerMetricsTest.kt b/sources/hv-collector-kafka-consumer/src/test/kotlin/org/onap/dcae/collectors/veshv/kafkaconsumer/metrics/MicrometerMetricsTest.kt index 96ba588f..93a39ae8 100644 --- a/sources/hv-collector-kafka-consumer/src/test/kotlin/org/onap/dcae/collectors/veshv/kafkaconsumer/metrics/MicrometerMetricsTest.kt +++ b/sources/hv-collector-kafka-consumer/src/test/kotlin/org/onap/dcae/collectors/veshv/kafkaconsumer/metrics/MicrometerMetricsTest.kt @@ -21,6 +21,7 @@ package org.onap.dcae.collectors.veshv.kafkaconsumer.metrics import io.micrometer.prometheus.PrometheusConfig import io.micrometer.prometheus.PrometheusMeterRegistry +import org.apache.kafka.common.TopicPartition import org.assertj.core.api.Assertions.assertThat import org.assertj.core.data.Percentage import org.jetbrains.spek.api.Spek @@ -68,13 +69,14 @@ object MicrometerMetricsTest : Spek({ } describe("Gauges") { - val gaugeName = "$PREFIX.consumer.offset" + val gaugeName = "$PREFIX.consumer.offset.topic" on("notifyOffsetChanged") { val offset = 966L + val topicPartition = TopicPartition("sample_topic", 1) it("should update $gaugeName") { - cut.notifyOffsetChanged(offset, "sample_topic", 1) + cut.notifyOffsetChanged(offset, topicPartition) registry.verifyGauge(gaugeName) { assertThat(it.value()).isCloseTo(offset.toDouble(), doublePrecision) diff --git a/sources/hv-collector-kafka-consumer/src/test/kotlin/org/onap/dcae/collectors/veshv/kafkaconsumer/state/OffsetConsumerTest.kt b/sources/hv-collector-kafka-consumer/src/test/kotlin/org/onap/dcae/collectors/veshv/kafkaconsumer/state/OffsetConsumerTest.kt index 242f27be..5ccb483a 100644 --- a/sources/hv-collector-kafka-consumer/src/test/kotlin/org/onap/dcae/collectors/veshv/kafkaconsumer/state/OffsetConsumerTest.kt +++ b/sources/hv-collector-kafka-consumer/src/test/kotlin/org/onap/dcae/collectors/veshv/kafkaconsumer/state/OffsetConsumerTest.kt @@ -40,7 +40,7 @@ object OffsetConsumerTest : Spek({ offsetConsumer.update(topicPartition, newOffset) it("should notify message newOffset metric") { - verify(mockedMetrics).notifyOffsetChanged(newOffset, topicName, partitionNumber) + verify(mockedMetrics).notifyOffsetChanged(newOffset, topicPartition) } } } |