I am learning ho to test Spring Boot Kafka application with TestContainers. The test passes. However, in the beginning there are a lot of such messages:
2021-04-05 09:00:13.927 WARN 1864 --- [| adminclient-1] org.apache.kafka.clients.NetworkClient : [AdminClient clientId=adminclient-1] Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
Later, producer connects to valid bootstrap servers:
bootstrap.servers = [PLAINTEXT://localhost:55015]
How could I avoid such errors? They increase test time.
Here is the code: https://github.com/aleksei17/springboot-kafka/blob/master/src/test/java/com/example/kafka/springbootkafka/TestContainersTest1.java