diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java index f7ebb20ef33..89009ecbe81 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java @@ -474,7 +474,7 @@ public class RabbitProperties { * @see #getEnabled() () */ public boolean determineEnabled() { - boolean defaultEnabled = Boolean.TRUE.equals(getEnabled()) || this.bundle != null; + boolean defaultEnabled = Boolean.TRUE.equals(getEnabled()) || StringUtils.hasText(this.bundle); if (CollectionUtils.isEmpty(RabbitProperties.this.parsedAddresses)) { return defaultEnabled; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitPropertiesTests.java index 54bfb6985bf..df69eca39ea 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitPropertiesTests.java @@ -335,6 +335,12 @@ class RabbitPropertiesTests { assertThat(this.properties.getSsl().determineEnabled()).isTrue(); } + @Test + void determineSslEnabledIsFalseWhenBundleIsEmpty() { + this.properties.getSsl().setBundle(""); + assertThat(this.properties.getSsl().determineEnabled()).isFalse(); + } + @Test void propertiesUseConsistentDefaultValues() { ConnectionFactory connectionFactory = new ConnectionFactory();