Skip to content

Commit

Permalink
refactor: inline methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sverrehu committed Oct 24, 2023
1 parent 9f29c9d commit 590828b
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public void shouldDetectLag() {
lagCollector = new ClusterLagCollector(CLUSTER_NAME,
null, null, null, null,
getMinimalConsumerConfig(), getMinimalAdminConfig());
try (final Producer<Integer, String> producer = getProducer()) {
try (final Consumer<Integer, String> consumer = getConsumer(CONSUMER_GROUP_ID)) {
try (final Producer<Integer, String> producer = new KafkaProducer<>(K3aTestUtils.producerProps(broker))) {
try (final Consumer<Integer, String> consumer = new KafkaConsumer<>(K3aTestUtils.consumerProps(CONSUMER_GROUP_ID, false, broker))) {
consumer.subscribe(Collections.singleton(TOPIC));
produce(producer);
int consumedValue = consume(consumer);
Expand Down Expand Up @@ -110,14 +110,6 @@ private int consume(final Consumer<Integer, String> consumer) {
return lastValue;
}

public Producer<Integer, String> getProducer() {
return new KafkaProducer<>(K3aTestUtils.producerProps(broker));
}

public Consumer<Integer, String> getConsumer(final String consumerGroupId) {
return new KafkaConsumer<>(K3aTestUtils.consumerProps(consumerGroupId, false, broker));
}

public Map<String, Object> getMinimalAdminConfig() {
return getCommonConfig();
}
Expand Down

0 comments on commit 590828b

Please sign in to comment.