Skip to content

Commit 2dfe9de

Browse files
committed
Merge branch '3.4.x'
2 parents 4219c83 + 7d8c921 commit 2dfe9de

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

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

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,9 @@
5151
class InfoEndpointDocumentationTests extends MockMvcEndpointDocumentationTests {
5252

5353
@Test
54-
<<<<<<< HEAD
5554
void info() {
5655
assertThat(this.mvc.get().uri("/actuator/info")).hasStatusOk()
57-
.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
56+
.apply(MockMvcRestDocumentation.document("info", gitInfo(), buildInfo(), osInfo(), processInfo()));
6457
}
6558

6659
private ResponseFieldsSnippet gitInfo() {
@@ -85,13 +78,13 @@ private ResponseFieldsSnippet buildInfo() {
8578
}
8679

8780
private ResponseFieldsSnippet osInfo() {
88-
return responseFields(beneathPath("os"), osInfoField("name", "Name"), osInfoField("version", "Version"),
89-
osInfoField("arch", "Architecture"));
81+
return responseFields(beneathPath("os"), osInfoField("name", "Name of the operating system"),
82+
osInfoField("version", "Version of the operating system"),
83+
osInfoField("arch", "Architecture of the operating system"));
9084
}
9185

9286
private FieldDescriptor osInfoField(String field, String desc) {
93-
return fieldWithPath(field)
94-
.description("Operating System " + desc + " (as obtained from the 'os." + field + "' system property).")
87+
return fieldWithPath(field).description(desc + " (as obtained from the 'os." + field + "' system property).")
9588
.type(JsonFieldType.STRING)
9689
.optional();
9790
}
@@ -102,7 +95,20 @@ private ResponseFieldsSnippet processInfo() {
10295
fieldWithPath("parentPid").description("Parent Process ID (or -1).").type(JsonFieldType.NUMBER),
10396
fieldWithPath("owner").description("Process owner.").type(JsonFieldType.STRING),
10497
fieldWithPath("cpus").description("Number of CPUs available to the process.")
105-
.type(JsonFieldType.NUMBER));
98+
.type(JsonFieldType.NUMBER),
99+
fieldWithPath("memory").description("Memory information."),
100+
fieldWithPath("memory.heap").description("Heap memory."),
101+
fieldWithPath("memory.heap.init").description("The number of bytes initially requested by the JVM."),
102+
fieldWithPath("memory.heap.used").description("The number of bytes currently being used."),
103+
fieldWithPath("memory.heap.committed").description("The number of bytes committed for JVM use."),
104+
fieldWithPath("memory.heap.max")
105+
.description("The maximum number of bytes that can be used by the JVM (or -1)."),
106+
fieldWithPath("memory.nonHeap").description("Non-heap memory."),
107+
fieldWithPath("memory.nonHeap.init").description("The number of bytes initially requested by the JVM."),
108+
fieldWithPath("memory.nonHeap.used").description("The number of bytes currently being used."),
109+
fieldWithPath("memory.nonHeap.committed").description("The number of bytes committed for JVM use."),
110+
fieldWithPath("memory.nonHeap.max")
111+
.description("The maximum number of bytes that can be used by the JVM (or -1)."));
106112
}
107113

108114
@Configuration(proxyBeanMethods = false)

0 commit comments

Comments
 (0)