import org.springframework.kafka.test.context.EmbeddedKafka;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+import java.time.Clock;
import java.util.List;
import java.util.concurrent.CompletableFuture;
@SpringBootTest(
classes = {
+ KafkaChatHomeTest.KafkaChatHomeTestConfiguration.class,
KafkaServicesConfiguration.class,
KafkaAutoConfiguration.class,
TaskExecutionAutoConfiguration.class,
"chat.backend.kafka.chatroom-channel-topic=" + TOPIC,
"chat.backend.kafka.num-partitions=" + NUM_SHARDS,
})
-@EnableConfigurationProperties(ChatBackendProperties.class)
@EmbeddedKafka(topics = { TOPIC }, partitions = 10)
@Slf4j
public class KafkaChatHomeTest extends ChatHomeWithShardsTestBase
static CompletableFuture<Void> CONSUMER_JOB;
+ @TestConfiguration
+ @EnableConfigurationProperties(ChatBackendProperties.class)
+ static class KafkaChatHomeTestConfiguration
+ {
+ @Bean
+ Clock clock()
+ {
+ return Clock.systemDefaultZone();
+ }
+ }
+
+
@BeforeAll
public static void sendAndLoadStoredData(
@Autowired KafkaTemplate<String, String> messageTemplate,