I am writing a test class that has multiple methods that require Kafka. Each one requires different broker properties, so I want a separate instance of EmbeddedKafka for each. Doing
@EmbeddedKafka(
partitions = 20,
topics = {"topic"},
controlledShutdown = false,
brokerProperties = {
"listeners=PLAINTEXT://localhost:9091",
"port=9091",
"auto.create.topics.enable=false",
"delete.topic.enable=true"
})
Uses the broker properties for each method in the class. I don't want this. One way to overcome this would be to put each test method in a separate class with different broker properties. But I don't want to do this, as this would blow up the number of files I need.
Is there some way around this?