First of all, thanks for the new EmbeddedKafkaBroker abstraction and the KRaft impl.!
In what version(s) of Spring for Apache Kafka are you seeing this issue?
3.1.0
Describe the bug
EmbeddedKafkaKraftBroker.kafkaPorts(int... ports) sets the kafkaPorts array but it seems that is never used?
ref.: https://github.com/spring-projects/spring-kafka/blob/v3.1.0/spring-kafka-test/src/main/java/org/springframework/kafka/test/EmbeddedKafkaKraftBroker.java#L148-L160
To Reproduce
EmbeddedKafkaKraftBroker broker = new EmbeddedKafkaKraftBroker(1,1)
.kafkaPorts(9092);
-> still uses random port.
Expected behavior
The EmbeddedKafkaKraftBroker actually uses the specified port(s).
Sample
ping me if you think a sample is helpful here.