mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-25 10:59:03 +00:00
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:
committed by
Stéphane Nicoll
parent
d33962f37b
commit
cfc1e89976
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
+6
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user