RM-5611 Create data setup method for edit with guides tests.

Also add a new helper method in BaseTest to create a document in
a site and return the noderef.
This commit is contained in:
Tom Page
2017-09-01 13:05:53 +01:00
parent fcac991ffa
commit b2ac4f89ee

View File

@@ -404,11 +404,19 @@ public abstract class BaseAPI
try
{
responseBody = new JSONObject(EntityUtils.toString(response.getEntity()));
}
catch (ParseException | IOException | JSONException error)
String bodyString = EntityUtils.toString(response.getEntity());
try
{
LOGGER.error("Parsing message body failed", error);
responseBody = new JSONObject(bodyString);
}
catch (JSONException error)
{
LOGGER.error("Converting message body to JSON failed. Body: {}", responseBody, error);
}
}
catch (ParseException | IOException error)
{
LOGGER.error("Parsing message body failed.", error);
}
switch (response.getStatusLine().getStatusCode())