Skip to content

Commit 4219c83

Browse files
committed
Merge branch '3.4.x'
Closes gh-45632
2 parents 335de07 + c06fb87 commit 4219c83

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/antora/modules/api/pages/rest/actuator/info.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,13 @@ The following table describes the structure of the `os` section of the response:
5656

5757
[cols="2,1,3"]
5858
include::partial$rest/actuator/info/response-fields-beneath-os.adoc[]
59+
60+
61+
62+
[[info.retrieving.response-structure.process]]
63+
==== Process Response Structure
64+
65+
The following table describes the structure of the `process` section of the response:
66+
67+
[cols="2,1,3"]
68+
include::partial$rest/actuator/info/response-fields-beneath-process.adoc[]

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/info/InfoEndpointDocumentationTests.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.springframework.boot.actuate.info.InfoContributor;
2929
import org.springframework.boot.actuate.info.InfoEndpoint;
3030
import org.springframework.boot.actuate.info.OsInfoContributor;
31+
import org.springframework.boot.actuate.info.ProcessInfoContributor;
3132
import org.springframework.boot.info.BuildProperties;
3233
import org.springframework.boot.info.GitProperties;
3334
import org.springframework.context.annotation.Bean;
@@ -50,9 +51,16 @@
5051
class InfoEndpointDocumentationTests extends MockMvcEndpointDocumentationTests {
5152

5253
@Test
54+
<<<<<<< HEAD
5355
void info() {
5456
assertThat(this.mvc.get().uri("/actuator/info")).hasStatusOk()
5557
.apply(MockMvcRestDocumentation.document("info", gitInfo(), buildInfo(), osInfo()));
58+
=======
59+
void info() throws Exception {
60+
this.mockMvc.perform(get("/actuator/info"))
61+
.andExpect(status().isOk())
62+
.andDo(MockMvcRestDocumentation.document("info", gitInfo(), buildInfo(), osInfo(), processInfo()));
63+
>>>>>>> 3.3.x
5664
}
5765

5866
private ResponseFieldsSnippet gitInfo() {
@@ -88,6 +96,15 @@ private FieldDescriptor osInfoField(String field, String desc) {
8896
.optional();
8997
}
9098

99+
private ResponseFieldsSnippet processInfo() {
100+
return responseFields(beneathPath("process"),
101+
fieldWithPath("pid").description("Process ID.").type(JsonFieldType.NUMBER),
102+
fieldWithPath("parentPid").description("Parent Process ID (or -1).").type(JsonFieldType.NUMBER),
103+
fieldWithPath("owner").description("Process owner.").type(JsonFieldType.STRING),
104+
fieldWithPath("cpus").description("Number of CPUs available to the process.")
105+
.type(JsonFieldType.NUMBER));
106+
}
107+
91108
@Configuration(proxyBeanMethods = false)
92109
static class TestConfiguration {
93110

@@ -122,6 +139,11 @@ OsInfoContributor osInfoContributor() {
122139
return new OsInfoContributor();
123140
}
124141

142+
@Bean
143+
ProcessInfoContributor processInfoContributor() {
144+
return new ProcessInfoContributor();
145+
}
146+
125147
}
126148

127149
}

0 commit comments

Comments
 (0)