diff --git a/src/test/java/no/statnett/k3alagexporter/itest/K3aLagExporterIT.java b/src/test/java/no/statnett/k3alagexporter/itest/K3aLagExporterIT.java index 410be71..e1f7862 100644 --- a/src/test/java/no/statnett/k3alagexporter/itest/K3aLagExporterIT.java +++ b/src/test/java/no/statnett/k3alagexporter/itest/K3aLagExporterIT.java @@ -55,8 +55,8 @@ public void shouldDetectLag() { lagCollector = new ClusterLagCollector(CLUSTER_NAME, null, null, null, null, getMinimalConsumerConfig(), getMinimalAdminConfig()); - try (final Producer producer = getProducer()) { - try (final Consumer consumer = getConsumer(CONSUMER_GROUP_ID)) { + try (final Producer producer = new KafkaProducer<>(K3aTestUtils.producerProps(broker))) { + try (final Consumer consumer = new KafkaConsumer<>(K3aTestUtils.consumerProps(CONSUMER_GROUP_ID, false, broker))) { consumer.subscribe(Collections.singleton(TOPIC)); produce(producer); int consumedValue = consume(consumer); @@ -110,14 +110,6 @@ private int consume(final Consumer consumer) { return lastValue; } - public Producer getProducer() { - return new KafkaProducer<>(K3aTestUtils.producerProps(broker)); - } - - public Consumer getConsumer(final String consumerGroupId) { - return new KafkaConsumer<>(K3aTestUtils.consumerProps(consumerGroupId, false, broker)); - } - public Map getMinimalAdminConfig() { return getCommonConfig(); }