WIP:test: HandoverIT-POC - splitted up code into smaller classes -- ALIGN
authorKai Moritz <kai@juplo.de>
Tue, 27 Feb 2024 10:40:01 +0000 (11:40 +0100)
committerKai Moritz <kai@juplo.de>
Tue, 27 Feb 2024 10:54:03 +0000 (11:54 +0100)
src/test/java/de/juplo/kafka/chat/backend/AbstractHandoverIT.java
src/test/java/de/juplo/kafka/chat/backend/AbstractHandoverITContainers.java
src/test/java/de/juplo/kafka/chat/backend/KafkaHandoverITContainers.java

index 3e662c5..914f703 100644 (file)
@@ -1,7 +1,6 @@
 package de.juplo.kafka.chat.backend;
 
 import de.juplo.kafka.chat.backend.api.ChatRoomInfoTo;
-import de.juplo.kafka.chat.backend.api.MessageTo;
 import lombok.extern.slf4j.Slf4j;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
@@ -13,10 +12,6 @@ import org.springframework.web.reactive.function.client.WebClient;
 import org.testcontainers.junit.jupiter.Testcontainers;
 import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
-import reactor.util.retry.Retry;
-
-import java.time.Duration;
-import java.util.stream.IntStream;
 
 
 @Testcontainers
@@ -26,12 +21,12 @@ public abstract class AbstractHandoverIT
   static final ParameterizedTypeReference<ServerSentEvent<String>> SSE_TYPE = new ParameterizedTypeReference<>() {};
 
 
-  private final AbstractContainerTemplates containerTemplates;
+  private final HandoverITContainers containers;
 
 
-  AbstractHandoverIT(AbstractContainerTemplates containerTemplates)
+  AbstractHandoverIT(HandoverITContainers containers)
   {
-    this.containerTemplates = containerTemplates;
+    this.containers = containers;
   }
 
 
@@ -86,9 +81,9 @@ public abstract class AbstractHandoverIT
   @BeforeEach
   void setUp() throws Exception
   {
-    containerTemplates.setUp();
+    containers.setUp();
 
-    Integer port = containerTemplates.haproxy.getMappedPort(8400);
+    Integer port = containers.haproxy.getMappedPort(8400);
     webClient = WebClient.create("http://localhost:" + port);
   }
 }
index 96f521f..876d117 100644 (file)
@@ -18,7 +18,7 @@ import java.util.Arrays;
 
 
 @Slf4j
-public abstract class AbstractContainerTemplates
+public abstract class HandoverITContainers
 {
   static final ImagePullPolicy NEVER_PULL = imageName -> false;
 
@@ -27,7 +27,7 @@ public abstract class AbstractContainerTemplates
   final GenericContainer haproxy, backend1, backend2, backend3;
 
 
-  AbstractContainerTemplates()
+  HandoverITContainers()
   {
     haproxy = createHaproxyContainer();
     backend1 = createBackendContainer("1");
index 42380b2..6c2d988 100644 (file)
@@ -11,7 +11,7 @@ import java.io.IOException;
 
 
 @Slf4j
-class KafkaContainerTemplates extends AbstractContainerTemplates
+class KafkaContainerTemplates extends HandoverITContainers
 {
   private final KafkaContainer kafka;