mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Polish
Closes gh-11510
This commit is contained in:
parent
7c5cf903fc
commit
37d8eedae3
@ -27,7 +27,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ConfigurationProperties("management.metrics")
|
||||
public class MetricsProperties {
|
||||
|
||||
private Web web = new Web();
|
||||
private final Web web = new Web();
|
||||
|
||||
/**
|
||||
* Whether auto-configured MeterRegistry implementations should be bound to the global
|
||||
@ -50,26 +50,18 @@ public class MetricsProperties {
|
||||
|
||||
public static class Web {
|
||||
|
||||
private Client client = new Client();
|
||||
private final Client client = new Client();
|
||||
|
||||
private Server server = new Server();
|
||||
private final Server server = new Server();
|
||||
|
||||
public Client getClient() {
|
||||
return this.client;
|
||||
}
|
||||
|
||||
public void setClient(Client client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
public Server getServer() {
|
||||
return this.server;
|
||||
}
|
||||
|
||||
public void setServer(Server server) {
|
||||
this.server = server;
|
||||
}
|
||||
|
||||
public static class Client {
|
||||
|
||||
/**
|
||||
|
@ -109,13 +109,13 @@ public class ManagementServerProperties implements SecurityPrerequisite {
|
||||
/**
|
||||
* Servlet properties.
|
||||
*/
|
||||
public class Servlet {
|
||||
public static class Servlet {
|
||||
|
||||
/**
|
||||
* Management endpoint context-path. For instance, '/management'. Requires a
|
||||
* custom management.server.port.
|
||||
*/
|
||||
private String contextPath = "";
|
||||
private String contextPath = "";
|
||||
|
||||
/**
|
||||
* Return the context path with no trailing slash (i.e. the '/' root context is
|
||||
|
@ -77,7 +77,7 @@ class HibernateJpaConfiguration extends JpaBaseConfiguration {
|
||||
*/
|
||||
private static final String[] WEBSPHERE_JTA_PLATFORM_CLASSES = {
|
||||
"org.hibernate.engine.transaction.jta.platform.internal.WebSphereExtendedJtaPlatform",
|
||||
"org.hibernate.service.jta.platform.internal.WebSphereExtendedJtaPlatform", };
|
||||
"org.hibernate.service.jta.platform.internal.WebSphereExtendedJtaPlatform" };
|
||||
|
||||
private final HibernateDefaultDdlAutoProvider defaultDdlAutoProvider;
|
||||
|
||||
|
@ -224,7 +224,7 @@ public class ServerProperties {
|
||||
/**
|
||||
* Servlet properties.
|
||||
*/
|
||||
public class Servlet {
|
||||
public static class Servlet {
|
||||
|
||||
/**
|
||||
* Servlet context init parameters.
|
||||
|
@ -303,7 +303,7 @@ public class ImportAutoConfigurationImportSelectorTests {
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@interface MetaImportAutoConfiguration {
|
||||
|
||||
@AliasFor(annotation = ImportAutoConfiguration.class, attribute = "exclude")
|
||||
@AliasFor(annotation = ImportAutoConfiguration.class)
|
||||
Class<?>[] exclude() default {};
|
||||
|
||||
}
|
||||
|
@ -139,10 +139,10 @@ content into your application. Rather, pick only the properties that you need.
|
||||
spring.profiles.include= # Unconditionally activate the specified comma-separated list of profiles (or list of profiles if using YAML).
|
||||
|
||||
# QUARTZ SCHEDULER ({sc-spring-boot-autoconfigure}/quartz/QuartzProperties.{sc-ext}[QuartzProperties])
|
||||
spring.quartz.job-store-type=memory # Quartz job store type.
|
||||
spring.quartz.properties.*= # Additional Quartz Scheduler properties.
|
||||
spring.quartz.jdbc.initialize-schema=embedded # Database schema initialization mode.
|
||||
spring.quartz.jdbc.schema=classpath:org/quartz/impl/jdbcjobstore/tables_@@platform@@.sql # Path to the SQL file to use to initialize the database schema.
|
||||
spring.quartz.job-store-type=memory # Quartz job store type.
|
||||
spring.quartz.properties.*= # Additional Quartz Scheduler properties.
|
||||
|
||||
# REACTOR ({sc-spring-boot-autoconfigure}/reactor/core/ReactorCoreProperties.{sc-ext}[ReactorCoreProperties])
|
||||
spring.reactor.stacktrace-mode.enabled=false # Whether Reactor should collect stacktrace information at runtime.
|
||||
@ -1085,7 +1085,7 @@ content into your application. Rather, pick only the properties that you need.
|
||||
management.server.add-application-context-header=false # Add the "X-Application-Context" HTTP header in each response. Requires a custom management.server.port.
|
||||
management.server.address= # Network address that to which the management endpoints should bind. Requires a custom management.server.port.
|
||||
management.server.port= # Management endpoint HTTP port. Uses the same port as the application by default. Configure a different port to use management-specific SSL.
|
||||
management.server.servlet.context-path= # Management endpoint context-path. For instance, `/management`. Requires a custom management.server.port
|
||||
management.server.servlet.context-path= # Management endpoint context-path. For instance, `/management`. Requires a custom management.server.port.
|
||||
management.server.ssl.ciphers= # Supported SSL ciphers. Requires a custom management.port.
|
||||
management.server.ssl.client-auth= # Whether client authentication is wanted ("want") or needed ("need"). Requires a trust store. Requires a custom management.server.port.
|
||||
management.server.ssl.enabled= # Whether to enable SSL support. Requires a custom management.server.port.
|
||||
|
@ -957,7 +957,7 @@ for all requests. Alternatively, when set to `false`, you can enable instrumenta
|
||||
adding `@Timed` to a request-handling method.
|
||||
|
||||
By default, metrics are generated with the name, `http.server.requests`. The name can be
|
||||
customized by setting the `management.metrics.web.server.requests-metrics-name` property.
|
||||
customized by setting the `management.metrics.web.server.requests-metric-name` property.
|
||||
|
||||
|
||||
|
||||
@ -980,7 +980,7 @@ controllers. You can also use a helper class, `RouterFunctionMetrics`, to instru
|
||||
applications that use WebFlux's functional programming model.
|
||||
|
||||
By default, metrics are generated with the name `http.server.requests`. You can customize
|
||||
the name by setting the `management.metrics.web.server.requests-metrics-name` property.
|
||||
the name by setting the `management.metrics.web.server.requests-metric-name` property.
|
||||
|
||||
|
||||
|
||||
@ -1015,7 +1015,7 @@ instrumentation of its requests. `MetricsRestTemplateCustomizer` can be used to
|
||||
your own `RestTemplate` instances.
|
||||
|
||||
By default, metrics are generated with the name, `http.client.requests`. The name can be
|
||||
customized by setting the `management.metrics.web.client.requests-metrics-name` property.
|
||||
customized by setting the `management.metrics.web.client.requests-metric-name` property.
|
||||
|
||||
|
||||
|
||||
|
@ -4391,7 +4391,7 @@ materialized by the `org.springframework.cache.Cache` and
|
||||
|
||||
If you have not defined a bean of type `CacheManager` or a `CacheResolver` named
|
||||
`cacheResolver` (see
|
||||
{spring-javadoc}cache/annotation/CachingConfigurer.html[`CachingConfigurer`]),
|
||||
{spring-javadoc}/cache/annotation/CachingConfigurer.html[`CachingConfigurer`]),
|
||||
Spring Boot tries to detect the following providers (in the indicated order):
|
||||
|
||||
. <<boot-features-caching-provider-generic,Generic>>
|
||||
@ -5406,7 +5406,7 @@ property with a different value for each instance of your application.
|
||||
|
||||
[[boot-features-jta-bitronix]]
|
||||
=== Using a Bitronix Transaction Manager
|
||||
https://github.com/bitronix/btm[Bitronix] is a spopular open-source JTA transaction
|
||||
https://github.com/bitronix/btm[Bitronix] is a popular open-source JTA transaction
|
||||
manager implementation. You can use the `spring-boot-starter-jta-bitronix` starter to add
|
||||
the appropriate Bitronix dependencies to your project. As with Atomikos, Spring Boot
|
||||
automatically configures Bitronix and post-processes your beans to ensure that startup and
|
||||
@ -6158,7 +6158,7 @@ A list of the auto-configuration settings that are enabled by `@WebMvcTest` can
|
||||
|
||||
[[boot-features-testing-spring-boot-applications-testing-autoconfigured-webflux-tests]]
|
||||
==== Auto-configured Spring WebFlux Tests
|
||||
To test that {spring-reference}html/web-reactive.html[Spring WebFlux] controllers are
|
||||
To test that {spring-reference}/web-reactive.html[Spring WebFlux] controllers are
|
||||
working as expected, you can use the `@WebFluxTest` annotation. `@WebFluxTest`
|
||||
auto-configures the Spring WebFlux infrastructure and limits scanned beans to
|
||||
`@Controller`, `@ControllerAdvice`, `@JsonComponent`, `Converter`, `GenericConverter`, and
|
||||
@ -6444,7 +6444,7 @@ configures Spring Data Neo4j repositories. Regular `@Component` beans are not lo
|
||||
the `ApplicationContext`. (For more about using Neo4J with Spring Boot, see
|
||||
"<<boot-features-neo4j>>", earlier in this chapter.)
|
||||
|
||||
The followig example shows a typical setup for using Neo4J tests in Spring Boot:
|
||||
The following example shows a typical setup for using Neo4J tests in Spring Boot:
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
|
@ -37,6 +37,6 @@ public enum SkipPropertyMapping {
|
||||
/**
|
||||
* Don't skip mapping the property.
|
||||
*/
|
||||
NO,
|
||||
NO
|
||||
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ public @interface WebMvcTest {
|
||||
* on the classpath. Defaults to {@code true}.
|
||||
* @return if Spring Security's MockMvc support is auto-configured
|
||||
*/
|
||||
@AliasFor(annotation = AutoConfigureMockMvc.class, attribute = "secure")
|
||||
@AliasFor(annotation = AutoConfigureMockMvc.class)
|
||||
boolean secure() default true;
|
||||
|
||||
/**
|
||||
|
@ -354,7 +354,7 @@ public class AnnotationsPropertySourceTests {
|
||||
@AliasedAttributeAnnotation
|
||||
static @interface AttributeWithAliasAnnotation {
|
||||
|
||||
@AliasFor(annotation = AliasedAttributeAnnotation.class, attribute = "value")
|
||||
@AliasFor(annotation = AliasedAttributeAnnotation.class)
|
||||
String value() default "foo";
|
||||
|
||||
String someOtherAttribute() default "shouldNotBeMapped";
|
||||
|
@ -36,7 +36,7 @@ class TestTypeExcludeFilter extends TypeExcludeFilter {
|
||||
"org.junit.jupiter.api.extension.ExtendWith" };
|
||||
|
||||
private static final String[] METHOD_ANNOTATIONS = { "org.junit.Test",
|
||||
"org.junit.platform.commons.annotation.Testable", };
|
||||
"org.junit.platform.commons.annotation.Testable" };
|
||||
|
||||
@Override
|
||||
public boolean match(MetadataReader metadataReader,
|
||||
|
@ -22,7 +22,7 @@ import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
// Note: this class was written without inspecting the non-free org.json sourcecode.
|
||||
// Note: this class was written without inspecting the non-free org.json source code.
|
||||
|
||||
/**
|
||||
* A dense indexed sequence of values. Values may be any mix of
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.configurationprocessor.json;
|
||||
|
||||
// Note: this class was written without inspecting the non-free org.json sourcecode.
|
||||
// Note: this class was written without inspecting the non-free org.json source code.
|
||||
|
||||
/**
|
||||
* Thrown to indicate a problem with the JSON API. Such problems include:
|
||||
|
@ -22,7 +22,7 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
// Note: this class was written without inspecting the non-free org.json sourcecode.
|
||||
// Note: this class was written without inspecting the non-free org.json source code.
|
||||
|
||||
/**
|
||||
* A modifiable set of name/value mappings. Names are unique, non-null strings.
|
||||
|
@ -20,7 +20,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
// Note: this class was written without inspecting the non-free org.json sourcecode.
|
||||
// Note: this class was written without inspecting the non-free org.json source code.
|
||||
|
||||
/**
|
||||
* Implements {@link JSONObject#toString} and {@link JSONArray#toString}. Most
|
||||
@ -104,7 +104,7 @@ public class JSONStringer {
|
||||
* A special bracketless array needed by JSONStringer.join() and
|
||||
* JSONObject.quote() only. Not used for JSON encoding.
|
||||
*/
|
||||
NULL,
|
||||
NULL
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.configurationprocessor.json;
|
||||
|
||||
// Note: this class was written without inspecting the non-free org.json sourcecode.
|
||||
// Note: this class was written without inspecting the non-free org.json source code.
|
||||
|
||||
/**
|
||||
* Parses a JSON (<a href="http://www.ietf.org/rfc/rfc4627.txt">RFC 4627</a>)
|
||||
|
@ -102,10 +102,11 @@ public class RandomAccessDataFileTests {
|
||||
|
||||
@Test
|
||||
public void fileExists() {
|
||||
File file = new File("/does/not/exist");
|
||||
this.thrown.expect(IllegalArgumentException.class);
|
||||
this.thrown.expectMessage(String.format("File %s must exist",
|
||||
new File("/does/not/exist").getAbsolutePath()));
|
||||
new RandomAccessDataFile(new File("/does/not/exist"));
|
||||
file.getAbsolutePath()));
|
||||
new RandomAccessDataFile(file);
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -117,10 +118,11 @@ public class RandomAccessDataFileTests {
|
||||
|
||||
@Test
|
||||
public void fileExistsWithConcurrentReads() {
|
||||
File file = new File("/does/not/exist");
|
||||
this.thrown.expect(IllegalArgumentException.class);
|
||||
this.thrown.expectMessage(String.format("File %s must exist",
|
||||
new File("/does/not/exist").getAbsolutePath()));
|
||||
new RandomAccessDataFile(new File("/does/not/exist"), 1);
|
||||
file.getAbsolutePath()));
|
||||
new RandomAccessDataFile(file, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -46,7 +46,7 @@ final class SystemEnvironmentPropertyMapper implements PropertyMapper {
|
||||
}
|
||||
return new PropertyMapping[] {
|
||||
new PropertyMapping(name, configurationPropertyName),
|
||||
new PropertyMapping(legacyName, configurationPropertyName), };
|
||||
new PropertyMapping(legacyName, configurationPropertyName) };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -17,5 +17,5 @@
|
||||
package sample.data.jpa.domain;
|
||||
|
||||
public enum Rating {
|
||||
TERRIBLE, POOR, AVERAGE, GOOD, EXCELLENT,
|
||||
TERRIBLE, POOR, AVERAGE, GOOD, EXCELLENT
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user