This commit is contained in:
Phillip Webb
2017-07-06 16:52:53 -07:00
parent 222a09cfd3
commit aa57ca7e18
26 changed files with 191 additions and 173 deletions

View File

@@ -65,7 +65,6 @@ final class EnvironmentConverter {
* environment is already a {@code StandardEnvironment} and is not a
* {@link ConfigurableWebEnvironment} no conversion is performed and it is returned
* unchanged.
*
* @param environment The Environment to convert
* @return The converted Environment
*/

View File

@@ -101,8 +101,8 @@ import org.springframework.validation.BindException;
* @author Andy Wilkinson
* @author Eddú Meléndez
*/
public class ConfigFileApplicationListener implements EnvironmentPostProcessor,
SmartApplicationListener, Ordered {
public class ConfigFileApplicationListener
implements EnvironmentPostProcessor, SmartApplicationListener, Ordered {
private static final String DEFAULT_PROPERTIES = "defaultProperties";
@@ -153,8 +153,8 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor,
@Override
public boolean supportsEventType(Class<? extends ApplicationEvent> eventType) {
return ApplicationEnvironmentPreparedEvent.class.isAssignableFrom(eventType) ||
ApplicationPreparedEvent.class.isAssignableFrom(eventType);
return ApplicationEnvironmentPreparedEvent.class.isAssignableFrom(eventType)
|| ApplicationPreparedEvent.class.isAssignableFrom(eventType);
}
@Override

View File

@@ -321,7 +321,6 @@ public class UndertowEmbeddedServletContainerFactory
keyManagerFactory.getKeyManagers());
}
return keyManagerFactory.getKeyManagers();
}
catch (Exception ex) {
throw new IllegalStateException(ex);

View File

@@ -420,8 +420,8 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc
if (AnnotatedElementUtils.hasAnnotation(type, Validated.class)) {
return true;
}
if (type.getPackage() != null &&
type.getPackage().getName().startsWith("org.springframework.boot")) {
if (type.getPackage() != null && type.getPackage().getName()
.startsWith("org.springframework.boot")) {
return false;
}
if (getConstraintsForClass(type).isBeanConstrained()) {

View File

@@ -346,7 +346,7 @@ public class LoggingApplicationListener implements GenericApplicationListener {
String name = entry.getKey();
if (name.equalsIgnoreCase(LoggingSystem.ROOT_LOGGER_NAME)) {
if (rootProcessed) {
return;
continue;
}
name = null;
rootProcessed = true;

View File

@@ -257,8 +257,11 @@ public class UndertowEmbeddedServletContainerFactoryTests
UndertowEmbeddedServletContainerFactory factory = getFactory();
Ssl ssl = getSsl(null, "password", "src/test/resources/test.jks");
factory.setSsl(ssl);
KeyManager[] keyManagers = ReflectionTestUtils.invokeMethod(factory, "getKeyManagers");
Class<?> name = Class.forName("org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory$ConfigurableAliasKeyManager");
KeyManager[] keyManagers = ReflectionTestUtils.invokeMethod(factory,
"getKeyManagers");
Class<?> name = Class
.forName("org.springframework.boot.context.embedded.undertow."
+ "UndertowEmbeddedServletContainerFactory$ConfigurableAliasKeyManager");
assertThat(keyManagers[0]).isNotInstanceOf(name);
}

View File

@@ -485,10 +485,14 @@ public class LoggingApplicationListenerTests {
}
@Test
public void lowPriorityPropertySourceShouldNotOverrideRootLoggerConfig() throws Exception {
MutablePropertySources propertySources = this.context.getEnvironment().getPropertySources();
propertySources.addFirst(new MapPropertySource("test1", Collections.<String, Object>singletonMap("logging.level.ROOT", "DEBUG")));
propertySources.addLast(new MapPropertySource("test2", Collections.<String, Object>singletonMap("logging.level.root", "WARN")));
public void lowPriorityPropertySourceShouldNotOverrideRootLoggerConfig()
throws Exception {
MutablePropertySources propertySources = this.context.getEnvironment()
.getPropertySources();
propertySources.addFirst(new MapPropertySource("test1",
Collections.<String, Object>singletonMap("logging.level.ROOT", "DEBUG")));
propertySources.addLast(new MapPropertySource("test2",
Collections.<String, Object>singletonMap("logging.level.root", "WARN")));
this.initializer.initialize(this.context.getEnvironment(),
this.context.getClassLoader());
this.logger.debug("testatdebug");