Skip to content
Closed

Polish #10636

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public void defaultEnablementNeutralWithGeneralDisablement() {
}

@Test
public void defaultEnablementNeutralWebWithTechDisablement() {
public void defaultEnablementNeutralJmxWithTechDisablement() {
EndpointEnablement enablement = getEndpointEnablement("biz",
DefaultEnablement.NEUTRAL, EndpointExposure.JMX,
"endpoints.default.jmx.enabled=false");
Expand All @@ -177,7 +177,7 @@ public void defaultEnablementNeutralWebWithTechEnablement() {
}

@Test
public void defaultEnablementNeutralWebWithUnrelatedTechDisablement() {
public void defaultEnablementNeutralJmxWithUnrelatedTechDisablement() {
EndpointEnablement enablement = getEndpointEnablement("biz",
DefaultEnablement.NEUTRAL, EndpointExposure.JMX,
"endpoints.default.web.enabled=false");
Expand Down Expand Up @@ -235,20 +235,20 @@ public void defaultEnablementNeutralDefaultTechTakesPrecedenceOnGeneralDefault()
}

private EndpointEnablement getEndpointEnablement(String id,
DefaultEnablement enabledByDefault, String... environment) {
return getEndpointEnablement(id, enabledByDefault, null, environment);
DefaultEnablement defaultEnablement, String... environment) {
return getEndpointEnablement(id, defaultEnablement, null, environment);
}

private EndpointEnablement getEndpointEnablement(String id,
DefaultEnablement enabledByDefault, EndpointExposure exposure,
DefaultEnablement defaultEnablement, EndpointExposure exposure,
String... environment) {
MockEnvironment env = new MockEnvironment();
TestPropertyValues.of(environment).applyTo(env);
EndpointEnablementProvider provider = new EndpointEnablementProvider(env);
if (exposure != null) {
return provider.getEndpointEnablement(id, enabledByDefault, exposure);
return provider.getEndpointEnablement(id, defaultEnablement, exposure);
}
return provider.getEndpointEnablement(id, enabledByDefault);
return provider.getEndpointEnablement(id, defaultEnablement);
}

private void validate(EndpointEnablement enablement, boolean enabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void runShouldHaveStatusEndpointBeanEvenIfDefaultIsDisabled() {
}

@Test
public void runWhenEnabledPropertyIsFalseShouldNotHaveEndpointBean()
public void runWhenEnabledPropertyIsFalseShouldNotHaveStatusEndpointBean()
throws Exception {
this.contextRunner.withPropertyValues("endpoints.status.enabled:false").run(
(context) -> assertThat(context).doesNotHaveBean(StatusEndpoint.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public WebFluxEndpointHandlerMapping(EndpointMapping endpointMapping,
/**
* Creates a new {@code WebEndpointHandlerMapping} that provides mappings for the
* operations of the given {@code webEndpoints}.
* @param endpointMapping the path beneath which all endpoints should be mapped
* @param endpointMapping the base mapping for all endpoints
* @param webEndpoints the web endpoints
* @param corsConfiguration the CORS configuration for the endpoints
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void endpointIsDiscovered() {
}

@Test
public void endpointIsInParentContextIsDiscovered() {
public void endpointInParentContextIsDiscovered() {
AnnotationConfigApplicationContext parent = new AnnotationConfigApplicationContext(
TestEndpointConfiguration.class);
loadWithParent(parent, EmptyConfiguration.class, hasTestEndpoint());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ public class OAuth2ClientProperties {
/**
* OAuth provider details.
*/
private Map<String, Provider> provider = new HashMap<>();
private final Map<String, Provider> provider = new HashMap<>();

/**
* OAuth client registrations.
*/
private Map<String, Registration> registration = new HashMap<>();
private final Map<String, Registration> registration = new HashMap<>();

public Map<String, Provider> getProvider() {
return this.provider;
Expand Down Expand Up @@ -92,28 +92,28 @@ public static class Registration {
private String clientSecret;

/**
* Client authentication method. May be left bank then using a pre-defined
* Client authentication method. May be left blank then using a pre-defined
* provider.
*/
private String clientAuthenticationMethod;

/**
* Authorization grant type. May be left bank then using a pre-defined provider.
* Authorization grant type. May be left blank then using a pre-defined provider.
*/
private String authorizationGrantType;

/**
* Redirect URI. May be left bank then using a pre-defined provider.
* Redirect URI. May be left blank then using a pre-defined provider.
*/
private String redirectUri;

/**
* Authorization scopes. May be left bank then using a pre-defined provider.
* Authorization scopes. May be left blank then using a pre-defined provider.
*/
private Set<String> scope;

/**
* Client name. May be left bank then using a pre-defined provider.
* Client name. May be left blank then using a pre-defined provider.
*/
private String clientName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.springframework.boot.diagnostics.FailureAnalysis;

/**
* A {@link AbstractFailureAnalyzer} for {@link NonUniqueSessionRepositoryException}.
* An {@link AbstractFailureAnalyzer} for {@link NonUniqueSessionRepositoryException}.
*
* @author Stephane Nicoll
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
import org.apache.tomcat.jdbc.pool.DataSourceProxy;
import org.apache.tomcat.jdbc.pool.jmx.ConnectionPool;
import org.junit.After;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
import org.springframework.boot.test.util.TestPropertyValues;
Expand All @@ -47,9 +45,6 @@
*/
public class DataSourceJmxConfigurationTests {

@Rule
public ExpectedException thrown = ExpectedException.none();

private ConfigurableApplicationContext context;

@After
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
import com.mongodb.ServerAddress;
import com.mongodb.connection.Cluster;
import com.mongodb.connection.ClusterSettings;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
Expand All @@ -45,9 +43,6 @@
*/
public class MongoClientFactoryTests {

@Rule
public ExpectedException thrown = ExpectedException.none();

private MockEnvironment environment = new MockEnvironment();

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void getClientRegistrationsWhenUsingDefinedProviderShouldAdapt()
provider.setAuthorizationUri("http://example.com/auth");
provider.setTokenUri("http://example.com/token");
provider.setUserInfoUri("http://example.com/info");
provider.setJwkSetUri("http://example.com/jkw");
provider.setJwkSetUri("http://example.com/jwk");
Registration registration = new Registration();
registration.setProvider("provider");
registration.setClientId("clientId");
Expand All @@ -69,7 +69,7 @@ public void getClientRegistrationsWhenUsingDefinedProviderShouldAdapt()
assertThat(adaptedProvider.getTokenUri()).isEqualTo("http://example.com/token");
assertThat(adaptedProvider.getUserInfoEndpoint().getUri())
.isEqualTo("http://example.com/info");
assertThat(adaptedProvider.getJwkSetUri()).isEqualTo("http://example.com/jkw");
assertThat(adaptedProvider.getJwkSetUri()).isEqualTo("http://example.com/jwk");
assertThat(adapted.getRegistrationId()).isEqualTo("registration");
assertThat(adapted.getClientId()).isEqualTo("clientId");
assertThat(adapted.getClientSecret()).isEqualTo("clientSecret");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ When you're ready to push your Spring Boot application to production, we've got
<<production-ready-features.adoc#production-ready-customizing-endpoints, Customization>>
* *Connection options:*
<<production-ready-features.adoc#production-ready-monitoring, HTTP>> |
<<production-ready-features.adoc#production-ready-jmx, JMX>> |
<<production-ready-features.adoc#production-ready-jmx, JMX>>
* *Monitoring:*
<<production-ready-features.adoc#production-ready-metrics, Metrics>> |
<<production-ready-features.adoc#production-ready-auditing, Auditing>> |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ endif::[]
[[getting-started-installing-the-cli]]
=== Installing the Spring Boot CLI
The Spring Boot CLI is a command line tool that can be used if you want to quickly
prototype with Spring. It allows you to run http://groovy.codehaus.org/[Groovy] scripts,
prototype with Spring. It allows you to run http://groovy-lang.org/[Groovy] scripts,
which means that you have a familiar Java-like syntax, without so much boilerplate code.

You don't need to use the CLI to work with Spring Boot but it's definitely the quickest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ The `application.properties` example above will change the endpoint from `/appli

NOTE: Unless the management port has been configured to
<<production-ready-customizing-management-server-port,expose endpoints using a different
HTTP port>>, `management.context-path` is relative to `server.context-path`.
HTTP port>>, `management.context-path` is relative to `server.servlet.context-path`.



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
* A {@link AbstractApplicationContextRunner ApplicationContext runner} for a standard,
* An {@link AbstractApplicationContextRunner ApplicationContext runner} for a standard,
* non-web environment {@link ConfigurableApplicationContext}.
* <p>
* See {@link AbstractApplicationContextRunner} for details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.springframework.context.ApplicationContext;

/**
* A {@link AbstractApplicationContextRunner ApplicationContext runner} for a
* An {@link AbstractApplicationContextRunner ApplicationContext runner} for a
* {@link ConfigurableReactiveWebApplicationContext}.
* <p>
* See {@link AbstractApplicationContextRunner} for details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;

/**
* A {@link AbstractApplicationContextRunner ApplicationContext runner} for a Servlet
* An {@link AbstractApplicationContextRunner ApplicationContext runner} for a Servlet
* based {@link ConfigurableWebApplicationContext}.
* <p>
* See {@link AbstractApplicationContextRunner} for details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ public void hasBeanWhenHasNoBeanShouldFail() {
@Test
public void hasBeanWhenNotStartedShouldFail() {
this.thrown.expect(AssertionError.class);
this.thrown.expectMessage("failed to start");
this.thrown.expectMessage(String
.format("but context failed to start:%n java.lang.RuntimeException"));
assertThat(getAssert(this.failure)).hasBean("foo");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.springframework.boot.configurationsample.Endpoint;

/**
* An endpoint that is enabled unless configured explicitly..
* An endpoint that is enabled unless configured explicitly.
*
* @author Stephane Nicoll
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void buildFinished(Project project) {
StringBuilder message = new StringBuilder();
message.append("\nDuring the build, one or more dependencies that were "
+ "declared without a version failed to resolve:\n");
this.dependenciesWithNoVersion.stream()
this.dependenciesWithNoVersion
.forEach((dependency) -> message.append(" " + dependency + "\n"));
message.append("\nDid you forget to apply the "
+ "io.spring.dependency-management plugin to the " + project.getName()
Expand Down