[TEST] Expand failure message for wildfly integration tests
@@ -26,6 +26,7 @@ import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.util.EntityUtils;
import org.apache.lucene.util.LuceneTestCase;
import org.elasticsearch.Build;
import org.elasticsearch.Version;
@@ -78,7 +79,9 @@ public class WildflyIT extends LuceneTestCase {
}
put.setEntity(new StringEntity(body, ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = client.execute(put)) {
- assertThat(response.getStatusLine().getStatusCode(), equalTo(201));
+ int status = response.getStatusLine().getStatusCode();
+ assertThat("expected a 201 response but got: " + status + " - body: " + EntityUtils.toString(response.getEntity()),
+ status, equalTo(201));
}
final HttpGet get = new HttpGet(new URI(str));
