diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/CorsEndpointProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/CorsEndpointProperties.java index d5dde9984d..287b70f921 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/CorsEndpointProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/CorsEndpointProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,34 +37,32 @@ import org.springframework.web.cors.CorsConfiguration; public class CorsEndpointProperties { /** - * Comma-separated list of origins to allow. '*' allows all origins. When credentials - * are allowed, '*' cannot be used and origin patterns should be configured instead. - * When no allowed origins or allowed origin patterns are set, CORS support is - * disabled. + * List of origins to allow. '*' allows all origins. When credentials are allowed, '*' + * cannot be used and origin patterns should be configured instead. When no allowed + * origins or allowed origin patterns are set, CORS support is disabled. */ private List allowedOrigins = new ArrayList<>(); /** - * Comma-separated list of origin patterns to allow. Unlike allowed origins which only - * supports '*', origin patterns are more flexible (for example - * 'https://*.example.com') and can be used when credentials are allowed. When no - * allowed origin patterns or allowed origins are set, CORS support is disabled. + * List of origin patterns to allow. Unlike allowed origins which only supports '*', + * origin patterns are more flexible (for example 'https://*.example.com') and can be + * used when credentials are allowed. When no allowed origin patterns or allowed + * origins are set, CORS support is disabled. */ private List allowedOriginPatterns = new ArrayList<>(); /** - * Comma-separated list of methods to allow. '*' allows all methods. When not set, - * defaults to GET. + * List of methods to allow. '*' allows all methods. When not set, defaults to GET. */ private List allowedMethods = new ArrayList<>(); /** - * Comma-separated list of headers to allow in a request. '*' allows all headers. + * List of headers to allow in a request. '*' allows all headers. */ private List allowedHeaders = new ArrayList<>(); /** - * Comma-separated list of headers to include in a response. + * List of headers to include in a response. */ private List exposedHeaders = new ArrayList<>(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthProperties.java index db991e5676..540254b50e 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthProperties.java @@ -78,7 +78,7 @@ public abstract class HealthProperties { public static class Status { /** - * Comma-separated list of health statuses in order of severity. + * List of health statuses in order of severity. */ private List order = new ArrayList<>(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java index 6ed7759cd1..8a85337446 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -200,7 +200,7 @@ public class MetricsProperties { public static class Diskspace { /** - * Comma-separated list of paths to report disk metrics for. + * List of paths to report disk metrics for. */ private List paths = new ArrayList<>(Collections.singletonList(new File("."))); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/PropertiesRabbitConnectionDetails.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/PropertiesRabbitConnectionDetails.java index 1ac95b513f..5f4a31398b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/PropertiesRabbitConnectionDetails.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/PropertiesRabbitConnectionDetails.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ class PropertiesRabbitConnectionDetails implements RabbitConnectionDetails { @Override public List
getAddresses() { List
addresses = new ArrayList<>(); - for (String address : this.properties.determineAddresses().split(",")) { + for (String address : this.properties.determineAddresses()) { int portSeparatorIndex = address.lastIndexOf(':'); String host = address.substring(0, portSeparatorIndex); String port = address.substring(portSeparatorIndex + 1); 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 abc949cad3..1510e9adbe 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 @@ -92,10 +92,10 @@ public class RabbitProperties { private String virtualHost; /** - * Comma-separated list of addresses to which the client should connect. When set, the - * host and port are ignored. + * List of addresses to which the client should connect. When set, the host and port + * are ignored. */ - private String addresses; + private List addresses; /** * Mode used to shuffle configured addresses. @@ -163,7 +163,7 @@ public class RabbitProperties { * Returns the host from the first address, or the configured host if no addresses * have been set. * @return the host - * @see #setAddresses(String) + * @see #setAddresses(List) * @see #getHost() */ public String determineHost() { @@ -185,7 +185,7 @@ public class RabbitProperties { * Returns the port from the first address, or the configured port if no addresses * have been set. * @return the port - * @see #setAddresses(String) + * @see #setAddresses(List) * @see #getPort() */ public int determinePort() { @@ -203,38 +203,38 @@ public class RabbitProperties { this.port = port; } - public String getAddresses() { + public List getAddresses() { return this.addresses; } /** - * Returns the comma-separated addresses or a single address ({@code host:port}) - * created from the configured host and port if no addresses have been set. + * Returns the configured addresses or a single address ({@code host:port}) created + * from the configured host and port if no addresses have been set. * @return the addresses */ - public String determineAddresses() { + public List determineAddresses() { if (CollectionUtils.isEmpty(this.parsedAddresses)) { if (this.host.contains(",")) { throw new InvalidConfigurationPropertyValueException("spring.rabbitmq.host", this.host, "Invalid character ','. Value must be a single host. For multiple hosts, use property 'spring.rabbitmq.addresses' instead."); } - return this.host + ":" + determinePort(); + return List.of(this.host + ":" + determinePort()); } List addressStrings = new ArrayList<>(); for (Address parsedAddress : this.parsedAddresses) { addressStrings.add(parsedAddress.host + ":" + parsedAddress.port); } - return StringUtils.collectionToCommaDelimitedString(addressStrings); + return addressStrings; } - public void setAddresses(String addresses) { + public void setAddresses(List addresses) { this.addresses = addresses; this.parsedAddresses = parseAddresses(addresses); } - private List
parseAddresses(String addresses) { + private List
parseAddresses(List addresses) { List
parsedAddresses = new ArrayList<>(); - for (String address : StringUtils.commaDelimitedListToStringArray(addresses)) { + for (String address : addresses) { parsedAddresses.add(new Address(address, Optional.ofNullable(getSsl().getEnabled()).orElse(false))); } return parsedAddresses; @@ -248,7 +248,7 @@ public class RabbitProperties { * If addresses have been set and the first address has a username it is returned. * Otherwise returns the result of calling {@code getUsername()}. * @return the username - * @see #setAddresses(String) + * @see #setAddresses(List) * @see #getUsername() */ public String determineUsername() { @@ -271,7 +271,7 @@ public class RabbitProperties { * If addresses have been set and the first address has a password it is returned. * Otherwise returns the result of calling {@code getPassword()}. * @return the password or {@code null} - * @see #setAddresses(String) + * @see #setAddresses(List) * @see #getPassword() */ public String determinePassword() { @@ -298,7 +298,7 @@ public class RabbitProperties { * If addresses have been set and the first address has a virtual host it is returned. * Otherwise returns the result of calling {@code getVirtualHost()}. * @return the virtual host or {@code null} - * @see #setAddresses(String) + * @see #setAddresses(List) * @see #getVirtualHost() */ public String determineVirtualHost() { @@ -471,7 +471,7 @@ public class RabbitProperties { * Returns whether SSL is enabled from the first address, or the configured ssl * enabled flag if no addresses have been set. * @return whether ssl is enabled - * @see #setAddresses(String) + * @see #setAddresses(List) * @see #getEnabled() () */ public boolean determineEnabled() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheProperties.java index 2a26704960..62ce77a718 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,8 +41,8 @@ public class CacheProperties { private CacheType type; /** - * Comma-separated list of cache names to create if supported by the underlying cache - * manager. Usually, this disables the ability to create additional caches on-the-fly. + * List of cache names to create if supported by the underlying cache manager. + * Usually, this disables the ability to create additional caches on-the-fly. */ private List cacheNames = new ArrayList<>(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/context/MessageSourceAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/context/MessageSourceAutoConfiguration.java index 68e04c7f01..56d6c5c10e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/context/MessageSourceAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/context/MessageSourceAutoConfiguration.java @@ -42,6 +42,7 @@ import org.springframework.core.Ordered; import org.springframework.core.io.Resource; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.core.type.AnnotatedTypeMetadata; +import org.springframework.util.CollectionUtils; import org.springframework.util.ConcurrentReferenceHashMap; import org.springframework.util.StringUtils; @@ -67,9 +68,8 @@ public class MessageSourceAutoConfiguration { @Bean public MessageSource messageSource(MessageSourceProperties properties) { ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); - if (StringUtils.hasText(properties.getBasename())) { - messageSource.setBasenames(StringUtils - .commaDelimitedListToStringArray(StringUtils.trimAllWhitespace(properties.getBasename()))); + if (!CollectionUtils.isEmpty(properties.getBasename())) { + messageSource.setBasenames(properties.getBasename().toArray(new String[0])); } if (properties.getEncoding() != null) { messageSource.setDefaultEncoding(properties.getEncoding().name()); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/context/MessageSourceProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/context/MessageSourceProperties.java index a765308af2..33bd1e4461 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/context/MessageSourceProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/context/MessageSourceProperties.java @@ -20,6 +20,8 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.convert.DurationUnit; @@ -35,12 +37,12 @@ import org.springframework.boot.convert.DurationUnit; public class MessageSourceProperties { /** - * Comma-separated list of basenames (essentially a fully-qualified classpath - * location), each following the ResourceBundle convention with relaxed support for - * slash based locations. If it doesn't contain a package qualifier (such as - * "org.mypackage"), it will be resolved from the classpath root. + * List of basenames (essentially a fully-qualified classpath location), each + * following the ResourceBundle convention with relaxed support for slash based + * locations. If it doesn't contain a package qualifier (such as "org.mypackage"), it + * will be resolved from the classpath root. */ - private String basename = "messages"; + private List basename = new ArrayList<>(List.of("messages")); /** * Message bundles encoding. @@ -73,11 +75,11 @@ public class MessageSourceProperties { */ private boolean useCodeAsDefaultMessage = false; - public String getBasename() { + public List getBasename() { return this.basename; } - public void setBasename(String basename) { + public void setBasename(List basename) { this.basename = basename; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisProperties.java index 91a58ac42f..8e5f07eb5b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -322,8 +322,8 @@ public class RedisProperties { public static class Cluster { /** - * Comma-separated list of "host:port" pairs to bootstrap from. This represents an - * "initial" list of cluster nodes and is required to have at least one entry. + * List of "host:port" pairs to bootstrap from. This represents an "initial" list + * of cluster nodes and is required to have at least one entry. */ private List nodes; @@ -362,7 +362,7 @@ public class RedisProperties { private String master; /** - * Comma-separated list of "host:port" pairs. + * List of "host:port" pairs. */ private List nodes; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchProperties.java index f9c15eaa99..a0325023ae 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; public class ElasticsearchProperties { /** - * Comma-separated list of the Elasticsearch instances to use. + * List of the Elasticsearch instances to use. */ private List uris = new ArrayList<>(Collections.singletonList("http://localhost:9200")); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java index a78e654e78..e65b1ad515 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java @@ -319,8 +319,8 @@ public class FlywayProperties { private Boolean skipExecutingMigrations; /** - * Ignore migrations that match this comma-separated list of patterns when validating - * migrations. Requires Flyway Teams. + * List of patterns that identify migrations to ignore when performing validation. + * Requires Flyway Teams. */ private List ignoreMigrationPatterns; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerProperties.java index 6e6087d57f..e25c7da057 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,7 @@ public class FreeMarkerProperties extends AbstractTemplateViewResolverProperties private Map settings = new HashMap<>(); /** - * Comma-separated list of template paths. + * List of template paths. */ private String[] templateLoaderPath = new String[] { DEFAULT_TEMPLATE_LOADER_PATH }; @@ -72,6 +72,10 @@ public class FreeMarkerProperties extends AbstractTemplateViewResolverProperties return this.templateLoaderPath; } + public void setTemplateLoaderPath(String... templateLoaderPaths) { + this.templateLoaderPath = templateLoaderPaths; + } + public boolean isPreferFileSystemAccess() { return this.preferFileSystemAccess; } @@ -80,8 +84,4 @@ public class FreeMarkerProperties extends AbstractTemplateViewResolverProperties this.preferFileSystemAccess = preferFileSystemAccess; } - public void setTemplateLoaderPath(String... templateLoaderPaths) { - this.templateLoaderPath = templateLoaderPaths; - } - } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/GraphQlCorsProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/GraphQlCorsProperties.java index 7611f4e3ee..ee9dbc1896 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/GraphQlCorsProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/GraphQlCorsProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,34 +38,34 @@ import org.springframework.web.cors.CorsConfiguration; public class GraphQlCorsProperties { /** - * Comma-separated list of origins to allow with '*' allowing all origins. When - * allow-credentials is enabled, '*' cannot be used, and setting origin patterns - * should be considered instead. When neither allowed origins nor allowed origin - * patterns are set, cross-origin requests are effectively disabled. + * List of origins to allow with '*' allowing all origins. When allow-credentials is + * enabled, '*' cannot be used, and setting origin patterns should be considered + * instead. When neither allowed origins nor allowed origin patterns are set, + * cross-origin requests are effectively disabled. */ private List allowedOrigins = new ArrayList<>(); /** - * Comma-separated list of origin patterns to allow. Unlike allowed origins which only - * support '*', origin patterns are more flexible, e.g. 'https://*.example.com', and - * can be used with allow-credentials. When neither allowed origins nor allowed origin - * patterns are set, cross-origin requests are effectively disabled. + * List of origin patterns to allow. Unlike allowed origins which only support '*', + * origin patterns are more flexible, e.g. 'https://*.example.com', and can be used + * with allow-credentials. When neither allowed origins nor allowed origin patterns + * are set, cross-origin requests are effectively disabled. */ private List allowedOriginPatterns = new ArrayList<>(); /** - * Comma-separated list of HTTP methods to allow. '*' allows all methods. When not - * set, defaults to GET. + * List of HTTP methods to allow. '*' allows all methods. When not set, defaults to + * GET. */ private List allowedMethods = new ArrayList<>(); /** - * Comma-separated list of HTTP headers to allow in a request. '*' allows all headers. + * List of HTTP headers to allow in a request. '*' allows all headers. */ private List allowedHeaders = new ArrayList<>(); /** - * Comma-separated list of headers to include in a response. + * List of headers to include in a response. */ private List exposedHeaders = new ArrayList<>(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationProperties.java index d5bffd5f1b..5b7d2bbf76 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationProperties.java @@ -130,14 +130,14 @@ public class IntegrationProperties { private boolean throwExceptionOnLateReply = false; /** - * A comma-separated list of message header names that should not be populated - * into Message instances during a header copying operation. + * List of message header names that should not be populated into Message + * instances during a header copying operation. */ private List readOnlyHeaders = new ArrayList<>(); /** - * A comma-separated list of endpoint bean names patterns that should not be - * started automatically during application startup. + * List of endpoint bean names patterns that should not be started automatically + * during application startup. */ private List noAutoStartup = new ArrayList<>(); @@ -430,11 +430,10 @@ public class IntegrationProperties { private boolean defaultLoggingEnabled = true; /** - * Comma-separated list of simple patterns to match against the names of Spring - * Integration components. When matched, observation instrumentation will be - * performed for the component. Please refer to the javadoc of the smartMatch - * method of Spring Integration's PatternMatchUtils for details of the pattern - * syntax. + * List of simple patterns to match against the names of Spring Integration + * components. When matched, observation instrumentation will be performed for the + * component. Please refer to the javadoc of the smartMatch method of Spring + * Integration's PatternMatchUtils for details of the pattern syntax. */ private List observationPatterns = new ArrayList<>(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java index 9c43a6b299..dc4bb98a2b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java @@ -177,8 +177,7 @@ public class ActiveMQProperties { private Boolean trustAll; /** - * Comma-separated list of specific packages to trust (when not trusting all - * packages). + * List of specific packages to trust (when not trusting all packages). */ private List trusted = new ArrayList<>(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisProperties.java index 15325c1c27..5341b5ab71 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -131,12 +131,12 @@ public class ArtemisProperties { private String dataDirectory; /** - * Comma-separated list of queues to create on startup. + * List of queues to create on startup. */ private String[] queues = new String[0]; /** - * Comma-separated list of topics to create on startup. + * List of topics to create on startup. */ private String[] topics = new String[0]; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java index 2a849fcda8..e97fbde487 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java @@ -65,8 +65,8 @@ import org.springframework.util.unit.DataSize; public class KafkaProperties { /** - * Comma-delimited list of host:port pairs to use for establishing the initial - * connections to the Kafka cluster. Applies to all components unless overridden. + * List of host:port pairs to use for establishing the initial connections to the + * Kafka cluster. Applies to all components unless overridden. */ private List bootstrapServers = new ArrayList<>(Collections.singletonList("localhost:9092")); @@ -255,8 +255,8 @@ public class KafkaProperties { private String autoOffsetReset; /** - * Comma-delimited list of host:port pairs to use for establishing the initial - * connections to the Kafka cluster. Overrides the global property, for consumers. + * List of host:port pairs to use for establishing the initial connections to the + * Kafka cluster. Overrides the global property, for consumers. */ private List bootstrapServers; @@ -483,8 +483,8 @@ public class KafkaProperties { private DataSize batchSize; /** - * Comma-delimited list of host:port pairs to use for establishing the initial - * connections to the Kafka cluster. Overrides the global property, for producers. + * List of host:port pairs to use for establishing the initial connections to the + * Kafka cluster. Overrides the global property, for producers. */ private List bootstrapServers; @@ -773,8 +773,8 @@ public class KafkaProperties { private boolean autoStartup = true; /** - * Comma-delimited list of host:port pairs to use for establishing the initial - * connections to the Kafka cluster. Overrides the global property, for streams. + * List of host:port pairs to use for establishing the initial connections to the + * Kafka cluster. Overrides the global property, for streams. */ private List bootstrapServers; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java index 66db731097..469f6a93e9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java @@ -52,6 +52,7 @@ import org.springframework.context.annotation.ImportRuntimeHints; import org.springframework.jdbc.core.ConnectionCallback; import org.springframework.jdbc.datasource.SimpleDriverDataSource; import org.springframework.util.Assert; +import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; /** @@ -105,7 +106,9 @@ public class LiquibaseAutoConfiguration { dataSource.getIfUnique(), connectionDetails); liquibase.setChangeLog(properties.getChangeLog()); liquibase.setClearCheckSums(properties.isClearChecksums()); - liquibase.setContexts(properties.getContexts()); + if (!CollectionUtils.isEmpty(properties.getContexts())) { + liquibase.setContexts(StringUtils.collectionToCommaDelimitedString(properties.getContexts())); + } liquibase.setDefaultSchema(properties.getDefaultSchema()); liquibase.setLiquibaseSchema(properties.getLiquibaseSchema()); liquibase.setLiquibaseTablespace(properties.getLiquibaseTablespace()); @@ -113,7 +116,9 @@ public class LiquibaseAutoConfiguration { liquibase.setDatabaseChangeLogLockTable(properties.getDatabaseChangeLogLockTable()); liquibase.setDropFirst(properties.isDropFirst()); liquibase.setShouldRun(properties.isEnabled()); - liquibase.setLabelFilter(properties.getLabelFilter()); + if (!CollectionUtils.isEmpty(properties.getLabelFilter())) { + liquibase.setLabelFilter(StringUtils.collectionToCommaDelimitedString(properties.getLabelFilter())); + } liquibase.setChangeLogParameters(properties.getParameters()); liquibase.setRollbackFile(properties.getRollbackFile()); liquibase.setTestRollbackOnUpdate(properties.isTestRollbackOnUpdate()); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java index b263b1a4db..7d1df83322 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java @@ -17,6 +17,7 @@ package org.springframework.boot.autoconfigure.liquibase; import java.io.File; +import java.util.List; import java.util.Map; import liquibase.UpdateSummaryEnum; @@ -51,9 +52,9 @@ public class LiquibaseProperties { private boolean clearChecksums; /** - * Comma-separated list of runtime contexts to use. + * List of runtime contexts to use. */ - private String contexts; + private List contexts; /** * Default database schema. @@ -112,9 +113,9 @@ public class LiquibaseProperties { private String url; /** - * Comma-separated list of runtime labels to use. + * List of runtime labels to use. */ - private String labelFilter; + private List labelFilter; /** * Change log parameters. @@ -162,11 +163,11 @@ public class LiquibaseProperties { this.changeLog = changeLog; } - public String getContexts() { + public List getContexts() { return this.contexts; } - public void setContexts(String contexts) { + public void setContexts(List contexts) { this.contexts = contexts; } @@ -266,11 +267,11 @@ public class LiquibaseProperties { this.url = url; } - public String getLabelFilter() { + public List getLabelFilter() { return this.labelFilter; } - public void setLabelFilter(String labelFilter) { + public void setLabelFilter(List labelFilter) { this.labelFilter = labelFilter; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafProperties.java index e03a8274ba..b1d32a5a2c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,13 +86,12 @@ public class ThymeleafProperties { private Integer templateResolverOrder; /** - * Comma-separated list of view names (patterns allowed) that can be resolved. + * List of view names (patterns allowed) that can be resolved. */ private String[] viewNames; /** - * Comma-separated list of view names (patterns allowed) that should be excluded from - * resolution. + * List of view names (patterns allowed) that should be excluded from resolution. */ private String[] excludedViewNames; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index 0142e34a69..31e15f6a98 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -465,21 +465,21 @@ public class ServerProperties { private int maxKeepAliveRequests = 100; /** - * Comma-separated list of additional patterns that match jars to ignore for TLD - * scanning. The special '?' and '*' characters can be used in the pattern to - * match one and only one character and zero or more characters respectively. + * List of additional patterns that match jars to ignore for TLD scanning. The + * special '?' and '*' characters can be used in the pattern to match one and only + * one character and zero or more characters respectively. */ private List additionalTldSkipPatterns = new ArrayList<>(); /** - * Comma-separated list of additional unencoded characters that should be allowed - * in URI paths. Only "< > [ \ ] ^ ` { | }" are allowed. + * List of additional unencoded characters that should be allowed in URI paths. + * Only "< > [ \ ] ^ ` { | }" are allowed. */ private List relaxedPathChars = new ArrayList<>(); /** - * Comma-separated list of additional unencoded characters that should be allowed - * in URI query strings. Only "< > [ \ ] ^ ` { | }" are allowed. + * List of additional unencoded characters that should be allowed in URI query + * strings. Only "< > [ \ ] ^ ` { | }" are allowed. */ private List relaxedQueryChars = new ArrayList<>(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebProperties.java index 5a9f73e6ea..4b834cd55c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebProperties.java @@ -251,8 +251,7 @@ public class WebProperties { private boolean enabled; /** - * Comma-separated list of patterns to apply to the content Version - * Strategy. + * List of patterns to apply to the content Version Strategy. */ private String[] paths = new String[] { "/**" }; @@ -293,8 +292,7 @@ public class WebProperties { private boolean enabled; /** - * Comma-separated list of patterns to apply to the fixed Version - * Strategy. + * List of patterns to apply to the fixed Version Strategy. */ private String[] paths = new String[] { "/**" }; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 4636c60190..74663a9ab6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -1986,6 +1986,12 @@ "type": "java.lang.Boolean", "defaultValue": false }, + { + "name": "spring.messages.basename", + "defaultValue": [ + "messages" + ] + }, { "name": "spring.mustache.prefix", "defaultValue": "classpath:/templates/" diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/PropertiesRabbitConnectionDetailsTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/PropertiesRabbitConnectionDetailsTests.java index fb4f65d9cf..a3b0162b06 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/PropertiesRabbitConnectionDetailsTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/PropertiesRabbitConnectionDetailsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ class PropertiesRabbitConnectionDetailsTests { @Test void getAddresses() { RabbitProperties properties = new RabbitProperties(); - properties.setAddresses("localhost,localhost:1234,[::1],[::1]:32863"); + properties.setAddresses(List.of("localhost", "localhost:1234", "[::1]", "[::1]:32863")); PropertiesRabbitConnectionDetails propertiesRabbitConnectionDetails = new PropertiesRabbitConnectionDetails( properties); List
addresses = propertiesRabbitConnectionDetails.getAddresses(); 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 06708ae217..333da3c895 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ package org.springframework.boot.autoconfigure.amqp; +import java.util.List; + import com.rabbitmq.client.ConnectionFactory; import org.junit.jupiter.api.Test; @@ -54,7 +56,7 @@ class RabbitPropertiesTests { @Test void hostIsDeterminedFromFirstAddress() { - this.properties.setAddresses("rabbit1.example.com:1234,rabbit2.example.com:2345"); + this.properties.setAddresses(List.of("rabbit1.example.com:1234", "rabbit2.example.com:2345")); assertThat(this.properties.determineHost()).isEqualTo("rabbit1.example.com"); } @@ -77,7 +79,7 @@ class RabbitPropertiesTests { @Test void determinePortReturnsPortOfFirstAddress() { - this.properties.setAddresses("rabbit1.example.com:1234,rabbit2.example.com:2345"); + this.properties.setAddresses(List.of("rabbit1.example.com:1234", "rabbit2.example.com:2345")); assertThat(this.properties.determinePort()).isEqualTo(1234); } @@ -101,19 +103,19 @@ class RabbitPropertiesTests { @Test void determinePortReturnsDefaultAmqpPortWhenFirstAddressHasNoExplicitPort() { this.properties.setPort(1234); - this.properties.setAddresses("rabbit1.example.com,rabbit2.example.com:2345"); + this.properties.setAddresses(List.of("rabbit1.example.com", "rabbit2.example.com:2345")); assertThat(this.properties.determinePort()).isEqualTo(5672); } @Test void determinePortUsingAmqpReturnsPortOfFirstAddress() { - this.properties.setAddresses("amqp://root:password@otherhost,amqps://root:password2@otherhost2"); + this.properties.setAddresses(List.of("amqp://root:password@otherhost", "amqps://root:password2@otherhost2")); assertThat(this.properties.determinePort()).isEqualTo(5672); } @Test void determinePortUsingAmqpsReturnsPortOfFirstAddress() { - this.properties.setAddresses("amqps://root:password@otherhost,amqp://root:password2@otherhost2"); + this.properties.setAddresses(List.of("amqps://root:password@otherhost", "amqp://root:password2@otherhost2")); assertThat(this.properties.determinePort()).isEqualTo(5671); } @@ -121,7 +123,7 @@ class RabbitPropertiesTests { void determinePortReturnsDefaultAmqpsPortWhenFirstAddressHasNoExplicitPortButSslEnabled() { this.properties.getSsl().setEnabled(true); this.properties.setPort(1234); - this.properties.setAddresses("rabbit1.example.com,rabbit2.example.com:2345"); + this.properties.setAddresses(List.of("rabbit1.example.com", "rabbit2.example.com:2345")); assertThat(this.properties.determinePort()).isEqualTo(5671); } @@ -144,7 +146,7 @@ class RabbitPropertiesTests { @Test void determineVirtualHostReturnsVirtualHostOfFirstAddress() { - this.properties.setAddresses("rabbit1.example.com:1234/alpha,rabbit2.example.com:2345/bravo"); + this.properties.setAddresses(List.of("rabbit1.example.com:1234/alpha", "rabbit2.example.com:2345/bravo")); assertThat(this.properties.determineVirtualHost()).isEqualTo("alpha"); } @@ -157,13 +159,13 @@ class RabbitPropertiesTests { @Test void determineVirtualHostReturnsPropertyWhenFirstAddressHasNoVirtualHost() { this.properties.setVirtualHost("alpha"); - this.properties.setAddresses("rabbit1.example.com:1234,rabbit2.example.com:2345/bravo"); + this.properties.setAddresses(List.of("rabbit1.example.com:1234", "rabbit2.example.com:2345/bravo")); assertThat(this.properties.determineVirtualHost()).isEqualTo("alpha"); } @Test void determineVirtualHostIsSlashWhenAddressHasTrailingSlash() { - this.properties.setAddresses("amqp://root:password@otherhost:1111/"); + this.properties.setAddresses(List.of("amqp://root:password@otherhost:1111/")); assertThat(this.properties.determineVirtualHost()).isEqualTo("/"); } @@ -186,7 +188,8 @@ class RabbitPropertiesTests { @Test void determineUsernameReturnsUsernameOfFirstAddress() { - this.properties.setAddresses("user:secret@rabbit1.example.com:1234/alpha,rabbit2.example.com:2345/bravo"); + this.properties + .setAddresses(List.of("user:secret@rabbit1.example.com:1234/alpha", "rabbit2.example.com:2345/bravo")); assertThat(this.properties.determineUsername()).isEqualTo("user"); } @@ -199,7 +202,8 @@ class RabbitPropertiesTests { @Test void determineUsernameReturnsPropertyWhenFirstAddressHasNoUsername() { this.properties.setUsername("alice"); - this.properties.setAddresses("rabbit1.example.com:1234/alpha,user:secret@rabbit2.example.com:2345/bravo"); + this.properties + .setAddresses(List.of("rabbit1.example.com:1234/alpha", "user:secret@rabbit2.example.com:2345/bravo")); assertThat(this.properties.determineUsername()).isEqualTo("alice"); } @@ -216,7 +220,8 @@ class RabbitPropertiesTests { @Test void determinePasswordReturnsPasswordOfFirstAddress() { - this.properties.setAddresses("user:secret@rabbit1.example.com:1234/alpha,rabbit2.example.com:2345/bravo"); + this.properties + .setAddresses(List.of("user:secret@rabbit1.example.com:1234/alpha", "rabbit2.example.com:2345/bravo")); assertThat(this.properties.determinePassword()).isEqualTo("secret"); } @@ -229,7 +234,8 @@ class RabbitPropertiesTests { @Test void determinePasswordReturnsPropertyWhenFirstAddressHasNoPassword() { this.properties.setPassword("12345678"); - this.properties.setAddresses("rabbit1.example.com:1234/alpha,user:secret@rabbit2.example.com:2345/bravo"); + this.properties + .setAddresses(List.of("rabbit1.example.com:1234/alpha", "user:secret@rabbit2.example.com:2345/bravo")); assertThat(this.properties.determinePassword()).isEqualTo("12345678"); } @@ -240,79 +246,80 @@ class RabbitPropertiesTests { @Test void customAddresses() { - this.properties.setAddresses("user:secret@rabbit1.example.com:1234/alpha,rabbit2.example.com"); - assertThat(this.properties.getAddresses()) - .isEqualTo("user:secret@rabbit1.example.com:1234/alpha,rabbit2.example.com"); + this.properties.setAddresses(List.of("user:secret@rabbit1.example.com:1234/alpha", "rabbit2.example.com")); + assertThat(this.properties.getAddresses()).containsExactly("user:secret@rabbit1.example.com:1234/alpha", + "rabbit2.example.com"); } @Test void ipv6Address() { - this.properties.setAddresses("amqp://foo:bar@[aaaa:bbbb:cccc::d]:1234"); + this.properties.setAddresses(List.of("amqp://foo:bar@[aaaa:bbbb:cccc::d]:1234")); assertThat(this.properties.determineHost()).isEqualTo("[aaaa:bbbb:cccc::d]"); assertThat(this.properties.determinePort()).isEqualTo(1234); } @Test void ipv6AddressDefaultPort() { - this.properties.setAddresses("amqp://foo:bar@[aaaa:bbbb:cccc::d]"); + this.properties.setAddresses(List.of("amqp://foo:bar@[aaaa:bbbb:cccc::d]")); assertThat(this.properties.determineHost()).isEqualTo("[aaaa:bbbb:cccc::d]"); assertThat(this.properties.determinePort()).isEqualTo(5672); } @Test void determineAddressesReturnsAddressesWithJustHostAndPort() { - this.properties.setAddresses("user:secret@rabbit1.example.com:1234/alpha,rabbit2.example.com"); - assertThat(this.properties.determineAddresses()).isEqualTo("rabbit1.example.com:1234,rabbit2.example.com:5672"); + this.properties.setAddresses(List.of("user:secret@rabbit1.example.com:1234/alpha", "rabbit2.example.com")); + assertThat(this.properties.determineAddresses()).containsExactly("rabbit1.example.com:1234", + "rabbit2.example.com:5672"); } @Test void determineAddressesUsesDefaultWhenNoAddressesSet() { - assertThat(this.properties.determineAddresses()).isEqualTo("localhost:5672"); + assertThat(this.properties.determineAddresses()).containsExactly("localhost:5672"); } @Test void determineAddressesWithSslUsesDefaultWhenNoAddressesSet() { this.properties.getSsl().setEnabled(true); - assertThat(this.properties.determineAddresses()).isEqualTo("localhost:5671"); + assertThat(this.properties.determineAddresses()).containsExactly("localhost:5671"); } @Test void determineAddressesUsesHostAndPortPropertiesWhenNoAddressesSet() { this.properties.setHost("rabbit.example.com"); this.properties.setPort(1234); - assertThat(this.properties.determineAddresses()).isEqualTo("rabbit.example.com:1234"); + assertThat(this.properties.determineAddresses()).containsExactly("rabbit.example.com:1234"); } @Test void determineAddressesUsesIpv6HostAndPortPropertiesWhenNoAddressesSet() { this.properties.setHost("[::1]"); this.properties.setPort(32863); - assertThat(this.properties.determineAddresses()).isEqualTo("[::1]:32863"); + assertThat(this.properties.determineAddresses()).containsExactly("[::1]:32863"); } @Test void determineSslUsingAmqpsReturnsStateOfFirstAddress() { - this.properties.setAddresses("amqps://root:password@otherhost,amqp://root:password2@otherhost2"); + this.properties.setAddresses(List.of("amqps://root:password@otherhost", "amqp://root:password2@otherhost2")); assertThat(this.properties.getSsl().determineEnabled()).isTrue(); } @Test void sslDetermineEnabledIsTrueWhenAddressHasNoProtocolAndSslIsEnabled() { this.properties.getSsl().setEnabled(true); - this.properties.setAddresses("root:password@otherhost"); + this.properties.setAddresses(List.of("root:password@otherhost")); assertThat(this.properties.getSsl().determineEnabled()).isTrue(); } @Test void sslDetermineEnabledIsFalseWhenAddressHasNoProtocolAndSslIsDisabled() { this.properties.getSsl().setEnabled(false); - this.properties.setAddresses("root:password@otherhost"); + this.properties.setAddresses(List.of("root:password@otherhost")); assertThat(this.properties.getSsl().determineEnabled()).isFalse(); } @Test void determineSslUsingAmqpReturnsStateOfFirstAddress() { - this.properties.setAddresses("amqp://root:password@otherhost,amqps://root:password2@otherhost2"); + this.properties.setAddresses(List.of("amqp://root:password@otherhost", "amqps://root:password2@otherhost2")); assertThat(this.properties.getSsl().determineEnabled()).isFalse(); } @@ -360,7 +367,7 @@ class RabbitPropertiesTests { @Test void determineUsernameWithoutPassword() { - this.properties.setAddresses("user@rabbit1.example.com:1234/alpha"); + this.properties.setAddresses(List.of("user@rabbit1.example.com:1234/alpha")); assertThat(this.properties.determineUsername()).isEqualTo("user"); assertThat(this.properties.determinePassword()).isEqualTo("guest"); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java index cc546cc1e9..87acfb7078 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java @@ -238,7 +238,7 @@ class LiquibaseAutoConfigurationTests { void overrideContexts() { this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) .withPropertyValues("spring.liquibase.contexts:test, production") - .run(assertLiquibase((liquibase) -> assertThat(liquibase.getContexts()).isEqualTo("test, production"))); + .run(assertLiquibase((liquibase) -> assertThat(liquibase.getContexts()).isEqualTo("test,production"))); } @Test @@ -391,7 +391,7 @@ class LiquibaseAutoConfigurationTests { void overrideLabelFilter() { this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) .withPropertyValues("spring.liquibase.label-filter:test, production") - .run(assertLiquibase((liquibase) -> assertThat(liquibase.getLabelFilter()).isEqualTo("test, production"))); + .run(assertLiquibase((liquibase) -> assertThat(liquibase.getLabelFilter()).isEqualTo("test,production"))); } @Test