Treat empty RabbitMQ SSL bundle as unset

See gh-50429

Signed-off-by: igormukhin <618760+igormukhin@users.noreply.github.com>
This commit is contained in:
igormukhin
2026-05-29 11:19:38 +02:00
committed by Stéphane Nicoll
parent d33962f37b
commit cfc1e89976
2 changed files with 7 additions and 1 deletions
@@ -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;
}
@@ -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();