From: Kai Moritz Date: Fri, 1 Mar 2024 13:02:01 +0000 (+0100) Subject: test: HandoverIT-POC - Refactored / Cleaned up X-Git-Tag: rebase--2024-03-03--11-38~16 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=e02ae5f2c953689492eff3ae3c832841b29a3eda;p=demos%2Fkafka%2Fchat test: HandoverIT-POC - Refactored / Cleaned up --- 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 aaea973a..0fd10d6e 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/AbstractHandoverIT.java +++ b/src/test/java/de/juplo/kafka/chat/backend/AbstractHandoverIT.java @@ -16,7 +16,6 @@ import reactor.core.publisher.Mono; import java.util.Arrays; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.stream.IntStream; @Testcontainers @@ -47,12 +46,14 @@ public abstract class AbstractHandoverIT .toStream() .toArray(size -> new ChatRoomInfoTo[size]); + int port = containers.haproxy.getMappedPort(8400); + TestWriter[] testWriters = Flux - .fromStream(IntStream.range(0, NUM_CLIENTS).mapToObj(i -> "user-" + Integer.toString(i))) + .range(0, NUM_CLIENTS) .map(i -> new TestWriter( - containers.haproxy.getMappedPort(8400), + port, chatRooms, - i)) + "user-" + Integer.toString(i))) .doOnNext(testClient -> executorService.execute(testClient)) .toStream() .toArray(size -> new TestWriter[size]);