X-Git-Url: http://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fde%2Fjuplo%2Fkafka%2Fchat%2Fbackend%2FInMemoryWithFilesConfigurationIT.java;fp=src%2Ftest%2Fjava%2Fde%2Fjuplo%2Fkafka%2Fchat%2Fbackend%2FInMemoryWithFilesConfigurationIT.java;h=0065219feed986c5f8f7d7f713cabadaaafd2190;hb=e70011c8379dfc67d359947ebb88c067801317da;hp=8aa0815ef859c224dfd247b439fbf1da9799bae6;hpb=fd45f7f9e3b3d7a312af9112cae79a0c40172316;p=demos%2Fkafka%2Fchat diff --git a/src/test/java/de/juplo/kafka/chat/backend/InMemoryWithFilesConfigurationIT.java b/src/test/java/de/juplo/kafka/chat/backend/InMemoryWithFilesConfigurationIT.java index 8aa0815e..0065219f 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/InMemoryWithFilesConfigurationIT.java +++ b/src/test/java/de/juplo/kafka/chat/backend/InMemoryWithFilesConfigurationIT.java @@ -1,54 +1,11 @@ package de.juplo.kafka.chat.backend; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.server.LocalServerPort; -import org.springframework.http.MediaType; -import org.springframework.test.web.reactive.server.WebTestClient; -import org.testcontainers.shaded.org.awaitility.Awaitility; - -import java.time.Duration; @SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = "chat.backend.storage-directory=target/test-classes/data/files") -class InMemoryWithFilesConfigurationIT +class InMemoryWithFilesConfigurationIT extends AbstractConfigurationIT { - @LocalServerPort - private int port; - @Autowired - private WebTestClient webTestClient; - - @Test - void contextLoads() - { - Awaitility - .await() - .atMost(Duration.ofSeconds(15)) - .untilAsserted(() -> - { - webTestClient - .get() - .uri("http://localhost:{port}/actuator/health", port) - .exchange() - .expectStatus().isOk() - .expectBody().jsonPath("$.status").isEqualTo("UP"); - webTestClient - .get() - .uri("http://localhost:{port}/618e89ae-fdc0-4c65-8055-f49908295e8f", port) - .accept(MediaType.APPLICATION_JSON) - .exchange() - .expectStatus().isOk() - .expectBody().jsonPath("$.name").isEqualTo("Peter's Chat-Room"); - webTestClient - .get() - .uri("http://localhost:{port}/618e89ae-fdc0-4c65-8055-f49908295e8f/ute/1478", port) - .accept(MediaType.APPLICATION_JSON) - .exchange() - .expectStatus().isOk() - .expectBody().jsonPath("$.text").isEqualTo("Nachricht Nr. 1478"); - }); - } }