From: Kai Moritz Date: Sat, 16 Sep 2023 20:02:29 +0000 (+0200) Subject: WIP X-Git-Tag: rebase--2024-01-26--18-11~16 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=f058045e82163d9e316496f47592a4ee8c74c209;p=demos%2Fkafka%2Fchat WIP --- 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