You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2017/03/29 07:45:49 UTC

svn commit: r1789289 - /sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/http/RequestExecutor.java

Author: kwin
Date: Wed Mar 29 07:45:49 2017
New Revision: 1789289

URL: http://svn.apache.org/viewvc?rev=1789289&view=rev
Log:
include response body when asserting an http status code

to ease finding issues, when the test fails

Modified:
    sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/http/RequestExecutor.java

Modified: sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/http/RequestExecutor.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/http/RequestExecutor.java?rev=1789289&r1=1789288&r2=1789289&view=diff
==============================================================================
--- sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/http/RequestExecutor.java (original)
+++ sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/http/RequestExecutor.java Wed Mar 29 07:45:49 2017
@@ -152,7 +152,7 @@ public class RequestExecutor {
     /** Verify that response matches supplied status */
     public RequestExecutor assertStatus(int expected) {
         assertNotNull(this.toString(), response);
-        assertEquals(this + ": expecting status " + expected, expected, response.getStatusLine().getStatusCode());
+        assertEquals(this + ": \nBody: " + content + "\nHTTP status: ", expected, response.getStatusLine().getStatusCode());
         return this;
     }