Skip to content

Commit 19c7f5a

Browse files
committed
Merge pull request #50429 from igormukhin
* rabbitmq-empty-ssl-bundle: Treat empty RabbitMQ SSL bundle as unset Closes gh-50429
2 parents d33962f + cfc1e89 commit 19c7f5a

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ public Boolean getEnabled() {
474474
* @see #getEnabled() ()
475475
*/
476476
public boolean determineEnabled() {
477-
boolean defaultEnabled = Boolean.TRUE.equals(getEnabled()) || this.bundle != null;
477+
boolean defaultEnabled = Boolean.TRUE.equals(getEnabled()) || StringUtils.hasText(this.bundle);
478478
if (CollectionUtils.isEmpty(RabbitProperties.this.parsedAddresses)) {
479479
return defaultEnabled;
480480
}

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitPropertiesTests.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,12 @@ void determineSslEnabledIsTrueWhenBundleIsSetAndNoAddresses() {
335335
assertThat(this.properties.getSsl().determineEnabled()).isTrue();
336336
}
337337

338+
@Test
339+
void determineSslEnabledIsFalseWhenBundleIsEmpty() {
340+
this.properties.getSsl().setBundle("");
341+
assertThat(this.properties.getSsl().determineEnabled()).isFalse();
342+
}
343+
338344
@Test
339345
void propertiesUseConsistentDefaultValues() {
340346
ConnectionFactory connectionFactory = new ConnectionFactory();

0 commit comments

Comments
 (0)