commit
41be61da15
|
@ -66,3 +66,13 @@ The following table describes the structure of the `process` section of the resp
|
|||
|
||||
[cols="2,1,3"]
|
||||
include::partial$rest/actuator/info/response-fields-beneath-process.adoc[]
|
||||
|
||||
|
||||
|
||||
[[info.retrieving.response-structure.java]]
|
||||
==== Java Response Structure
|
||||
|
||||
The following table describes the structure of the `java` section of the response:
|
||||
|
||||
[cols="2,1,3"]
|
||||
include::partial$rest/actuator/info/response-fields-beneath-java.adoc[]
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.springframework.boot.actuate.info.BuildInfoContributor;
|
|||
import org.springframework.boot.actuate.info.GitInfoContributor;
|
||||
import org.springframework.boot.actuate.info.InfoContributor;
|
||||
import org.springframework.boot.actuate.info.InfoEndpoint;
|
||||
import org.springframework.boot.actuate.info.JavaInfoContributor;
|
||||
import org.springframework.boot.actuate.info.OsInfoContributor;
|
||||
import org.springframework.boot.actuate.info.ProcessInfoContributor;
|
||||
import org.springframework.boot.info.BuildProperties;
|
||||
|
@ -53,7 +54,8 @@ class InfoEndpointDocumentationTests extends MockMvcEndpointDocumentationTests {
|
|||
@Test
|
||||
void info() {
|
||||
assertThat(this.mvc.get().uri("/actuator/info")).hasStatusOk()
|
||||
.apply(MockMvcRestDocumentation.document("info", gitInfo(), buildInfo(), osInfo(), processInfo()));
|
||||
.apply(MockMvcRestDocumentation.document("info", gitInfo(), buildInfo(), osInfo(), processInfo(),
|
||||
javaInfo()));
|
||||
}
|
||||
|
||||
private ResponseFieldsSnippet gitInfo() {
|
||||
|
@ -111,6 +113,35 @@ class InfoEndpointDocumentationTests extends MockMvcEndpointDocumentationTests {
|
|||
.description("The maximum number of bytes that can be used by the JVM (or -1)."));
|
||||
}
|
||||
|
||||
private ResponseFieldsSnippet javaInfo() {
|
||||
return responseFields(beneathPath("java"),
|
||||
fieldWithPath("version").description("Java version, if available.")
|
||||
.type(JsonFieldType.STRING)
|
||||
.optional(),
|
||||
fieldWithPath("vendor").description("Vendor details."),
|
||||
fieldWithPath("vendor.name").description("Vendor name, if available.")
|
||||
.type(JsonFieldType.STRING)
|
||||
.optional(),
|
||||
fieldWithPath("vendor.version").description("Vendor version, if available.")
|
||||
.type(JsonFieldType.STRING)
|
||||
.optional(),
|
||||
fieldWithPath("runtime").description("Runtime details."),
|
||||
fieldWithPath("runtime.name").description("Runtime name, if available.")
|
||||
.type(JsonFieldType.STRING)
|
||||
.optional(),
|
||||
fieldWithPath("runtime.version").description("Runtime version, if available.")
|
||||
.type(JsonFieldType.STRING)
|
||||
.optional(),
|
||||
fieldWithPath("jvm").description("JVM details."),
|
||||
fieldWithPath("jvm.name").description("JVM name, if available.").type(JsonFieldType.STRING).optional(),
|
||||
fieldWithPath("jvm.vendor").description("JVM vendor, if available.")
|
||||
.type(JsonFieldType.STRING)
|
||||
.optional(),
|
||||
fieldWithPath("jvm.version").description("JVM version, if available.")
|
||||
.type(JsonFieldType.STRING)
|
||||
.optional());
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
static class TestConfiguration {
|
||||
|
||||
|
@ -150,6 +181,11 @@ class InfoEndpointDocumentationTests extends MockMvcEndpointDocumentationTests {
|
|||
return new ProcessInfoContributor();
|
||||
}
|
||||
|
||||
@Bean
|
||||
JavaInfoContributor javaInfoContributor() {
|
||||
return new JavaInfoContributor();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue