You can find a complete example here. It uses org.testcontainers.kafka.KafkaContainer, but you can replace it with org.testcontainers.kafka.ConfluentKafkaContainer. Both, allow to register additional listeners.