From 973b8f301aae55fa79236f67aee9ec2ff62540b5 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 1 Mar 2024 14:02:01 +0100 Subject: [PATCH] test: HandoverIT-POC - Refactored / Cleaned up --- .../de/juplo/kafka/chat/backend/AbstractHandoverIT.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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]); -- 2.20.1