Browse Source

Polish "Add config property for KafkaAdmin modifyTopicConfigs"

See gh-31679
pull/31712/head
Stephane Nicoll 4 years ago
parent
commit
4ae4698093
  1. 10
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaPropertiesTests.java

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

@ -21,12 +21,14 @@ import java.util.Map; @@ -21,12 +21,14 @@ import java.util.Map;
import org.apache.kafka.common.config.SslConfigs;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.kafka.KafkaProperties.Admin;
import org.springframework.boot.autoconfigure.kafka.KafkaProperties.Cleanup;
import org.springframework.boot.autoconfigure.kafka.KafkaProperties.IsolationLevel;
import org.springframework.boot.autoconfigure.kafka.KafkaProperties.Listener;
import org.springframework.boot.context.properties.source.MutuallyExclusiveConfigurationPropertiesException;
import org.springframework.core.io.ClassPathResource;
import org.springframework.kafka.core.CleanupConfig;
import org.springframework.kafka.core.KafkaAdmin;
import org.springframework.kafka.listener.ContainerProperties;
import static org.assertj.core.api.Assertions.assertThat;
@ -51,6 +53,14 @@ class KafkaPropertiesTests { @@ -51,6 +53,14 @@ class KafkaPropertiesTests {
assertThat(original).hasSize(IsolationLevel.values().length);
}
@Test
void adminDefaultValuesAreConsistent() {
KafkaAdmin admin = new KafkaAdmin(Map.of());
Admin adminProperties = new KafkaProperties().getAdmin();
assertThat(admin).hasFieldOrPropertyWithValue("fatalIfBrokerNotAvailable", adminProperties.isFailFast());
assertThat(admin).hasFieldOrPropertyWithValue("modifyTopicConfigs", adminProperties.isModifyTopicConfigs());
}
@Test
void listenerDefaultValuesAreConsistent() {
ContainerProperties container = new ContainerProperties("test");

Loading…
Cancel
Save