X-Git-Url: http://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fde%2Fjuplo%2Fkafka%2Fchat%2Fbackend%2Fpersistence%2FInMemoryWithMongoDbStorageIT.java;h=7ca9cb2f64d03cdd53b15eac6a4d8cbc10453f6d;hb=1d4b90c15b1571bce48389e2c34e7b15c1697b89;hp=e56aff778e9874ee0612d96e82d8217902390dc6;hpb=9abc6319cb4a72fffe2ceb5b11cc51fc82c772a0;p=demos%2Fkafka%2Fchat diff --git a/src/test/java/de/juplo/kafka/chat/backend/persistence/InMemoryWithMongoDbStorageIT.java b/src/test/java/de/juplo/kafka/chat/backend/persistence/InMemoryWithMongoDbStorageIT.java index e56aff77..7ca9cb2f 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/persistence/InMemoryWithMongoDbStorageIT.java +++ b/src/test/java/de/juplo/kafka/chat/backend/persistence/InMemoryWithMongoDbStorageIT.java @@ -1,11 +1,6 @@ package de.juplo.kafka.chat.backend.persistence; -import de.juplo.kafka.chat.backend.domain.ShardingStrategy; -import de.juplo.kafka.chat.backend.domain.ChatHomeService; -import de.juplo.kafka.chat.backend.domain.ChatRoomFactory; -import de.juplo.kafka.chat.backend.persistence.inmemory.InMemoryChatHomeService; import de.juplo.kafka.chat.backend.persistence.InMemoryWithMongoDbStorageIT.DataSourceInitializer; -import de.juplo.kafka.chat.backend.persistence.inmemory.InMemoryChatRoomFactory; import de.juplo.kafka.chat.backend.persistence.inmemory.InMemoryChatRoomService; import de.juplo.kafka.chat.backend.persistence.storage.mongodb.ChatRoomRepository; import de.juplo.kafka.chat.backend.persistence.storage.mongodb.MongoDbStorageStrategy; @@ -28,7 +23,6 @@ import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; import java.time.Clock; -import java.util.function.Supplier; @Testcontainers @@ -37,7 +31,7 @@ import java.util.function.Supplier; @AutoConfigureDataMongo @ContextConfiguration(initializers = DataSourceInitializer.class) @Slf4j -public class InMemoryWithMongoDbStorageIT extends AbstractStorageStrategyIT +public class InMemoryWithMongoDbStorageIT extends AbstractInMemoryStorageIT { @Autowired MongoDbStorageStrategy storageStrategy; @@ -47,26 +41,16 @@ public class InMemoryWithMongoDbStorageIT extends AbstractStorageStrategyIT Clock clock; - @Override - protected StorageStrategy getStorageStrategy() + public InMemoryWithMongoDbStorageIT() { - return storageStrategy; + super(Clock.systemDefaultZone()); } - @Override - protected Supplier getChatHomeServiceSupplier() - { - return () -> new InMemoryChatHomeService( - 1, - new int[] { 0 }, - getStorageStrategy().read()); - } @Override - protected ChatRoomFactory getChatRoomFactory() + protected StorageStrategy getStorageStrategy() { - ShardingStrategy strategy = chatRoomId -> 0; - return new InMemoryChatRoomFactory(strategy, clock, 8); + return storageStrategy; } @TestConfiguration