Skip to content

Commit 4ae4698

Browse files
committed
Polish "Add config property for KafkaAdmin modifyTopicConfigs"
See gh-31679
1 parent 677c05a commit 4ae4698

File tree

1 file changed

+10
-0
lines changed
  • spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka

1 file changed

+10
-0
lines changed

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaPropertiesTests.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121
import org.apache.kafka.common.config.SslConfigs;
2222
import org.junit.jupiter.api.Test;
2323

24+
import org.springframework.boot.autoconfigure.kafka.KafkaProperties.Admin;
2425
import org.springframework.boot.autoconfigure.kafka.KafkaProperties.Cleanup;
2526
import org.springframework.boot.autoconfigure.kafka.KafkaProperties.IsolationLevel;
2627
import org.springframework.boot.autoconfigure.kafka.KafkaProperties.Listener;
2728
import org.springframework.boot.context.properties.source.MutuallyExclusiveConfigurationPropertiesException;
2829
import org.springframework.core.io.ClassPathResource;
2930
import org.springframework.kafka.core.CleanupConfig;
31+
import org.springframework.kafka.core.KafkaAdmin;
3032
import org.springframework.kafka.listener.ContainerProperties;
3133

3234
import static org.assertj.core.api.Assertions.assertThat;
@@ -51,6 +53,14 @@ void isolationLevelEnumConsistentWithKafkaVersion() {
5153
assertThat(original).hasSize(IsolationLevel.values().length);
5254
}
5355

56+
@Test
57+
void adminDefaultValuesAreConsistent() {
58+
KafkaAdmin admin = new KafkaAdmin(Map.of());
59+
Admin adminProperties = new KafkaProperties().getAdmin();
60+
assertThat(admin).hasFieldOrPropertyWithValue("fatalIfBrokerNotAvailable", adminProperties.isFailFast());
61+
assertThat(admin).hasFieldOrPropertyWithValue("modifyTopicConfigs", adminProperties.isModifyTopicConfigs());
62+
}
63+
5464
@Test
5565
void listenerDefaultValuesAreConsistent() {
5666
ContainerProperties container = new ContainerProperties("test");

0 commit comments

Comments
 (0)