From 39ed0d4dfbc49d8f51eaabf991e06f68fe779f16 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Mon, 3 Oct 2016 21:58:13 -0700 Subject: [PATCH] Polish --- .../actuate/autoconfigure/ManagementServerProperties.java | 7 +++---- .../ManagementServerPropertiesAutoConfigurationTests.java | 3 +-- .../autoconfigure/elasticsearch/jest/JestProperties.java | 6 ++---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java index 29c05c0bdf..5794f8613e 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java @@ -17,8 +17,7 @@ package org.springframework.boot.actuate.autoconfigure; import java.net.InetAddress; -import java.util.ArrayList; -import java.util.Collections; +import java.util.Arrays; import java.util.List; import javax.validation.constraints.NotNull; @@ -179,7 +178,7 @@ public class ManagementServerProperties implements SecurityPrerequisite { /** * Comma-separated list of roles that can access the management endpoint. */ - private List roles = new ArrayList(Collections.singletonList("ADMIN")); + private List roles = Arrays.asList("ADMIN"); /** * Session creating policy to use (always, never, if_required, stateless). @@ -200,7 +199,7 @@ public class ManagementServerProperties implements SecurityPrerequisite { @Deprecated public void setRole(String role) { - this.roles = new ArrayList(Collections.singletonList(role)); + this.roles = Arrays.asList(role); } public List getRoles() { diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ManagementServerPropertiesAutoConfigurationTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ManagementServerPropertiesAutoConfigurationTests.java index ffc5e53c3e..951e1222be 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ManagementServerPropertiesAutoConfigurationTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ManagementServerPropertiesAutoConfigurationTests.java @@ -82,8 +82,7 @@ public class ManagementServerPropertiesAutoConfigurationTests { @Test public void managementRolesAllowsIndexedAccess() { - ManagementServerProperties properties = load( - "management.security.roles[0]=FOO"); + ManagementServerProperties properties = load("management.security.roles[0]=FOO"); assertThat(properties.getSecurity().getRoles()).containsOnly("FOO"); } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/jest/JestProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/jest/JestProperties.java index 166ce81275..bb0ca4cef1 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/jest/JestProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/jest/JestProperties.java @@ -16,8 +16,7 @@ package org.springframework.boot.autoconfigure.elasticsearch.jest; -import java.util.ArrayList; -import java.util.Collections; +import java.util.Arrays; import java.util.List; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -34,8 +33,7 @@ public class JestProperties { /** * Comma-separated list of the Elasticsearch instances to use. */ - private List uris = new ArrayList(Collections.singletonList( - "http://localhost:9200")); + private List uris = Arrays.asList("http://localhost:9200"); /** * Login user.