package de.juplo.kafka.chat.backend;
import de.juplo.kafka.chat.backend.domain.ShardingStrategy;
+import de.juplo.kafka.chat.backend.persistence.kafka.KafkaServicesApplicationRunner;
+import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.producer.ProducerRecord;
+import org.apache.kafka.common.TopicPartition;
import org.junit.jupiter.api.BeforeAll;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.kafka.test.context.EmbeddedKafka;
+import java.util.List;
import java.util.UUID;
import static de.juplo.kafka.chat.backend.KafkaConfigurationIT.TOPIC;
{
final static String TOPIC = "TEST_CHATROOM_CHANNEL";
+ @MockBean
+ KafkaServicesApplicationRunner kafkaServicesApplicationRunner;
+
+
+ @BeforeAll
+ public static void prepareChatRoomChannelConsumer(
+ @Autowired Consumer chatRoomChannelConsumer)
+ {
+ chatRoomChannelConsumer.assign(List.of(new TopicPartition(TOPIC, 6)));
+ }
+
@BeforeAll
- public static void test(
+ public static void sendStoredData(
@Autowired ShardingStrategy shardingStrategy,
@Autowired KafkaTemplate<String, String> messageTemplate)
{