1 package de.juplo.kafka;
3 import org.junit.jupiter.api.Test;
4 import org.springframework.beans.factory.annotation.Autowired;
5 import org.springframework.boot.test.context.SpringBootTest;
6 import org.springframework.boot.test.web.client.TestRestTemplate;
7 import org.springframework.boot.test.web.server.LocalServerPort;
8 import org.springframework.kafka.test.context.EmbeddedKafka;
10 import static de.juplo.kafka.ApplicationIT.TOPIC;
14 webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
16 "sumup.requests.bootstrap-server=${spring.embedded.kafka.brokers}",
17 "sumup.requests.topic=" + TOPIC,
18 "spring.mongodb.embedded.version=4.4.13" })
19 @EmbeddedKafka(topics = TOPIC)
20 public class ApplicationIT
22 public static final String TOPIC = "FOO";
28 private TestRestTemplate restTemplate;
33 public void testApplicationStartup()
35 restTemplate.getForObject(
36 "http://localhost:" + port + "/actuator/health",