1 package de.juplo.kafka.chat.backend;
3 import org.junit.jupiter.api.DisplayName;
4 import org.junit.jupiter.api.Test;
5 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.boot.test.web.server.LocalServerPort;
7 import org.springframework.http.MediaType;
8 import org.springframework.test.web.reactive.server.WebTestClient;
9 import org.testcontainers.shaded.org.awaitility.Awaitility;
11 import java.time.Duration;
14 public abstract class AbstractConfigurationIT
19 WebTestClient webTestClient;
22 @DisplayName("The app starts, the data is restored and accessible")
27 .atMost(Duration.ofSeconds(15))
32 .uri("http://localhost:{port}/actuator/health", port)
34 .expectStatus().isOk()
35 .expectBody().jsonPath("$.status").isEqualTo("UP");
38 .uri("http://localhost:{port}/5c73531c-6fc4-426c-adcb-afc5c140a0f7", port)
39 .accept(MediaType.APPLICATION_JSON)
41 .expectStatus().isOk()
42 .expectBody().jsonPath("$.name").isEqualTo("FOO");
45 .uri("http://localhost:{port}/5c73531c-6fc4-426c-adcb-afc5c140a0f7/ute/1", port)
46 .accept(MediaType.APPLICATION_JSON)
48 .expectStatus().isOk()
49 .expectBody().jsonPath("$.text").isEqualTo("Ich bin Ute...");
52 .uri("http://localhost:{port}/5c73531c-6fc4-426c-adcb-afc5c140a0f7/peter/1", port)
53 .accept(MediaType.APPLICATION_JSON)
55 .expectStatus().isOk()
56 .expectBody().jsonPath("$.text").isEqualTo("Hallo, ich heiße Peter!");