diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java index e97fbde48753..3ebb221d00d3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java @@ -177,6 +177,18 @@ private Map buildCommonProperties(SslBundles sslBundles) { return properties; } + /** + * Create an initial map of consumer properties from the state of this instance. + *

+ * This allows you to add additional properties, if necessary, and override the + * default {@code kafkaConsumerFactory} bean. + * @return the consumer properties initialized with the customizations defined on this + * instance + */ + public Map buildConsumerProperties() { + return buildConsumerProperties(null); + } + /** * Create an initial map of consumer properties from the state of this instance. *

@@ -192,6 +204,18 @@ public Map buildConsumerProperties(SslBundles sslBundles) { return properties; } + /** + * Create an initial map of producer properties from the state of this instance. + *

+ * This allows you to add additional properties, if necessary, and override the + * default {@code kafkaProducerFactory} bean. + * @return the producer properties initialized with the customizations defined on this + * instance + */ + public Map buildProducerProperties() { + return buildProducerProperties(null); + } + /** * Create an initial map of producer properties from the state of this instance. *

diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/ClientsConfiguredCondition.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/ClientsConfiguredCondition.java index 43e7ef93f99c..36ddc5202ebb 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/ClientsConfiguredCondition.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/ClientsConfiguredCondition.java @@ -36,7 +36,6 @@ * @author Madhura Bhave * @since 2.1.0 */ - public class ClientsConfiguredCondition extends SpringBootCondition { private static final Bindable> STRING_REGISTRATION_MAP = Bindable diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaPropertiesTests.java index dbd53fd59d81..f00ddd930bef 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaPropertiesTests.java @@ -80,7 +80,7 @@ void sslPemConfiguration() { properties.getSsl().setKeyStoreKey("-----BEGINkey"); properties.getSsl().setTrustStoreCertificates("-----BEGINtrust"); properties.getSsl().setKeyStoreCertificateChain("-----BEGINchain"); - Map consumerProperties = properties.buildConsumerProperties(null); + Map consumerProperties = properties.buildConsumerProperties(); assertThat(consumerProperties).containsEntry(SslConfigs.SSL_KEYSTORE_KEY_CONFIG, "-----BEGINkey"); assertThat(consumerProperties).containsEntry(SslConfigs.SSL_TRUSTSTORE_CERTIFICATES_CONFIG, "-----BEGINtrust"); assertThat(consumerProperties).containsEntry(SslConfigs.SSL_KEYSTORE_CERTIFICATE_CHAIN_CONFIG, @@ -103,7 +103,7 @@ void sslPropertiesWhenKeyStoreLocationAndKeySetShouldThrowException() { properties.getSsl().setKeyStoreKey("-----BEGIN"); properties.getSsl().setKeyStoreLocation(new ClassPathResource("ksLoc")); assertThatExceptionOfType(MutuallyExclusiveConfigurationPropertiesException.class) - .isThrownBy(() -> properties.buildConsumerProperties(null)); + .isThrownBy(() -> properties.buildConsumerProperties()); } @Test @@ -112,7 +112,7 @@ void sslPropertiesWhenTrustStoreLocationAndCertificatesSetShouldThrowException() properties.getSsl().setTrustStoreLocation(new ClassPathResource("tsLoc")); properties.getSsl().setTrustStoreCertificates("-----BEGIN"); assertThatExceptionOfType(MutuallyExclusiveConfigurationPropertiesException.class) - .isThrownBy(() -> properties.buildConsumerProperties(null)); + .isThrownBy(() -> properties.buildConsumerProperties()); } @Test