Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
073f8c4b
Commit
073f8c4b
authored
Feb 04, 2021
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish spring-boot-docs
See gh-25089
parent
2a854273
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
12 deletions
+12
-12
howto.adoc
...oot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc
+1
-1
production-ready-features.adoc
...oot-docs/src/docs/asciidoc/production-ready-features.adoc
+2
-2
spring-boot-features.adoc
...ing-boot-docs/src/docs/asciidoc/spring-boot-features.adoc
+1
-1
MyEnvironmentPostProcessor.java
...wto/springbootapplication/MyEnvironmentPostProcessor.java
+1
-1
CustomEndpoint.java
...ocs/productionreadyfeatures/endpoints/CustomEndpoint.java
+1
-1
MyApplication.java
...ootfeatures/springapplication/exitcode/MyApplication.java
+3
-3
MyEnvironmentPostProcessorTests.java
...pringbootapplication/MyEnvironmentPostProcessorTests.java
+3
-3
No files found.
spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc
View file @
073f8c4b
...
...
@@ -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/
Example
EnvironmentPostProcessor.java[tag=*]
include::{include-howto}/springbootapplication/
My
EnvironmentPostProcessor.java[tag=*]
----
TIP: The `Environment` has already been prepared with all the usual property sources that Spring Boot loads by default.
...
...
spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc
View file @
073f8c4b
...
...
@@ -463,7 +463,7 @@ The following example exposes a read operation that returns a custom object:
[source,java,indent=0]
----
include::{include-productionreadyfeatures}/endpoints/CustomEndpoint
Example
.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/CustomEndpoint
Example
.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.
...
...
spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc
View file @
073f8c4b
...
...
@@ -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.
...
...
spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springbootapplication/
Example
EnvironmentPostProcessor.java
→
spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springbootapplication/
My
EnvironmentPostProcessor.java
View file @
073f8c4b
...
...
@@ -28,7 +28,7 @@ import org.springframework.core.io.ClassPathResource;
import
org.springframework.core.io.Resource
;
import
org.springframework.util.Assert
;
public
class
Example
EnvironmentPostProcessor
implements
EnvironmentPostProcessor
{
public
class
My
EnvironmentPostProcessor
implements
EnvironmentPostProcessor
{
private
final
YamlPropertySourceLoader
loader
=
new
YamlPropertySourceLoader
();
...
...
spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/endpoints/CustomEndpoint
Example
.java
→
spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/endpoints/CustomEndpoint.java
View file @
073f8c4b
...
...
@@ -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
CustomEndpoint
Example
{
public
class
CustomEndpoint
{
// tag::read[]
@ReadOperation
...
...
spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/
ExitCodeExample
.java
→
spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/
exitcode/MyApplication
.java
View file @
073f8c4b
...
...
@@ -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
)));
}
}
...
...
spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/springbootapplication/
Example
EnvironmentPostProcessorTests.java
→
spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/springbootapplication/
My
EnvironmentPostProcessorTests.java
View file @
073f8c4b
...
...
@@ -24,18 +24,18 @@ import org.springframework.core.env.StandardEnvironment;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
* Tests for {@link
Example
EnvironmentPostProcessor}.
* Tests for {@link
My
EnvironmentPostProcessor}.
*
* @author Stephane Nicoll
*/
class
Example
EnvironmentPostProcessorTests
{
class
My
EnvironmentPostProcessorTests
{
private
final
StandardEnvironment
environment
=
new
StandardEnvironment
();
@Test
void
applyEnvironmentPostProcessor
()
{
assertThat
(
this
.
environment
.
containsProperty
(
"test.foo.bar"
)).
isFalse
();
new
Example
EnvironmentPostProcessor
().
postProcessEnvironment
(
this
.
environment
,
new
SpringApplication
());
new
My
EnvironmentPostProcessor
().
postProcessEnvironment
(
this
.
environment
,
new
SpringApplication
());
assertThat
(
this
.
environment
.
containsProperty
(
"test.foo.bar"
)).
isTrue
();
assertThat
(
this
.
environment
.
getProperty
(
"test.foo.bar"
)).
isEqualTo
(
"value"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment