This commit is contained in:
Phillip Webb
2018-02-26 10:23:23 -08:00
parent 306c79f0de
commit 29c3be3590
27 changed files with 69 additions and 67 deletions

View File

@@ -358,8 +358,7 @@ public final class ConditionMessage {
* @return a built {@link ConditionMessage}
*/
public ConditionMessage items(Style style, Object... items) {
return items(style,
items == null ? null : Arrays.asList(items));
return items(style, items == null ? null : Arrays.asList(items));
}
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 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.

View File

@@ -250,11 +250,11 @@ public class SessionAutoConfiguration {
if (storeType != StoreType.NONE
&& this.sessionRepositoryProvider.getIfAvailable() == null) {
if (storeType != null) {
throw new SessionRepositoryUnavailableException("No session "
+ "repository could be auto-configured, check your "
+ "configuration (session store type is '"
+ storeType.name().toLowerCase(Locale.ENGLISH)
+ "')", storeType);
throw new SessionRepositoryUnavailableException(
"No session repository could be auto-configured, check your "
+ "configuration (session store type is '"
+ storeType.name().toLowerCase(Locale.ENGLISH) + "')",
storeType);
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 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.

View File

@@ -86,18 +86,14 @@ public class MessageSourceAutoConfigurationTests {
@Test
public void testCacheDurationNoUnit() {
this.contextRunner
.withPropertyValues("spring.messages.basename:test/messages",
"spring.messages.cache-duration=10")
.run(assertCache(10 * 1000));
this.contextRunner.withPropertyValues("spring.messages.basename:test/messages",
"spring.messages.cache-duration=10").run(assertCache(10 * 1000));
}
@Test
public void testCacheDurationWithUnit() {
this.contextRunner
.withPropertyValues("spring.messages.basename:test/messages",
"spring.messages.cache-duration=1m")
.run(assertCache(60 * 1000));
this.contextRunner.withPropertyValues("spring.messages.basename:test/messages",
"spring.messages.cache-duration=1m").run(assertCache(60 * 1000));
}
private ContextConsumer<AssertableApplicationContext> assertCache(long expected) {

View File

@@ -47,7 +47,8 @@ public class RedisAutoConfigurationJedisTests {
@Test
public void testOverrideRedisConfiguration() {
this.contextRunner.withPropertyValues("spring.redis.host:foo", "spring.redis.database:1")
this.contextRunner
.withPropertyValues("spring.redis.host:foo", "spring.redis.database:1")
.run((context) -> {
JedisConnectionFactory cf = context
.getBean(JedisConnectionFactory.class);
@@ -60,10 +61,12 @@ public class RedisAutoConfigurationJedisTests {
@Test
public void testCustomizeRedisConfiguration() {
this.contextRunner.withUserConfiguration(CustomConfiguration.class).run((context) -> {
JedisConnectionFactory cf = context.getBean(JedisConnectionFactory.class);
assertThat(cf.isUseSsl()).isTrue();
});
this.contextRunner.withUserConfiguration(CustomConfiguration.class)
.run((context) -> {
JedisConnectionFactory cf = context
.getBean(JedisConnectionFactory.class);
assertThat(cf.isUseSsl()).isTrue();
});
}
@Test
@@ -99,7 +102,8 @@ public class RedisAutoConfigurationJedisTests {
@Test
public void testPasswordInUrlWithColon() {
this.contextRunner.withPropertyValues("spring.redis.url:redis://:pass:word@example:33")
this.contextRunner
.withPropertyValues("spring.redis.url:redis://:pass:word@example:33")
.run((context) -> {
assertThat(
context.getBean(JedisConnectionFactory.class).getHostName())

View File

@@ -72,8 +72,8 @@ public class MustacheAutoConfigurationReactiveIntegrationTests {
}
@Configuration
@Import({ ReactiveWebServerFactoryAutoConfiguration.class, WebFluxAutoConfiguration.class,
HttpHandlerAutoConfiguration.class,
@Import({ ReactiveWebServerFactoryAutoConfiguration.class,
WebFluxAutoConfiguration.class, HttpHandlerAutoConfiguration.class,
PropertyPlaceholderAutoConfiguration.class })
@Controller
public static class Application {

View File

@@ -42,8 +42,7 @@ public class ReactiveWebServerFactoryCustomizerTests {
@Before
public void setup() {
this.customizer = new ReactiveWebServerFactoryCustomizer(
this.properties);
this.customizer = new ReactiveWebServerFactoryCustomizer(this.properties);
}
@Test

View File

@@ -62,8 +62,7 @@ public class ServletWebServerFactoryCustomizerTests {
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
this.customizer = new ServletWebServerFactoryCustomizer(
this.properties);
this.customizer = new ServletWebServerFactoryCustomizer(this.properties);
}
@Test