From 073f8c4b239eaa720ddba32b2aaa10517e2f2221 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Wed, 3 Feb 2021 16:20:32 -0800 Subject: [PATCH] Polish spring-boot-docs See gh-25089 --- .../spring-boot-docs/src/docs/asciidoc/howto.adoc | 2 +- .../src/docs/asciidoc/production-ready-features.adoc | 4 ++-- .../src/docs/asciidoc/spring-boot-features.adoc | 2 +- ...ntPostProcessor.java => MyEnvironmentPostProcessor.java} | 2 +- .../{CustomEndpointExample.java => CustomEndpoint.java} | 2 +- .../{ExitCodeExample.java => exitcode/MyApplication.java} | 6 +++--- ...essorTests.java => MyEnvironmentPostProcessorTests.java} | 6 +++--- 7 files changed, 12 insertions(+), 12 deletions(-) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springbootapplication/{ExampleEnvironmentPostProcessor.java => MyEnvironmentPostProcessor.java} (95%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/endpoints/{CustomEndpointExample.java => CustomEndpoint.java} (97%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/{ExitCodeExample.java => exitcode/MyApplication.java} (88%) rename spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/springbootapplication/{ExampleEnvironmentPostProcessorTests.java => MyEnvironmentPostProcessorTests.java} (86%) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc index c53af684b8e..b183f5f3bfb 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc @@ -95,7 +95,7 @@ For instance, the following example loads a YAML configuration file from the cla [source,java,indent=0] ---- -include::{include-howto}/springbootapplication/ExampleEnvironmentPostProcessor.java[tag=*] +include::{include-howto}/springbootapplication/MyEnvironmentPostProcessor.java[tag=*] ---- TIP: The `Environment` has already been prepared with all the usual property sources that Spring Boot loads by default. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc index ff93c55db29..60d68337129 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc @@ -463,7 +463,7 @@ The following example exposes a read operation that returns a custom object: [source,java,indent=0] ---- -include::{include-productionreadyfeatures}/endpoints/CustomEndpointExample.java[tag=read] +include::{include-productionreadyfeatures}/endpoints/CustomEndpoint.java[tag=read] ---- You can also write technology-specific endpoints by using `@JmxEndpoint` or `@WebEndpoint`. @@ -500,7 +500,7 @@ This can be used to invoke a write operation that takes `String name` and `int c [source,java,indent=0] ---- -include::{include-productionreadyfeatures}/endpoints/CustomEndpointExample.java[tag=write] +include::{include-productionreadyfeatures}/endpoints/CustomEndpoint.java[tag=write] ---- TIP: Because endpoints are technology agnostic, only simple types can be specified in the method signature. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc index 8ae7b4e1462..88721e271f3 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc @@ -436,7 +436,7 @@ This exit code can then be passed to `System.exit()` to return it as a status co [source,java,indent=0] ---- -include::{include-springbootfeatures}/springapplication/ExitCodeExample.java[tag=*] +include::{include-springbootfeatures}/springapplication/exitcode/MyApplication.java[tag=*] ---- Also, the `ExitCodeGenerator` interface may be implemented by exceptions. diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springbootapplication/ExampleEnvironmentPostProcessor.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springbootapplication/MyEnvironmentPostProcessor.java similarity index 95% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springbootapplication/ExampleEnvironmentPostProcessor.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springbootapplication/MyEnvironmentPostProcessor.java index 33c9ca51ea6..fc0e6b7066e 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springbootapplication/ExampleEnvironmentPostProcessor.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springbootapplication/MyEnvironmentPostProcessor.java @@ -28,7 +28,7 @@ import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.util.Assert; -public class ExampleEnvironmentPostProcessor implements EnvironmentPostProcessor { +public class MyEnvironmentPostProcessor implements EnvironmentPostProcessor { private final YamlPropertySourceLoader loader = new YamlPropertySourceLoader(); diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/endpoints/CustomEndpointExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/endpoints/CustomEndpoint.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/endpoints/CustomEndpointExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/endpoints/CustomEndpoint.java index cb8135af13d..b23bef3c304 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/endpoints/CustomEndpointExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/endpoints/CustomEndpoint.java @@ -21,7 +21,7 @@ import org.springframework.boot.actuate.endpoint.annotation.ReadOperation; import org.springframework.boot.actuate.endpoint.annotation.WriteOperation; @Endpoint(id = "custom") -public class CustomEndpointExample { +public class CustomEndpoint { // tag::read[] @ReadOperation diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/ExitCodeExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/exitcode/MyApplication.java similarity index 88% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/ExitCodeExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/exitcode/MyApplication.java index ea8514b38fc..aedb4ff14de 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/ExitCodeExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/exitcode/MyApplication.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.springbootfeatures.springapplication; +package org.springframework.boot.docs.springbootfeatures.springapplication.exitcode; // tag::code[] import org.springframework.boot.ExitCodeGenerator; @@ -23,7 +23,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; @SpringBootApplication -public class ExitCodeExample { +public class MyApplication { @Bean public ExitCodeGenerator exitCodeGenerator() { @@ -31,7 +31,7 @@ public class ExitCodeExample { } public static void main(String[] args) { - System.exit(SpringApplication.exit(SpringApplication.run(ExitCodeExample.class, args))); + System.exit(SpringApplication.exit(SpringApplication.run(MyApplication.class, args))); } } diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/springbootapplication/ExampleEnvironmentPostProcessorTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/springbootapplication/MyEnvironmentPostProcessorTests.java similarity index 86% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/springbootapplication/ExampleEnvironmentPostProcessorTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/springbootapplication/MyEnvironmentPostProcessorTests.java index 139aa89a5f3..d43d86b81d1 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/springbootapplication/ExampleEnvironmentPostProcessorTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/springbootapplication/MyEnvironmentPostProcessorTests.java @@ -24,18 +24,18 @@ import org.springframework.core.env.StandardEnvironment; import static org.assertj.core.api.Assertions.assertThat; /** - * Tests for {@link ExampleEnvironmentPostProcessor}. + * Tests for {@link MyEnvironmentPostProcessor}. * * @author Stephane Nicoll */ -class ExampleEnvironmentPostProcessorTests { +class MyEnvironmentPostProcessorTests { private final StandardEnvironment environment = new StandardEnvironment(); @Test void applyEnvironmentPostProcessor() { assertThat(this.environment.containsProperty("test.foo.bar")).isFalse(); - new ExampleEnvironmentPostProcessor().postProcessEnvironment(this.environment, new SpringApplication()); + new MyEnvironmentPostProcessor().postProcessEnvironment(this.environment, new SpringApplication()); assertThat(this.environment.containsProperty("test.foo.bar")).isTrue(); assertThat(this.environment.getProperty("test.foo.bar")).isEqualTo("value"); }