Преглед изворни кода

Improve logging of raw rest actions on failure

Log the method and the path.
Nik Everett пре 9 година
родитељ
комит
b7d02fbd1e

+ 5 - 1
test/framework/src/main/java/org/elasticsearch/test/rest/section/DoSection.java

@@ -129,7 +129,11 @@ public class DoSection implements ExecutableSection {
     }
 
     private String formatStatusCodeMessage(RestResponse restResponse, String expected) {
-        return "expected [" + expected + "] status code but api [" + apiCallSection.getApi() + "] returned ["
+        String api = apiCallSection.getApi();
+        if ("raw".equals(api)) {
+            api += "[method=" + apiCallSection.getParams().get("method") + " path=" + apiCallSection.getParams().get("path") + "]";
+        }
+        return "expected [" + expected + "] status code but api [" + api + "] returned ["
                 + restResponse.getStatusCode() + " " + restResponse.getReasonPhrase() + "] [" + restResponse.getBodyAsString() + "]";
     }