From: Kai Moritz Date: Fri, 1 Mar 2024 13:02:01 +0000 (+0100) Subject: test: HandoverIT-POC - Refactored / Cleaned up X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=973b8f301aae55fa79236f67aee9ec2ff62540b5;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 f6580ba1..e1e7813b 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]);