From 55426208ab895b1f45907079192f2ffbbfa813f1 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 19 Feb 2019 09:12:54 +0000 Subject: [PATCH] Provide type information for optional thread dump endpoint response fields Closes gh-15989 --- .../ThreadDumpEndpointDocumentationTests.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/ThreadDumpEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/ThreadDumpEndpointDocumentationTests.java index a213b566b459..00acfc09a474 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/ThreadDumpEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/ThreadDumpEndpointDocumentationTests.java @@ -84,20 +84,21 @@ public void threadDump() throws Exception { .description( "Description of the object on which the " + "thread is blocked, if any.") - .optional(), - fieldWithPath("threads.[].lockInfo").description( - "Object for which the thread is blocked " - + "waiting.") - .optional(), + .optional().type(JsonFieldType.STRING), + fieldWithPath("threads.[].lockInfo") + .description( + "Object for which the thread is blocked " + + "waiting.") + .optional().type(JsonFieldType.OBJECT), fieldWithPath("threads.[].lockInfo.className") .description( "Fully qualified class name of the lock" + " object.") - .optional(), + .optional().type(JsonFieldType.STRING), fieldWithPath("threads.[].lockInfo.identityHashCode") .description( "Identity hash code of the lock object.") - .optional(), + .optional().type(JsonFieldType.NUMBER), fieldWithPath("threads.[].lockedMonitors").description( "Monitors locked by this thread, if any"), fieldWithPath("threads.[].lockedMonitors.[].className")