From: Kai Moritz Date: Fri, 1 Mar 2024 12:48:57 +0000 (+0100) Subject: test: HandoverIT-POC - Renamed `TestClient` to `TestWriter` -- ALIGN X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=98c6d97580c2bf26937f495fa128fa7c9d413721;p=demos%2Fkafka%2Fchat test: HandoverIT-POC - Renamed `TestClient` to `TestWriter` -- ALIGN --- diff --git a/src/test/java/de/juplo/kafka/chat/backend/AbstractHandoverIT.java b/src/test/java/de/juplo/kafka/chat/backend/AbstractHandoverIT.java index 7ab65f6f..f6580ba1 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/AbstractHandoverIT.java +++ b/src/test/java/de/juplo/kafka/chat/backend/AbstractHandoverIT.java @@ -47,20 +47,20 @@ public abstract class AbstractHandoverIT .toStream() .toArray(size -> new ChatRoomInfoTo[size]); - TestClient[] testClients = Flux + TestWriter[] testWriters = Flux .fromStream(IntStream.range(0, NUM_CLIENTS).mapToObj(i -> "user-" + Integer.toString(i))) - .map(i -> new TestClient( + .map(i -> new TestWriter( containers.haproxy.getMappedPort(8400), chatRooms, i)) .doOnNext(testClient -> executorService.execute(testClient)) .toStream() - .toArray(size -> new TestClient[size]); + .toArray(size -> new TestWriter[size]); Thread.sleep(2000); Arrays - .stream(testClients) + .stream(testWriters) .forEach(testClient -> testClient.running = false); Flux diff --git a/src/test/java/de/juplo/kafka/chat/backend/TestWriter.java b/src/test/java/de/juplo/kafka/chat/backend/TestWriter.java index 0d54600d..076376e8 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/TestWriter.java +++ b/src/test/java/de/juplo/kafka/chat/backend/TestWriter.java @@ -16,7 +16,7 @@ import java.util.concurrent.ThreadLocalRandom; @Slf4j -public class TestClient implements Runnable +public class TestWriter implements Runnable { @Override public void run() @@ -86,7 +86,7 @@ public class TestClient implements Runnable volatile boolean running = true; - TestClient(Integer port, ChatRoomInfoTo[] chatRooms, String username) + TestWriter(Integer port, ChatRoomInfoTo[] chatRooms, String username) { webClient = WebClient.create("http://localhost:" + port); this.chatRooms = chatRooms;