|
|
|
@ -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 {
|
|
|
|
|
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");
|
|
|
|
|