Merge previously split strings
Merge some string lines that were previously split because of the 90 chars wide formatting.
This commit is contained in:
@@ -207,7 +207,7 @@ public class AutoConfigurationImportSelector implements DeferredImportSelector,
|
||||
message.append("\t- ").append(exclude).append(String.format("%n"));
|
||||
}
|
||||
throw new IllegalStateException(String.format(
|
||||
"The following classes could not be excluded because they are" + " not auto-configuration classes:%n%s",
|
||||
"The following classes could not be excluded because they are not auto-configuration classes:%n%s",
|
||||
message));
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
final class AutoConfigurationMetadataLoader {
|
||||
|
||||
protected static final String PATH = "META-INF/" + "spring-autoconfigure-metadata.properties";
|
||||
protected static final String PATH = "META-INF/spring-autoconfigure-metadata.properties";
|
||||
|
||||
private AutoConfigurationMetadataLoader() {
|
||||
}
|
||||
|
||||
@@ -196,8 +196,8 @@ public abstract class AutoConfigurationPackages {
|
||||
else {
|
||||
if (logger.isDebugEnabled()) {
|
||||
String packageNames = StringUtils.collectionToCommaDelimitedString(this.packages);
|
||||
logger.debug("@EnableAutoConfiguration was declared on a class " + "in the package '"
|
||||
+ packageNames + "'. Automatic @Repository and @Entity scanning is " + "enabled.");
|
||||
logger.debug("@EnableAutoConfiguration was declared on a class in the package '" + packageNames
|
||||
+ "'. Automatic @Repository and @Entity scanning is enabled.");
|
||||
}
|
||||
}
|
||||
this.loggedBasePackageInfo = true;
|
||||
|
||||
@@ -106,8 +106,8 @@ public class CacheAutoConfiguration {
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
Assert.notNull(this.cacheManager.getIfAvailable(),
|
||||
() -> "No cache manager could " + "be auto-configured, check your configuration (caching "
|
||||
+ "type is '" + this.cacheProperties.getType() + "')");
|
||||
() -> "No cache manager could be auto-configured, check your configuration (caching " + "type is '"
|
||||
+ this.cacheProperties.getType() + "')");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -405,7 +405,7 @@ class OnBeanCondition extends FilteringSpringBootCondition implements Configurat
|
||||
if (ex == null) {
|
||||
throw new IllegalStateException(message);
|
||||
}
|
||||
throw new IllegalStateException(message + " and the attempt to deduce" + " the bean's type failed", ex);
|
||||
throw new IllegalStateException(message + " and the attempt to deduce the bean's type failed", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class OnResourceCondition extends SpringBootCondition {
|
||||
List<String> locations = new ArrayList<>();
|
||||
collectValues(locations, attributes.get("resources"));
|
||||
Assert.isTrue(!locations.isEmpty(),
|
||||
"@ConditionalOnResource annotations must specify at " + "least one resource location");
|
||||
"@ConditionalOnResource annotations must specify at least one resource location");
|
||||
List<String> missing = new ArrayList<>();
|
||||
for (String location : locations) {
|
||||
String resource = context.getEnvironment().resolvePlaceholders(location);
|
||||
|
||||
@@ -51,7 +51,7 @@ public abstract class SpringBootCondition implements Condition {
|
||||
}
|
||||
catch (NoClassDefFoundError ex) {
|
||||
throw new IllegalStateException("Could not evaluate condition on " + classOrMethodName + " due to "
|
||||
+ ex.getMessage() + " not " + "found. Make sure your own configuration does not rely on "
|
||||
+ ex.getMessage() + " not found. Make sure your own configuration does not rely on "
|
||||
+ "that class. This can also happen if you are "
|
||||
+ "@ComponentScanning a springframework package (e.g. if you "
|
||||
+ "put a @ComponentScan in the default package by mistake)", ex);
|
||||
|
||||
@@ -123,7 +123,7 @@ abstract class RedisConnectionConfiguration {
|
||||
nodes.add(new RedisNode(parts[0], Integer.valueOf(parts[1])));
|
||||
}
|
||||
catch (RuntimeException ex) {
|
||||
throw new IllegalStateException("Invalid redis sentinel " + "property '" + node + "'", ex);
|
||||
throw new IllegalStateException("Invalid redis sentinel property '" + node + "'", ex);
|
||||
}
|
||||
}
|
||||
return nodes;
|
||||
|
||||
@@ -86,7 +86,7 @@ public class GroovyTemplateAutoConfiguration {
|
||||
if (!location.exists(this.applicationContext)) {
|
||||
logger.warn("Cannot find template location: " + location
|
||||
+ " (please add some templates, check your Groovy "
|
||||
+ "configuration, or set spring.groovy.template." + "check-template-location=false)");
|
||||
+ "configuration, or set spring.groovy.template.check-template-location=false)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class HazelcastProperties {
|
||||
return null;
|
||||
}
|
||||
Assert.isTrue(this.config.exists(),
|
||||
() -> "Hazelcast configuration does not " + "exist '" + this.config.getDescription() + "'");
|
||||
() -> "Hazelcast configuration does not exist '" + this.config.getDescription() + "'");
|
||||
return this.config;
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ public class HttpMessageConverters implements Iterable<HttpMessageConverter<?>>
|
||||
|
||||
private List<HttpMessageConverter<?>> getDefaultConverters() {
|
||||
List<HttpMessageConverter<?>> converters = new ArrayList<>();
|
||||
if (ClassUtils.isPresent("org.springframework.web.servlet.config.annotation." + "WebMvcConfigurationSupport",
|
||||
if (ClassUtils.isPresent("org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport",
|
||||
null)) {
|
||||
converters.addAll(new WebMvcConfigurationSupport() {
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ public class JacksonAutoConfiguration {
|
||||
if (logger.isWarnEnabled()) {
|
||||
logger.warn("spring.jackson.date-format could not be used to "
|
||||
+ "configure formatting of Joda's DateTime. You may want "
|
||||
+ "to configure spring.jackson.joda-date-time-format as " + "well.");
|
||||
+ "to configure spring.jackson.joda-date-time-format as well.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ class DataSourceBeanCreationFailureAnalyzer extends AbstractFailureAnalyzer<Data
|
||||
action.append(String.format("Consider the following:%n"));
|
||||
if (EmbeddedDatabaseConnection.NONE == cause.getConnection()) {
|
||||
action.append(String.format(
|
||||
"\tIf you want an embedded database (H2, HSQL or " + "Derby), please put it on the classpath.%n"));
|
||||
"\tIf you want an embedded database (H2, HSQL or Derby), please put it on the classpath.%n"));
|
||||
}
|
||||
else {
|
||||
action.append(String.format("\tReview the configuration of %s%n.", cause.getConnection()));
|
||||
|
||||
@@ -37,9 +37,9 @@ class HikariDriverConfigurationFailureAnalyzer extends AbstractFailureAnalyzer<C
|
||||
return null;
|
||||
}
|
||||
return new FailureAnalysis(
|
||||
"Configuration of the Hikari connection pool failed: " + "'dataSourceClassName' is not supported.",
|
||||
"Configuration of the Hikari connection pool failed: 'dataSourceClassName' is not supported.",
|
||||
"Spring Boot auto-configures only a driver and can't specify a custom "
|
||||
+ "DataSource. Consider configuring the Hikari DataSource in " + "your own configuration.",
|
||||
+ "DataSource. Consider configuring the Hikari DataSource in your own configuration.",
|
||||
cause);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ class ActiveMQConnectionFactoryFactory {
|
||||
return doCreateConnectionFactory(factoryClass);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new IllegalStateException("Unable to create " + "ActiveMQConnectionFactory", ex);
|
||||
throw new IllegalStateException("Unable to create ActiveMQConnectionFactory", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ class ArtemisConnectionFactoryFactory {
|
||||
return doCreateConnectionFactory(factoryClass);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new IllegalStateException("Unable to create " + "ActiveMQConnectionFactory", ex);
|
||||
throw new IllegalStateException("Unable to create ActiveMQConnectionFactory", ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ class ArtemisConnectionFactoryFactory {
|
||||
}
|
||||
catch (NoClassDefFoundError ex) {
|
||||
throw new IllegalStateException("Unable to create InVM "
|
||||
+ "Artemis connection, ensure that artemis-jms-server.jar " + "is in the classpath", ex);
|
||||
+ "Artemis connection, ensure that artemis-jms-server.jar is in the classpath", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ public class LiquibaseAutoConfiguration {
|
||||
if (this.properties.isCheckChangeLogLocation()) {
|
||||
Resource resource = this.resourceLoader.getResource(this.properties.getChangeLog());
|
||||
Assert.state(resource.exists(), () -> "Cannot find changelog location: " + resource
|
||||
+ " (please add changelog or check your Liquibase " + "configuration)");
|
||||
+ " (please add changelog or check your Liquibase configuration)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ public class ConditionEvaluationReportLoggingListener
|
||||
public void logAutoConfigurationReport(boolean isCrashReport) {
|
||||
if (this.report == null) {
|
||||
if (this.applicationContext == null) {
|
||||
this.logger.info("Unable to provide the conditions report " + "due to missing ApplicationContext");
|
||||
this.logger.info("Unable to provide the conditions report due to missing ApplicationContext");
|
||||
return;
|
||||
}
|
||||
this.report = ConditionEvaluationReport.get(this.applicationContext.getBeanFactory());
|
||||
|
||||
@@ -95,7 +95,7 @@ public class ReactiveMongoClientFactory {
|
||||
|
||||
private MongoClient createCredentialNetworkMongoClient(MongoClientSettings settings) {
|
||||
Assert.state(this.properties.getUri() == null,
|
||||
"Invalid mongo configuration, " + "either uri or host/port/credentials must be specified");
|
||||
"Invalid mongo configuration, either uri or host/port/credentials must be specified");
|
||||
Builder builder = builder(settings);
|
||||
if (hasCustomCredentials()) {
|
||||
applyCredentials(builder);
|
||||
|
||||
@@ -65,7 +65,7 @@ public class MustacheAutoConfiguration {
|
||||
TemplateLocation location = new TemplateLocation(this.mustache.getPrefix());
|
||||
if (!location.exists(this.applicationContext)) {
|
||||
logger.warn("Cannot find template location: " + location
|
||||
+ " (please add some templates, check your Mustache " + "configuration, or set spring.mustache."
|
||||
+ " (please add some templates, check your Mustache configuration, or set spring.mustache."
|
||||
+ "check-template-location=false)");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,8 +182,9 @@ class HibernateJpaConfiguration extends JpaBaseConfiguration {
|
||||
// NoClassDefFoundError can happen if Hibernate 4.2 is used and some
|
||||
// containers (e.g. JBoss EAP 6) wrap it in the superclass LinkageError
|
||||
if (!isUsingJndi()) {
|
||||
throw new IllegalStateException("Unable to set Hibernate JTA " + "platform, are you using the correct "
|
||||
+ "version of Hibernate?", ex);
|
||||
throw new IllegalStateException(
|
||||
"Unable to set Hibernate JTA platform, are you using the correct " + "version of Hibernate?",
|
||||
ex);
|
||||
}
|
||||
// Assume that Hibernate will use JNDI
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
||||
@@ -219,7 +219,7 @@ public abstract class JpaBaseConfiguration implements BeanFactoryAware {
|
||||
if (this.jpaProperties.getOpenInView() == null) {
|
||||
logger.warn("spring.jpa.open-in-view is enabled by default. "
|
||||
+ "Therefore, database queries may be performed during view "
|
||||
+ "rendering. Explicitly configure " + "spring.jpa.open-in-view to disable this warning");
|
||||
+ "rendering. Explicitly configure spring.jpa.open-in-view to disable this warning");
|
||||
}
|
||||
return new OpenEntityManagerInViewInterceptor();
|
||||
}
|
||||
|
||||
@@ -30,16 +30,15 @@ class NonUniqueSessionRepositoryFailureAnalyzer extends AbstractFailureAnalyzer<
|
||||
protected FailureAnalysis analyze(Throwable rootFailure, NonUniqueSessionRepositoryException cause) {
|
||||
StringBuilder message = new StringBuilder();
|
||||
message.append(
|
||||
String.format("Multiple Spring Session store implementations are " + "available on the classpath:%n"));
|
||||
String.format("Multiple Spring Session store implementations are available on the classpath:%n"));
|
||||
for (Class<?> candidate : cause.getAvailableCandidates()) {
|
||||
message.append(String.format(" - %s%n", candidate.getName()));
|
||||
}
|
||||
StringBuilder action = new StringBuilder();
|
||||
action.append(String.format("Consider any of the following:%n"));
|
||||
action.append(String
|
||||
.format(" - Define the `spring.session.store-type` " + "property to the store you want to use%n"));
|
||||
action.append(
|
||||
String.format(" - Review your classpath and remove the unwanted " + "store implementation(s)%n"));
|
||||
String.format(" - Define the `spring.session.store-type` property to the store you want to use%n"));
|
||||
action.append(String.format(" - Review your classpath and remove the unwanted store implementation(s)%n"));
|
||||
return new FailureAnalysis(message.toString(), action.toString(), cause);
|
||||
}
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@ public class ServerProperties {
|
||||
+ "169\\.254\\.\\d{1,3}\\.\\d{1,3}|" // 169.254/16
|
||||
+ "127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" // 127/8
|
||||
+ "172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
|
||||
+ "172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" + "172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}|" //
|
||||
+ "172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}|" //
|
||||
+ "0:0:0:0:0:0:0:1|::1";
|
||||
|
||||
/**
|
||||
|
||||
@@ -170,7 +170,7 @@ class AutoConfigurationImportSelectorTests {
|
||||
@Test
|
||||
void nonAutoConfigurationPropertyExclusionsWhenPresentOnClassPathShouldThrowException() {
|
||||
this.environment.setProperty("spring.autoconfigure.exclude",
|
||||
"org.springframework.boot.autoconfigure." + "AutoConfigurationImportSelectorTests.TestConfiguration");
|
||||
"org.springframework.boot.autoconfigure.AutoConfigurationImportSelectorTests.TestConfiguration");
|
||||
assertThatIllegalStateException().isThrownBy(() -> selectImports(BasicEnableAutoConfiguration.class));
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ class RabbitPropertiesTests {
|
||||
|
||||
@Test
|
||||
void determineUsernameReturnsUsernameOfFirstAddress() {
|
||||
this.properties.setAddresses("user:secret@rabbit1.example.com:1234/alpha," + "rabbit2.example.com:2345/bravo");
|
||||
this.properties.setAddresses("user:secret@rabbit1.example.com:1234/alpha,rabbit2.example.com:2345/bravo");
|
||||
assertThat(this.properties.determineUsername()).isEqualTo("user");
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ 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("rabbit1.example.com:1234/alpha,user:secret@rabbit2.example.com:2345/bravo");
|
||||
assertThat(this.properties.determineUsername()).isEqualTo("alice");
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ class RabbitPropertiesTests {
|
||||
|
||||
@Test
|
||||
void determinePasswordReturnsPasswordOfFirstAddress() {
|
||||
this.properties.setAddresses("user:secret@rabbit1.example.com:1234/alpha," + "rabbit2.example.com:2345/bravo");
|
||||
this.properties.setAddresses("user:secret@rabbit1.example.com:1234/alpha,rabbit2.example.com:2345/bravo");
|
||||
assertThat(this.properties.determinePassword()).isEqualTo("secret");
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ 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("rabbit1.example.com:1234/alpha,user:secret@rabbit2.example.com:2345/bravo");
|
||||
assertThat(this.properties.determinePassword()).isEqualTo("12345678");
|
||||
}
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ public class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationT
|
||||
@Test
|
||||
public void simpleCacheWithCustomizers() {
|
||||
this.contextRunner.withUserConfiguration(DefaultCacheAndCustomizersConfiguration.class)
|
||||
.withPropertyValues("spring.cache.type=" + "simple")
|
||||
.withPropertyValues("spring.cache.type=simple")
|
||||
.run(verifyCustomizers("allCacheManagerCustomizer", "simpleCacheManagerCustomizer"));
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ public class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationT
|
||||
@Test
|
||||
public void genericCacheWithCustomizers() {
|
||||
this.contextRunner.withUserConfiguration(GenericCacheAndCustomizersConfiguration.class)
|
||||
.withPropertyValues("spring.cache.type=" + "generic")
|
||||
.withPropertyValues("spring.cache.type=generic")
|
||||
.run(verifyCustomizers("allCacheManagerCustomizer", "genericCacheManagerCustomizer"));
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ public class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationT
|
||||
@Test
|
||||
public void couchbaseCacheWithCustomizers() {
|
||||
this.contextRunner.withUserConfiguration(CouchbaseCacheAndCustomizersConfiguration.class)
|
||||
.withPropertyValues("spring.cache.type=" + "couchbase")
|
||||
.withPropertyValues("spring.cache.type=couchbase")
|
||||
.run(verifyCustomizers("allCacheManagerCustomizer", "couchbaseCacheManagerCustomizer"));
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ public class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationT
|
||||
@Test
|
||||
public void redisCacheWithCustomizers() {
|
||||
this.contextRunner.withUserConfiguration(RedisWithCustomizersConfiguration.class)
|
||||
.withPropertyValues("spring.cache.type=" + "redis")
|
||||
.withPropertyValues("spring.cache.type=redis")
|
||||
.run(verifyCustomizers("allCacheManagerCustomizer", "redisCacheManagerCustomizer"));
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ public class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationT
|
||||
@Test
|
||||
public void hazelcastCacheWithCustomizers() {
|
||||
this.contextRunner.withUserConfiguration(HazelcastCacheAndCustomizersConfiguration.class)
|
||||
.withPropertyValues("spring.cache.type=" + "hazelcast")
|
||||
.withPropertyValues("spring.cache.type=hazelcast")
|
||||
.run(verifyCustomizers("allCacheManagerCustomizer", "hazelcastCacheManagerCustomizer"));
|
||||
}
|
||||
|
||||
@@ -541,7 +541,7 @@ public class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationT
|
||||
@Test
|
||||
public void infinispanCacheWithCustomizers() {
|
||||
this.contextRunner.withUserConfiguration(DefaultCacheAndCustomizersConfiguration.class)
|
||||
.withPropertyValues("spring.cache.type=" + "infinispan")
|
||||
.withPropertyValues("spring.cache.type=infinispan")
|
||||
.run(verifyCustomizers("allCacheManagerCustomizer", "infinispanCacheManagerCustomizer"));
|
||||
}
|
||||
|
||||
@@ -626,7 +626,7 @@ public class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationT
|
||||
@Test
|
||||
public void caffeineCacheWithCustomizers() {
|
||||
this.contextRunner.withUserConfiguration(DefaultCacheAndCustomizersConfiguration.class)
|
||||
.withPropertyValues("spring.cache.type=" + "caffeine")
|
||||
.withPropertyValues("spring.cache.type=caffeine")
|
||||
.run(verifyCustomizers("allCacheManagerCustomizer", "caffeineCacheManagerCustomizer"));
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ public class EhCache2CacheAutoConfigurationTests extends AbstractCacheAutoConfig
|
||||
@Test
|
||||
public void ehCacheWithCustomizers() {
|
||||
this.contextRunner.withUserConfiguration(DefaultCacheAndCustomizersConfiguration.class)
|
||||
.withPropertyValues("spring.cache.type=" + "ehcache")
|
||||
.withPropertyValues("spring.cache.type=ehcache")
|
||||
.run(verifyCustomizers("allCacheManagerCustomizer", "ehcacheCacheManagerCustomizer"));
|
||||
}
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ class ConditionEvaluationReportTests {
|
||||
}
|
||||
assertThat(messages).areAtLeastOne(Matched.by(containsString("@ConditionalOnClass found required classes "
|
||||
+ "'javax.servlet.Servlet', 'org.springframework.web.multipart."
|
||||
+ "support.StandardServletMultipartResolver', " + "'javax.servlet.MultipartConfigElement'")));
|
||||
+ "support.StandardServletMultipartResolver', 'javax.servlet.MultipartConfigElement'")));
|
||||
context.close();
|
||||
}
|
||||
|
||||
|
||||
@@ -158,21 +158,20 @@ class NoSuchBeanDefinitionFailureAnalyzerTests {
|
||||
private void assertDescriptionConstructorMissingType(FailureAnalysis analysis, Class<?> component, int index,
|
||||
Class<?> type) {
|
||||
String expected = String.format(
|
||||
"Parameter %s of constructor in %s required a bean of " + "type '%s' that could not be found.", index,
|
||||
"Parameter %s of constructor in %s required a bean of type '%s' that could not be found.", index,
|
||||
component.getName(), type.getName());
|
||||
assertThat(analysis.getDescription()).startsWith(expected);
|
||||
}
|
||||
|
||||
private void assertActionMissingType(FailureAnalysis analysis, Class<?> type) {
|
||||
assertThat(analysis.getAction()).startsWith(String.format(
|
||||
"Consider revisiting the entries above or defining a bean of type '%s' " + "in your configuration.",
|
||||
"Consider revisiting the entries above or defining a bean of type '%s' in your configuration.",
|
||||
type.getName()));
|
||||
}
|
||||
|
||||
private void assertActionMissingName(FailureAnalysis analysis, String name) {
|
||||
assertThat(analysis.getAction()).startsWith(String.format(
|
||||
"Consider revisiting the entries above or defining a bean named '%s' " + "in your configuration.",
|
||||
name));
|
||||
"Consider revisiting the entries above or defining a bean named '%s' in your configuration.", name));
|
||||
}
|
||||
|
||||
private void assertBeanMethodDisabled(FailureAnalysis analysis, String description, Class<?> target,
|
||||
|
||||
@@ -67,8 +67,7 @@ public class FreeMarkerAutoConfigurationTests {
|
||||
File emptyDirectory = new File(this.buildOutput.getTestResourcesLocation(), "empty-templates/empty-directory");
|
||||
emptyDirectory.mkdirs();
|
||||
this.contextRunner
|
||||
.withPropertyValues(
|
||||
"spring.freemarker.templateLoaderPath:" + "classpath:/empty-templates/empty-directory/")
|
||||
.withPropertyValues("spring.freemarker.templateLoaderPath:classpath:/empty-templates/empty-directory/")
|
||||
.run((context) -> assertThat(output).doesNotContain("Cannot find template location"));
|
||||
}
|
||||
|
||||
|
||||
@@ -80,8 +80,7 @@ class GroovyTemplateAutoConfigurationTests {
|
||||
@Test
|
||||
void emptyTemplateLocation() {
|
||||
new File(this.buildOutput.getTestResourcesLocation(), "empty-templates/empty-directory").mkdirs();
|
||||
registerAndRefreshContext(
|
||||
"spring.groovy.template.resource-loader-path:" + "classpath:/templates/empty-directory/");
|
||||
registerAndRefreshContext("spring.groovy.template.resource-loader-path:classpath:/templates/empty-directory/");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -66,15 +66,17 @@ class HazelcastAutoConfigurationClientTests {
|
||||
|
||||
@Test
|
||||
void systemPropertyWithXml() {
|
||||
this.contextRunner.withSystemProperties(HazelcastClientConfiguration.CONFIG_SYSTEM_PROPERTY
|
||||
+ "=classpath:org/springframework/boot/autoconfigure/hazelcast/" + "hazelcast-client-specific.xml")
|
||||
this.contextRunner
|
||||
.withSystemProperties(HazelcastClientConfiguration.CONFIG_SYSTEM_PROPERTY
|
||||
+ "=classpath:org/springframework/boot/autoconfigure/hazelcast/hazelcast-client-specific.xml")
|
||||
.run(assertSpecificHazelcastClient("explicit-xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void systemPropertyWithYaml() {
|
||||
this.contextRunner.withSystemProperties(HazelcastClientConfiguration.CONFIG_SYSTEM_PROPERTY
|
||||
+ "=classpath:org/springframework/boot/autoconfigure/hazelcast/" + "hazelcast-client-specific.yaml")
|
||||
this.contextRunner
|
||||
.withSystemProperties(HazelcastClientConfiguration.CONFIG_SYSTEM_PROPERTY
|
||||
+ "=classpath:org/springframework/boot/autoconfigure/hazelcast/hazelcast-client-specific.yaml")
|
||||
.run(assertSpecificHazelcastClient("explicit-yaml"));
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ class ProjectInfoAutoConfigurationTests {
|
||||
@Test
|
||||
void gitPropertiesFallbackWithGitPropertiesBean() {
|
||||
this.contextRunner.withUserConfiguration(CustomInfoPropertiesConfiguration.class).withPropertyValues(
|
||||
"spring.info.git.location=" + "classpath:/org/springframework/boot/autoconfigure/info/git.properties")
|
||||
"spring.info.git.location=classpath:/org/springframework/boot/autoconfigure/info/git.properties")
|
||||
.run((context) -> {
|
||||
GitProperties gitProperties = context.getBean(GitProperties.class);
|
||||
assertThat(gitProperties).isSameAs(context.getBean("customGitProperties"));
|
||||
@@ -115,8 +115,7 @@ class ProjectInfoAutoConfigurationTests {
|
||||
|
||||
@Test
|
||||
void buildPropertiesCustomInvalidLocation() {
|
||||
this.contextRunner
|
||||
.withPropertyValues("spring.info.build.location=" + "classpath:/org/acme/no-build-info.properties")
|
||||
this.contextRunner.withPropertyValues("spring.info.build.location=classpath:/org/acme/no-build-info.properties")
|
||||
.run((context) -> assertThat(context.getBeansOfType(BuildProperties.class)).hasSize(0));
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class DataSourceJmxConfigurationTests {
|
||||
|
||||
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
||||
.withPropertyValues("spring.datasource.url=" + "jdbc:hsqldb:mem:test-" + UUID.randomUUID())
|
||||
.withPropertyValues("spring.datasource.url=jdbc:hsqldb:mem:test-" + UUID.randomUUID())
|
||||
.withConfiguration(AutoConfigurations.of(JmxAutoConfiguration.class, DataSourceAutoConfiguration.class));
|
||||
|
||||
@Test
|
||||
|
||||
@@ -60,8 +60,9 @@ class HikariDataSourceConfigurationTests {
|
||||
|
||||
@Test
|
||||
void testDataSourceGenericPropertiesOverridden() {
|
||||
this.contextRunner.withPropertyValues(
|
||||
"spring.datasource.hikari.data-source-properties" + ".dataSourceClassName=org.h2.JDBCDataSource")
|
||||
this.contextRunner
|
||||
.withPropertyValues(
|
||||
"spring.datasource.hikari.data-source-properties.dataSourceClassName=org.h2.JDBCDataSource")
|
||||
.run((context) -> {
|
||||
HikariDataSource ds = context.getBean(HikariDataSource.class);
|
||||
assertThat(ds.getDataSourceProperties().getProperty("dataSourceClassName"))
|
||||
|
||||
@@ -40,7 +40,7 @@ class HikariDriverConfigurationFailureAnalyzerTests {
|
||||
FailureAnalysis failureAnalysis = performAnalysis(TestConfiguration.class);
|
||||
assertThat(failureAnalysis).isNotNull();
|
||||
assertThat(failureAnalysis.getDescription()).isEqualTo(
|
||||
"Configuration of the Hikari connection pool failed: " + "'dataSourceClassName' is not supported.");
|
||||
"Configuration of the Hikari connection pool failed: 'dataSourceClassName' is not supported.");
|
||||
assertThat(failureAnalysis.getAction()).contains("Spring Boot auto-configures only a driver");
|
||||
}
|
||||
|
||||
|
||||
@@ -86,9 +86,8 @@ class ConditionEvaluationReportLoggingListenerTests {
|
||||
context.register(ErrorConfig.class);
|
||||
assertThatExceptionOfType(Exception.class).isThrownBy(context::refresh).satisfies((ex) -> this.initializer
|
||||
.onApplicationEvent(new ApplicationFailedEvent(new SpringApplication(), new String[0], context, ex)));
|
||||
assertThat(output)
|
||||
.contains("Error starting" + " ApplicationContext. To display the conditions report re-run"
|
||||
+ " your application with 'debug' enabled.");
|
||||
assertThat(output).contains("Error starting ApplicationContext. To display the conditions report re-run"
|
||||
+ " your application with 'debug' enabled.");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -94,7 +94,7 @@ class MongoClientFactoryTests {
|
||||
@Test
|
||||
void uriCanBeCustomized() {
|
||||
MongoProperties properties = new MongoProperties();
|
||||
properties.setUri("mongodb://user:secret@mongo1.example.com:12345," + "mongo2.example.com:23456/test");
|
||||
properties.setUri("mongodb://user:secret@mongo1.example.com:12345,mongo2.example.com:23456/test");
|
||||
MongoClient client = createMongoClient(properties);
|
||||
List<ServerAddress> allAddresses = getAllAddresses(client);
|
||||
assertThat(allAddresses).hasSize(2);
|
||||
|
||||
@@ -98,7 +98,7 @@ class ReactiveMongoClientFactoryTests {
|
||||
@Test
|
||||
void uriCanBeCustomized() {
|
||||
MongoProperties properties = new MongoProperties();
|
||||
properties.setUri("mongodb://user:secret@mongo1.example.com:12345," + "mongo2.example.com:23456/test");
|
||||
properties.setUri("mongodb://user:secret@mongo1.example.com:12345,mongo2.example.com:23456/test");
|
||||
MongoClient client = createMongoClient(properties);
|
||||
List<ServerAddress> allAddresses = extractServerAddresses(client);
|
||||
assertThat(allAddresses).hasSize(2);
|
||||
@@ -123,7 +123,7 @@ class ReactiveMongoClientFactoryTests {
|
||||
properties.setUsername("user");
|
||||
properties.setPassword("secret".toCharArray());
|
||||
assertThatIllegalStateException().isThrownBy(() -> createMongoClient(properties)).withMessageContaining(
|
||||
"Invalid mongo configuration, " + "either uri or host/port/credentials must be specified");
|
||||
"Invalid mongo configuration, either uri or host/port/credentials must be specified");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -133,7 +133,7 @@ class ReactiveMongoClientFactoryTests {
|
||||
properties.setHost("localhost");
|
||||
properties.setPort(4567);
|
||||
assertThatIllegalStateException().isThrownBy(() -> createMongoClient(properties)).withMessageContaining(
|
||||
"Invalid mongo configuration, " + "either uri or host/port/credentials must be specified");
|
||||
"Invalid mongo configuration, either uri or host/port/credentials must be specified");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -232,7 +232,7 @@ class TomcatWebServerFactoryCustomizerTests {
|
||||
+ "169\\.254\\.\\d{1,3}\\.\\d{1,3}|" // 169.254/16
|
||||
+ "127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" // 127/8
|
||||
+ "172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
|
||||
+ "172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" + "172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}|" //
|
||||
+ "172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}|" //
|
||||
+ "0:0:0:0:0:0:0:1|::1";
|
||||
assertThat(remoteIpValve.getInternalProxies()).isEqualTo(expectedInternalProxies);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ class ReactiveWebServerFactoryAutoConfigurationTests {
|
||||
TooManyHttpHandlers.class)
|
||||
.run((context) -> assertThat(context.getStartupFailure())
|
||||
.isInstanceOf(ApplicationContextException.class)
|
||||
.hasMessageContaining("multiple HttpHandler beans : " + "httpHandler,additionalHttpHandler"));
|
||||
.hasMessageContaining("multiple HttpHandler beans : httpHandler,additionalHttpHandler"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -73,7 +73,7 @@ class ErrorMvcAutoConfigurationTests {
|
||||
webRequest.getResponse());
|
||||
assertThat(output).contains("Cannot render error page for request [/path] "
|
||||
+ "and exception [Exception message] as the response has "
|
||||
+ "already been committed. As a result, the response may " + "have the wrong status code.");
|
||||
+ "already been committed. As a result, the response may have the wrong status code.");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user