From 4a7dcc8786b8504a0c20a00282e257a59ff4ccd2 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 9 May 2017 21:43:24 -0700 Subject: [PATCH 1/2] Formatting --- .../endpoint/mvc/EnvironmentMvcEndpoint.java | 3 +- .../endpoint/EnvironmentEndpointTests.java | 35 +++++++++---------- .../mvc/EnvironmentMvcEndpointTests.java | 5 ++- .../amqp/RabbitAutoConfigurationTests.java | 5 +-- 4 files changed, 23 insertions(+), 25 deletions(-) diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpoint.java index 1f101b38ecf..cac00aacd3c 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpoint.java @@ -93,7 +93,8 @@ public class EnvironmentMvcEndpoint extends EndpointMvcAdapter @Override protected Object getOptionalValue(Environment source, String name) { - Object result = ((EnvironmentEndpoint) getDelegate()).getResolver().getProperty(name, Object.class); + Object result = ((EnvironmentEndpoint) getDelegate()).getResolver() + .getProperty(name, Object.class); if (result != null) { result = ((EnvironmentEndpoint) getDelegate()).sanitize(name, result); } diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpointTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpointTests.java index f94e149d0c8..f2a7ffc3647 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpointTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpointTests.java @@ -112,8 +112,9 @@ public class EnvironmentEndpointTests extends AbstractEndpointTests env = report.invoke(); - Map testProperties = (Map) env - .get("test"); + Map testProperties = (Map) env.get("test"); assertThat(testProperties.get("my.foo")).isEqualTo("hello"); } @@ -223,14 +223,12 @@ public class EnvironmentEndpointTests extends AbstractEndpointTests env = report.invoke(); - Map testProperties = (Map) env - .get("test"); + Map testProperties = (Map) env.get("test"); assertThat(testProperties.get("my.foo")).isEqualTo("${bar.blah}"); } @@ -244,8 +242,7 @@ public class EnvironmentEndpointTests extends AbstractEndpointTests env = report.invoke(); - Map testProperties = (Map) env - .get("test"); + Map testProperties = (Map) env.get("test"); assertThat(testProperties.get("my.foo")).isEqualTo("http://******://hello"); } @@ -259,16 +256,17 @@ public class EnvironmentEndpointTests extends AbstractEndpointTests env = report.invoke(); - Map testProperties = (Map) env - .get("test"); - assertThat(testProperties.get("my.foo")).isEqualTo("http://${bar.password}://hello"); + Map testProperties = (Map) env.get("test"); + assertThat(testProperties.get("my.foo")) + .isEqualTo("http://${bar.password}://hello"); } - @SuppressWarnings("unchecked") @Test + @SuppressWarnings("unchecked") public void propertyWithTypeOtherThanStringShouldNotFail() throws Exception { this.context = new AnnotationConfigApplicationContext(); - MutablePropertySources propertySources = this.context.getEnvironment().getPropertySources(); + MutablePropertySources propertySources = this.context.getEnvironment() + .getPropertySources(); Map source = new HashMap(); source.put("foo", Collections.singletonMap("bar", "baz")); propertySources.addFirst(new MapPropertySource("test", source)); @@ -276,8 +274,7 @@ public class EnvironmentEndpointTests extends AbstractEndpointTests env = report.invoke(); - Map testProperties = (Map) env - .get("test"); + Map testProperties = (Map) env.get("test"); Map foo = (Map) testProperties.get("foo"); assertThat(foo.get("bar")).isEqualTo("baz"); } diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpointTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpointTests.java index 9cfd7e88952..d9293fe31f9 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpointTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpointTests.java @@ -162,11 +162,10 @@ public class EnvironmentMvcEndpointTests { .andExpect(content().string(containsString("\"my.foo\":\"******\""))); } - @SuppressWarnings("unchecked") @Test public void propertyWithTypeOtherThanStringShouldNotFail() throws Exception { - ConfigurableEnvironment environment = (ConfigurableEnvironment) this.context.getEnvironment(); - MutablePropertySources propertySources = environment.getPropertySources(); + MutablePropertySources propertySources = ((ConfigurableEnvironment) this.context + .getEnvironment()).getPropertySources(); Map source = new HashMap(); source.put("foo", Collections.singletonMap("bar", "baz")); propertySources.addFirst(new MapPropertySource("test", source)); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java index d1a056f74d8..7c03a568b6f 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java @@ -329,9 +329,10 @@ public class RabbitAutoConfigurationTests { "spring.rabbitmq.listener.simple.transactionSize:20"); } - private void testSimpleRabbitListenerContainerFactoryWithCustomSettings(String... environment) { + private void testSimpleRabbitListenerContainerFactoryWithCustomSettings( + String... environment) { load(new Class[] { MessageConvertersConfiguration.class, - MessageRecoverersConfiguration.class }, environment); + MessageRecoverersConfiguration.class }, environment); SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory = this.context .getBean("rabbitListenerContainerFactory", SimpleRabbitListenerContainerFactory.class); From 931ce15d7fbf2ef2dcc8dbb9d734a4f914ed6426 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 9 May 2017 21:43:52 -0700 Subject: [PATCH 2/2] Update copyright header dates --- .../endpoint/mvc/AbstractEndpointHandlerMappingTests.java | 2 +- .../boot/cli/infrastructure/CommandLineInvoker.java | 2 +- .../command/options/OptionSetGroovyCompilerConfiguration.java | 2 +- .../org/springframework/boot/cli/command/run/RunCommand.java | 2 +- .../org/springframework/boot/cli/compiler/GroovyCompiler.java | 2 +- .../boot/cli/compiler/GroovyCompilerConfiguration.java | 2 +- .../boot/cli/compiler/grape/AetherGrapeEngine.java | 2 +- .../boot/cli/compiler/grape/AetherGrapeEngineFactory.java | 2 +- .../cli/command/install/GroovyGrabDependencyResolverTests.java | 2 +- .../boot/cli/compiler/grape/AetherGrapeEngineTests.java | 2 +- .../SpringBootTestContextBootstrapperWithInitializersTests.java | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/AbstractEndpointHandlerMappingTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/AbstractEndpointHandlerMappingTests.java index fb3e7e81adf..c6ec46eeac6 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/AbstractEndpointHandlerMappingTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/AbstractEndpointHandlerMappingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2017 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. diff --git a/spring-boot-cli/src/it/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java b/spring-boot-cli/src/it/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java index 8e73481bdc5..773177efa01 100644 --- a/spring-boot-cli/src/it/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java +++ b/spring-boot-cli/src/it/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2017 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. diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionSetGroovyCompilerConfiguration.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionSetGroovyCompilerConfiguration.java index d4a6b2ec19c..23f06fdbbfb 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionSetGroovyCompilerConfiguration.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionSetGroovyCompilerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2017 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. diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/run/RunCommand.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/run/RunCommand.java index ed480ed6f60..bbe23fc8aee 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/run/RunCommand.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/run/RunCommand.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2017 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. diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java index 0f7ba330bcd..81fb7bc3d63 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2017 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. diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompilerConfiguration.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompilerConfiguration.java index 7fd8462dc86..7d795587708 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompilerConfiguration.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompilerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2017 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. diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngine.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngine.java index 2342b44f035..58224a5e307 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngine.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngine.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2017 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. diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineFactory.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineFactory.java index 4054e780e07..8e3abb1c031 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineFactory.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2017 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. diff --git a/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/install/GroovyGrabDependencyResolverTests.java b/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/install/GroovyGrabDependencyResolverTests.java index 6920683a2a7..297aa8ab0c2 100644 --- a/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/install/GroovyGrabDependencyResolverTests.java +++ b/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/install/GroovyGrabDependencyResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2017 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. diff --git a/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineTests.java b/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineTests.java index 036ed9b7eb2..0185af7ae9b 100644 --- a/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineTests.java +++ b/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2017 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. diff --git a/spring-boot-test/src/test/java/org/springframework/boot/test/context/bootstrap/SpringBootTestContextBootstrapperWithInitializersTests.java b/spring-boot-test/src/test/java/org/springframework/boot/test/context/bootstrap/SpringBootTestContextBootstrapperWithInitializersTests.java index c572dbbf199..adaab01b1c8 100644 --- a/spring-boot-test/src/test/java/org/springframework/boot/test/context/bootstrap/SpringBootTestContextBootstrapperWithInitializersTests.java +++ b/spring-boot-test/src/test/java/org/springframework/boot/test/context/bootstrap/SpringBootTestContextBootstrapperWithInitializersTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2017 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.