@TestConfiguration
- @Import(KafkaTestUtils.KafkaTestConfiguration.class)
+ @EnableConfigurationProperties(ChatBackendProperties.class)
+ @Import(KafkaServicesConfiguration.class)
static class KafkaConfigurationITConfiguration
{
+ @Bean
+ WorkAssignor dataChannelWorkAssignor(DataChannel dataChannel)
+ {
+ return consumer ->
+ {
+ List<TopicPartition> assignedPartitions =
+ List.of(new TopicPartition(DATA_TOPIC, 2));
+ consumer.assign(assignedPartitions);
+ dataChannel.onPartitionsAssigned(assignedPartitions);
+ };
+ }
}
}
@TestConfiguration
@EnableConfigurationProperties(ChatBackendProperties.class)
@Import(KafkaServicesConfiguration.class)
- public static class KafkaTestConfiguration
+ static class KafkaTestConfiguration
{
@Bean
- public WorkAssignor dataChannelWorkAssignor(DataChannel dataChannel)
+ WorkAssignor dataChannelWorkAssignor(DataChannel dataChannel)
{
return consumer ->
{
}
@Bean
- public Clock clock()
+ Clock clock()
{
return Clock.systemDefaultZone();
}