Polish
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -321,7 +321,6 @@ public class UndertowEmbeddedServletContainerFactory
|
||||
keyManagerFactory.getKeyManagers());
|
||||
}
|
||||
return keyManagerFactory.getKeyManagers();
|
||||
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new IllegalStateException(ex);
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user