Skip to content

Commit 565ec07

Browse files
committed
Merge branch '3.3.x'
Closes gh-43448
2 parents 51c9925 + 3338c22 commit 565ec07

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,18 @@ private Map<String, Object> buildCommonProperties(SslBundles sslBundles) {
177177
return properties;
178178
}
179179

180+
/**
181+
* Create an initial map of consumer properties from the state of this instance.
182+
* <p>
183+
* This allows you to add additional properties, if necessary, and override the
184+
* default {@code kafkaConsumerFactory} bean.
185+
* @return the consumer properties initialized with the customizations defined on this
186+
* instance
187+
*/
188+
public Map<String, Object> buildConsumerProperties() {
189+
return buildConsumerProperties(null);
190+
}
191+
180192
/**
181193
* Create an initial map of consumer properties from the state of this instance.
182194
* <p>
@@ -192,6 +204,18 @@ public Map<String, Object> buildConsumerProperties(SslBundles sslBundles) {
192204
return properties;
193205
}
194206

207+
/**
208+
* Create an initial map of producer properties from the state of this instance.
209+
* <p>
210+
* This allows you to add additional properties, if necessary, and override the
211+
* default {@code kafkaProducerFactory} bean.
212+
* @return the producer properties initialized with the customizations defined on this
213+
* instance
214+
*/
215+
public Map<String, Object> buildProducerProperties() {
216+
return buildProducerProperties(null);
217+
}
218+
195219
/**
196220
* Create an initial map of producer properties from the state of this instance.
197221
* <p>

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/ClientsConfiguredCondition.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
* @author Madhura Bhave
3737
* @since 2.1.0
3838
*/
39-
4039
public class ClientsConfiguredCondition extends SpringBootCondition {
4140

4241
private static final Bindable<Map<String, OAuth2ClientProperties.Registration>> STRING_REGISTRATION_MAP = Bindable

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void sslPemConfiguration() {
8080
properties.getSsl().setKeyStoreKey("-----BEGINkey");
8181
properties.getSsl().setTrustStoreCertificates("-----BEGINtrust");
8282
properties.getSsl().setKeyStoreCertificateChain("-----BEGINchain");
83-
Map<String, Object> consumerProperties = properties.buildConsumerProperties(null);
83+
Map<String, Object> consumerProperties = properties.buildConsumerProperties();
8484
assertThat(consumerProperties).containsEntry(SslConfigs.SSL_KEYSTORE_KEY_CONFIG, "-----BEGINkey");
8585
assertThat(consumerProperties).containsEntry(SslConfigs.SSL_TRUSTSTORE_CERTIFICATES_CONFIG, "-----BEGINtrust");
8686
assertThat(consumerProperties).containsEntry(SslConfigs.SSL_KEYSTORE_CERTIFICATE_CHAIN_CONFIG,
@@ -103,7 +103,7 @@ void sslPropertiesWhenKeyStoreLocationAndKeySetShouldThrowException() {
103103
properties.getSsl().setKeyStoreKey("-----BEGIN");
104104
properties.getSsl().setKeyStoreLocation(new ClassPathResource("ksLoc"));
105105
assertThatExceptionOfType(MutuallyExclusiveConfigurationPropertiesException.class)
106-
.isThrownBy(() -> properties.buildConsumerProperties(null));
106+
.isThrownBy(() -> properties.buildConsumerProperties());
107107
}
108108

109109
@Test
@@ -112,7 +112,7 @@ void sslPropertiesWhenTrustStoreLocationAndCertificatesSetShouldThrowException()
112112
properties.getSsl().setTrustStoreLocation(new ClassPathResource("tsLoc"));
113113
properties.getSsl().setTrustStoreCertificates("-----BEGIN");
114114
assertThatExceptionOfType(MutuallyExclusiveConfigurationPropertiesException.class)
115-
.isThrownBy(() -> properties.buildConsumerProperties(null));
115+
.isThrownBy(() -> properties.buildConsumerProperties());
116116
}
117117

118118
@Test

0 commit comments

Comments
 (0)