mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Polish
This commit is contained in:
parent
f59cc25e2b
commit
39ed0d4dfb
@ -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<String> roles = new ArrayList<String>(Collections.singletonList("ADMIN"));
|
||||
private List<String> 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<String>(Collections.singletonList(role));
|
||||
this.roles = Arrays.asList(role);
|
||||
}
|
||||
|
||||
public List<String> getRoles() {
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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<String> uris = new ArrayList<String>(Collections.singletonList(
|
||||
"http://localhost:9200"));
|
||||
private List<String> uris = Arrays.asList("http://localhost:9200");
|
||||
|
||||
/**
|
||||
* Login user.
|
||||
|
Loading…
Reference in New Issue
Block a user