InMemoryServicesConfiguration.class,
FilesStorageConfiguration.class,
KafkaServicesConfiguration.class,
- ChatHomeServiceTest.TestConfiguration.class })
+ AbstractChatHomeServiceIT.TestConfiguration.class })
@EnableConfigurationProperties(ChatBackendProperties.class)
-public abstract class ChatHomeServiceTest
+public abstract class AbstractChatHomeServiceIT
{
@Autowired
ChatHomeService chatHomeService;
import static pl.rzrz.assertj.reactor.Assertions.assertThat;
-public abstract class ChatHomeServiceWithShardsTest extends ChatHomeServiceTest
+public abstract class AbstractChatHomeServiceWithShardsIT extends AbstractChatHomeServiceIT
{
public static final int NUM_SHARDS = 10;
public static final int OWNED_SHARD = 2;
package de.juplo.kafka.chat.backend.implementation.inmemory;
-import de.juplo.kafka.chat.backend.domain.ChatHomeServiceWithShardsTest;
+import de.juplo.kafka.chat.backend.domain.AbstractChatHomeServiceWithShardsIT;
import org.springframework.test.context.TestPropertySource;
-import static de.juplo.kafka.chat.backend.domain.ChatHomeServiceWithShardsTest.NUM_SHARDS;
-import static de.juplo.kafka.chat.backend.domain.ChatHomeServiceWithShardsTest.OWNED_SHARD;
+import static de.juplo.kafka.chat.backend.domain.AbstractChatHomeServiceWithShardsIT.NUM_SHARDS;
+import static de.juplo.kafka.chat.backend.domain.AbstractChatHomeServiceWithShardsIT.OWNED_SHARD;
@TestPropertySource(properties = {
"chat.backend.inmemory.owned-shards=" + OWNED_SHARD,
"chat.backend.inmemory.storage-strategy=files",
"chat.backend.inmemory.storage-directory=target/test-classes/data/files" })
-public class ShardedChatHomeServiceTest extends ChatHomeServiceWithShardsTest
+public class ShardedChatHomeServiceWithShardsIT extends AbstractChatHomeServiceWithShardsIT
{
}
package de.juplo.kafka.chat.backend.implementation.inmemory;
-import de.juplo.kafka.chat.backend.domain.ChatHomeServiceTest;
+import de.juplo.kafka.chat.backend.domain.AbstractChatHomeServiceIT;
import org.springframework.test.context.TestPropertySource;
"chat.backend.inmemory.sharding-strategy=none",
"chat.backend.inmemory.storage-strategy=files",
"chat.backend.inmemory.storage-directory=target/test-classes/data/files" })
-public class SimpleChatHomeServiceTest extends ChatHomeServiceTest
+public class SimpleChatHomeServiceIT extends AbstractChatHomeServiceIT
{
}
import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.common.TopicPartition;
import org.awaitility.Awaitility;
-import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
-import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.kafka.test.context.EmbeddedKafka;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import java.time.Duration;
import java.util.List;
-import static de.juplo.kafka.chat.backend.domain.ChatHomeServiceWithShardsTest.NUM_SHARDS;
-import static de.juplo.kafka.chat.backend.implementation.kafka.InfoChannelTest.DATA_TOPIC;
-import static de.juplo.kafka.chat.backend.implementation.kafka.InfoChannelTest.INFO_TOPIC;
+import static de.juplo.kafka.chat.backend.implementation.kafka.InfoChannelTest.*;
import static org.assertj.core.api.Assertions.assertThat;
{
final static String INFO_TOPIC = "INFO_CHANNEL_TEST_INFO";
final static String DATA_TOPIC = "INFO_CHANNEL_TEST_DATA";
+ final static int NUM_SHARDS = 10;
@Autowired
package de.juplo.kafka.chat.backend.implementation.kafka;
-import de.juplo.kafka.chat.backend.domain.ChatHomeServiceWithShardsTest;
+import de.juplo.kafka.chat.backend.domain.AbstractChatHomeServiceWithShardsIT;
import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.common.TopicPartition;
import org.junit.jupiter.api.BeforeAll;
import java.util.List;
-import static de.juplo.kafka.chat.backend.domain.ChatHomeServiceWithShardsTest.NUM_SHARDS;
-import static de.juplo.kafka.chat.backend.implementation.kafka.KafkaChatHomeServiceTest.DATA_TOPIC;
-import static de.juplo.kafka.chat.backend.implementation.kafka.KafkaChatHomeServiceTest.INFO_TOPIC;
+import static de.juplo.kafka.chat.backend.domain.AbstractChatHomeServiceWithShardsIT.NUM_SHARDS;
+import static de.juplo.kafka.chat.backend.implementation.kafka.KafkaChatHomeServiceWithShardsIT.DATA_TOPIC;
+import static de.juplo.kafka.chat.backend.implementation.kafka.KafkaChatHomeServiceWithShardsIT.INFO_TOPIC;
@ContextConfiguration(classes = {
topics = { INFO_TOPIC, DATA_TOPIC },
partitions = NUM_SHARDS)
@Slf4j
-public class KafkaChatHomeServiceTest extends ChatHomeServiceWithShardsTest
+public class KafkaChatHomeServiceWithShardsIT extends AbstractChatHomeServiceWithShardsIT
{
final static String INFO_TOPIC = "KAFKA_CHAT_HOME_TEST_INFO";
final static String DATA_TOPIC = "KAFKA_CHAT_HOME_TEST_DATA";
@TestConfiguration
- static class KafkaChatHomeServiceTestConfiguration
+ static class KafkaChatHomeServiceWithShardsITConfiguration
{
@Bean
WorkAssignor infoChannelWorkAssignor()