KafkaProducerRepository { void addKafkaProducer(KafkaConfiguration config){ log.info("About to add kafka producer from {}", config); this.kafkaProducers.put(config.getTopic(), KafkaProducer.create(vertx, config.getConfigurations())); } KafkaProducerRepository(Vertx vertx);   }
@Test public void addKafkaProducer(TestContext context) { repository.addKafkaProducer(new KafkaConfiguration(patternFrom("my.topic.*"), configs)); context.assertTrue(repository.findMatchingKafkaProducer("my.topic.x").isPresent()); context.assertFalse(repository.findMatchingKafkaProducer("my.other.topic.x").isPresent()); }