From f058045e82163d9e316496f47592a4ee8c74c209 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 16 Sep 2023 22:02:29 +0200 Subject: [PATCH] WIP --- .../inmemory/ShardedChatHomeServiceTest.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/test/java/de/juplo/kafka/chat/backend/implementation/inmemory/ShardedChatHomeServiceTest.java b/src/test/java/de/juplo/kafka/chat/backend/implementation/inmemory/ShardedChatHomeServiceTest.java index 76ed2baa..3ff9e9e1 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/implementation/inmemory/ShardedChatHomeServiceTest.java +++ b/src/test/java/de/juplo/kafka/chat/backend/implementation/inmemory/ShardedChatHomeServiceTest.java @@ -8,6 +8,7 @@ import de.juplo.kafka.chat.backend.storage.files.FilesStorageStrategy; import org.springframework.boot.test.context.TestConfiguration; import org.springframework.context.annotation.Bean; +import java.net.URI; import java.nio.file.Paths; import java.time.Clock; import java.util.stream.IntStream; @@ -34,7 +35,14 @@ public class ShardedChatHomeServiceTest extends ChatHomeServiceWithShardsTest ShardingStrategy strategy = new KafkaLikeShardingStrategy(NUM_SHARDS); - return new ShardedChatHomeService(chatHomes, strategy); + return new ShardedChatHomeService( + chatHomes, + IntStream + .range(0, NUM_SHARDS) + .mapToObj(shard -> "http://instance-0") + .map(uriString -> URI.create(uriString)) + .toArray(size -> new URI[size]), + strategy); } @Bean -- 2.20.1