Merge pull request #10282 from izeye:polish-20170913

* pr/10282:
  Polish
pull/10278/merge
Stephane Nicoll 7 years ago
commit 7266c2d009

@ -116,8 +116,7 @@ is automatically set if you use the maven wrapper.
_Also see link:CONTRIBUTING.adoc[CONTRIBUTING.adoc] if you wish to submit pull requests, _Also see link:CONTRIBUTING.adoc[CONTRIBUTING.adoc] if you wish to submit pull requests,
and in particular please fill out the and in particular please fill out the
https://support.springsource.com/spring_committer_signup[Contributor's Agreement] https://support.springsource.com/spring_committer_signup[Contributor's Agreement]
before your first change, however trivial. (Or if you filed such an agreement already for before your first change, however trivial._
another project just mention that in your pull request.)_
=== Building reference documentation === Building reference documentation

@ -30,7 +30,7 @@ public class ConfigurationPropertiesReportEndpointProperties {
/** /**
* Keys that should be sanitized. Keys can be simple strings that the property ends * Keys that should be sanitized. Keys can be simple strings that the property ends
* with or regex expressions. * with or regular expressions.
*/ */
private String[] keysToSanitize; private String[] keysToSanitize;

@ -19,7 +19,7 @@ package org.springframework.boot.actuate.autoconfigure.endpoint.web;
import java.util.List; import java.util.List;
/** /**
* Interface that provides path information for web mapped endpints. * Interface that provides path information for web mapped endpoints.
* *
* @author Phillip Webb * @author Phillip Webb
* @since 2.0.0 * @since 2.0.0

@ -30,7 +30,7 @@ public class EnvironmentEndpointProperties {
/** /**
* Keys that should be sanitized. Keys can be simple strings that the property ends * Keys that should be sanitized. Keys can be simple strings that the property ends
* with or regex expressions. * with or regular expressions.
*/ */
private String[] keysToSanitize; private String[] keysToSanitize;

@ -16,9 +16,7 @@
package org.springframework.boot.actuate.autoconfigure.endpoint; package org.springframework.boot.actuate.autoconfigure.endpoint;
import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.boot.actuate.endpoint.DefaultEnablement; import org.springframework.boot.actuate.endpoint.DefaultEnablement;
import org.springframework.boot.actuate.endpoint.EndpointExposure; import org.springframework.boot.actuate.endpoint.EndpointExposure;
@ -35,9 +33,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
public class EndpointEnablementProviderTests { public class EndpointEnablementProviderTests {
@Rule
public ExpectedException thrown = ExpectedException.none();
@Test @Test
public void defaultEnablementDisabled() { public void defaultEnablementDisabled() {
EndpointEnablement enablement = getEndpointEnablement("foo", EndpointEnablement enablement = getEndpointEnablement("foo",

@ -36,7 +36,7 @@ import org.springframework.util.StringUtils;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Integration tests for endpints over JMX. * Integration tests for endpoints over JMX.
* *
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Andy Wilkinson * @author Andy Wilkinson

@ -34,7 +34,7 @@ import static org.mockito.Mockito.mock;
/** /**
* Tests for {@link Neo4jHealthIndicatorAutoConfiguration}. * Tests for {@link Neo4jHealthIndicatorAutoConfiguration}.
* *
* @author Phillp Webb * @author Phillip Webb
*/ */
public class Neo4jHealthIndicatorAutoConfigurationTests { public class Neo4jHealthIndicatorAutoConfigurationTests {

@ -22,9 +22,7 @@ import java.util.List;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.assertj.core.api.AssertDelegateTarget; import org.assertj.core.api.AssertDelegateTarget;
import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.EndpointPathProvider; import org.springframework.boot.actuate.autoconfigure.endpoint.web.EndpointPathProvider;
import org.springframework.boot.actuate.endpoint.annotation.Endpoint; import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
@ -43,9 +41,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
public class EndpointRequestTests { public class EndpointRequestTests {
@Rule
public ExpectedException thrown = ExpectedException.none();
@Test @Test
public void toAnyEndpointShouldMatchEndpointPath() throws Exception { public void toAnyEndpointShouldMatchEndpointPath() throws Exception {
RequestMatcher matcher = EndpointRequest.toAnyEndpoint(); RequestMatcher matcher = EndpointRequest.toAnyEndpoint();

@ -47,7 +47,7 @@ public class Sanitizer {
/** /**
* Keys that should be sanitized. Keys can be simple strings that the property ends * Keys that should be sanitized. Keys can be simple strings that the property ends
* with or regex expressions. * with or regular expressions.
* @param keysToSanitize the keys to sanitize * @param keysToSanitize the keys to sanitize
*/ */
public void setKeysToSanitize(String... keysToSanitize) { public void setKeysToSanitize(String... keysToSanitize) {

@ -1094,7 +1094,7 @@ content into your application; rather pick only the properties that you need.
endpoints.configprops.cache.time-to-live=0 # Maximum time in milliseconds that a response can be cached. endpoints.configprops.cache.time-to-live=0 # Maximum time in milliseconds that a response can be cached.
endpoints.configprops.enabled= # Enable the configprops endpoint. endpoints.configprops.enabled= # Enable the configprops endpoint.
endpoints.configprops.jmx.enabled= # Expose the configprops endpoint as a JMX MBean. endpoints.configprops.jmx.enabled= # Expose the configprops endpoint as a JMX MBean.
endpoints.configprops.keys-to-sanitize=password,secret,key,token,.*credentials.*,vcap_services # Keys that should be sanitized. Keys can be simple strings that the property ends with or regex expressions. endpoints.configprops.keys-to-sanitize=password,secret,key,token,.*credentials.*,vcap_services # Keys that should be sanitized. Keys can be simple strings that the property ends with or regular expressions.
endpoints.configprops.web.enabled= # Expose the configprops endpoint as a Web endpoint. endpoints.configprops.web.enabled= # Expose the configprops endpoint as a Web endpoint.
# ENDPOINT DEFAULT SETTINGS # ENDPOINT DEFAULT SETTINGS
@ -1106,7 +1106,7 @@ content into your application; rather pick only the properties that you need.
endpoints.env.cache.time-to-live=0 # Maximum time in milliseconds that a response can be cached. endpoints.env.cache.time-to-live=0 # Maximum time in milliseconds that a response can be cached.
endpoints.env.enabled= # Enable the env endpoint. endpoints.env.enabled= # Enable the env endpoint.
endpoints.env.jmx.enabled= # Expose the env endpoint as a JMX MBean. endpoints.env.jmx.enabled= # Expose the env endpoint as a JMX MBean.
endpoints.env.keys-to-sanitize=password,secret,key,token,.*credentials.*,vcap_services # Keys that should be sanitized. Keys can be simple strings that the property ends with or regex expressions. endpoints.env.keys-to-sanitize=password,secret,key,token,.*credentials.*,vcap_services # Keys that should be sanitized. Keys can be simple strings that the property ends with or regular expressions.
endpoints.env.web.enabled= # Expose the env endpoint as a Web endpoint. endpoints.env.web.enabled= # Expose the env endpoint as a Web endpoint.
# FLYWAY ENDPOINT ({sc-spring-boot-actuator}/endpoint/FlywayEndpoint.{sc-ext}[FlywayEndpoint]) # FLYWAY ENDPOINT ({sc-spring-boot-actuator}/endpoint/FlywayEndpoint.{sc-ext}[FlywayEndpoint])

@ -231,7 +231,7 @@ When a custom management context path is configured, the "`discovery page`" will
automatically move from `/application` to the root of the management context. For example, automatically move from `/application` to the root of the management context. For example,
if the management context path is `/management` then the discovery page will be available if the management context path is `/management` then the discovery page will be available
from `/management`. When the management context path is set to `/` the discovery page from `/management`. When the management context path is set to `/` the discovery page
is disabled to prevent the possiblility of a clash with other mappings. is disabled to prevent the possibility of a clash with other mappings.

@ -2828,8 +2828,8 @@ you can configure `security.oauth2.resource.jwk.key-set-uri`. E.g. on PWS:
NOTE: Configuring both JWT and JWK properties will cause an error. Only one of `security.oauth2.resource.jwt.key-uri` NOTE: Configuring both JWT and JWK properties will cause an error. Only one of `security.oauth2.resource.jwt.key-uri`
(or `security.oauth2.resource.jwt.key-value`) and `security.oauth2.resource.jwk.key-set-uri` should be configured. (or `security.oauth2.resource.jwt.key-value`) and `security.oauth2.resource.jwk.key-set-uri` should be configured.
WARNING: If you use the `security.oauth2.resource.jwt.key-uri` or `security.oauth2.resource.jwk.key-set-uri, WARNING: If you use the `security.oauth2.resource.jwt.key-uri` or `security.oauth2.resource.jwk.key-set-uri`,
` the authorization server needs to be running when your application starts up. It will log a warning if it can't the authorization server needs to be running when your application starts up. It will log a warning if it can't
find the key, and tell you what to do to fix it. find the key, and tell you what to do to fix it.
OAuth2 resources are protected by a filter chain with order OAuth2 resources are protected by a filter chain with order

@ -3,7 +3,6 @@ import groovy.io.FileType
import java.util.Properties import java.util.Properties
import org.springframework.core.io.InputStreamResource import org.springframework.core.io.InputStreamResource
import org.springframework.core.io.Resource
import org.springframework.core.type.AnnotationMetadata import org.springframework.core.type.AnnotationMetadata
import org.springframework.core.type.ClassMetadata import org.springframework.core.type.ClassMetadata
import org.springframework.core.type.classreading.MetadataReader import org.springframework.core.type.classreading.MetadataReader
@ -72,10 +71,10 @@ MetadataReader createMetadataReader(MetadataReaderFactory factory, File classFil
} }
TestSlice createTestSlice(Properties springFactories, ClassMetadata classMetadata, AnnotationMetadata annotationMetadata) { TestSlice createTestSlice(Properties springFactories, ClassMetadata classMetadata, AnnotationMetadata annotationMetadata) {
new TestSlice(classMetadata.className, getImportedAutoConfiguration(springFactories, classMetadata, annotationMetadata)) new TestSlice(classMetadata.className, getImportedAutoConfiguration(springFactories, annotationMetadata))
} }
Set<String> getImportedAutoConfiguration(Properties springFactories, ClassMetadata classMetadata, AnnotationMetadata annotationMetadata) { Set<String> getImportedAutoConfiguration(Properties springFactories, AnnotationMetadata annotationMetadata) {
Set<String> importers = findMetaImporters(annotationMetadata) Set<String> importers = findMetaImporters(annotationMetadata)
if (annotationMetadata.isAnnotated('org.springframework.boot.autoconfigure.ImportAutoConfiguration')) { if (annotationMetadata.isAnnotated('org.springframework.boot.autoconfigure.ImportAutoConfiguration')) {
importers.add(annotationMetadata.className) importers.add(annotationMetadata.className)

@ -28,7 +28,7 @@ import org.gradle.api.file.FileCollection;
import org.springframework.boot.loader.tools.MainClassFinder; import org.springframework.boot.loader.tools.MainClassFinder;
/** /**
* A {@link Callable} that provide a convention for the project's main class name. * A {@link Callable} that provides a convention for the project's main class name.
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */

@ -69,7 +69,7 @@ public class EndpointMappingTests {
} }
@Test @Test
public void subPathWithoutALeadingSlashIsSeparaedFromBasePathBySingleSlash() { public void subPathWithoutALeadingSlashIsSeparatedFromBasePathBySingleSlash() {
assertThat(new EndpointMapping("/test").createSubPath("one")).isEqualTo("/test/one"); assertThat(new EndpointMapping("/test").createSubPath("one")).isEqualTo("/test/one");
} }

@ -104,7 +104,7 @@ public class ApplicationContextRequestMatcherTests {
static class TestApplicationContextRequestMatcher<C> static class TestApplicationContextRequestMatcher<C>
extends ApplicationContextRequestMatcher<C> { extends ApplicationContextRequestMatcher<C> {
private C provdedContext; private C providedContext;
TestApplicationContextRequestMatcher(Class<? extends C> context) { TestApplicationContextRequestMatcher(Class<? extends C> context) {
super(context); super(context);
@ -117,17 +117,17 @@ public class ApplicationContextRequestMatcherTests {
public C callMatchesAndReturnProvidedContext(HttpServletRequest request) { public C callMatchesAndReturnProvidedContext(HttpServletRequest request) {
matches(request); matches(request);
return getProvdedContext(); return getProvidedContext();
} }
@Override @Override
protected boolean matches(HttpServletRequest request, C context) { protected boolean matches(HttpServletRequest request, C context) {
this.provdedContext = context; this.providedContext = context;
return false; return false;
} }
public C getProvdedContext() { public C getProvidedContext() {
return this.provdedContext; return this.providedContext;
} }
} }

Loading…
Cancel
Save