diff --git a/amps/ags/pom.xml b/amps/ags/pom.xml index 0cbb62e1f4..0bd6b3f505 100644 --- a/amps/ags/pom.xml +++ b/amps/ags/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-amps - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/amps/ags/rm-automation/pom.xml b/amps/ags/rm-automation/pom.xml index 1483ad7612..bdc1d544d0 100644 --- a/amps/ags/rm-automation/pom.xml +++ b/amps/ags/rm-automation/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community-parent - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml b/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml index 0e50aa0100..eb319bda4a 100644 --- a/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-automation-community-repo - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/amps/ags/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java b/amps/ags/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java index 117613e04e..d45a8748fb 100644 --- a/amps/ags/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java +++ b/amps/ags/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java @@ -512,7 +512,12 @@ public abstract class BaseAPI try { HttpResponse httpResponse = doRequestJson(HttpPost.class, requestUrl, adminUser, adminPassword, requestParams); - assertEquals("POST request to " + requestUrl + " was not successful.", expectedStatusCode, httpResponse.getStatusLine().getStatusCode()); + if (httpResponse.getStatusLine().getStatusCode() != expectedStatusCode) + { + // It's only possible to stream the response body once, so ensure we only do this if the test has failed. + JSONObject responseJson = responseBodyToJson(httpResponse); + assertEquals("POST request to " + requestUrl + " was not successful. Response: " + responseJson, expectedStatusCode, httpResponse.getStatusLine().getStatusCode()); + } return httpResponse; } catch (InstantiationException | IllegalAccessException error) @@ -521,6 +526,32 @@ public abstract class BaseAPI } } + /** + * Try to convert the response body to a JSON object. + * + * @param response The response. + * @return The JSON object or null if it was not possible to convert the response. + */ + private JSONObject responseBodyToJson(HttpResponse response) + { + try + { + try + { + return new JSONObject(EntityUtils.toString(response.getEntity())); + } + catch (JSONException error) + { + LOGGER.error("Converting message body to JSON failed. Body: {}", response.getEntity().getContent(), error); + } + } + catch (ParseException | IOException error) + { + LOGGER.error("Parsing message body failed.", error); + } + return null; + } + /** * Helper method for handling generic HTTP requests * @param requestType request type (a subclass of {@link HttpRequestBase}) @@ -558,18 +589,7 @@ public abstract class BaseAPI HttpResponse response = client.execute(adminUser, adminPassword, request); LOGGER.info("Response: {}", response.getStatusLine()); - try - { - responseBody = new JSONObject(EntityUtils.toString(response.getEntity())); - } - 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); - } + responseBody = responseBodyToJson(response); switch (response.getStatusLine().getStatusCode()) { diff --git a/amps/ags/rm-community/pom.xml b/amps/ags/rm-community/pom.xml index d771800861..5a454f22f0 100644 --- a/amps/ags/rm-community/pom.xml +++ b/amps/ags/rm-community/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community-parent - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/amps/ags/rm-community/rm-community-repo/pom.xml b/amps/ags/rm-community/rm-community-repo/pom.xml index 3b6116e69e..329d2d34db 100644 --- a/amps/ags/rm-community/rm-community-repo/pom.xml +++ b/amps/ags/rm-community/rm-community-repo/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services-community-repo-parent - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml b/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml index 6a9d1643cb..05a6d119d7 100644 --- a/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml +++ b/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community-repo-parent - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/amps/pom.xml b/amps/pom.xml index f8d7c59979..cc46d9a317 100644 --- a/amps/pom.xml +++ b/amps/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/amps/share-services/pom.xml b/amps/share-services/pom.xml index aec1fc6f7c..9349ce9be2 100644 --- a/amps/share-services/pom.xml +++ b/amps/share-services/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-community-repo-amps - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/core/pom.xml b/core/pom.xml index d5fc23187d..63e4d2d819 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/data-model/pom.xml b/data-model/pom.xml index 312db7f7d0..e37dca5e5c 100644 --- a/data-model/pom.xml +++ b/data-model/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/mmt/pom.xml b/mmt/pom.xml index a79741ddf8..c14330103f 100644 --- a/mmt/pom.xml +++ b/mmt/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/packaging/distribution/pom.xml b/packaging/distribution/pom.xml index 110173e92b..b00c4a24de 100644 --- a/packaging/distribution/pom.xml +++ b/packaging/distribution/pom.xml @@ -9,6 +9,6 @@ org.alfresco alfresco-community-repo-packaging - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/packaging/docker-alfresco/pom.xml b/packaging/docker-alfresco/pom.xml index 978c0c278c..afec06cedc 100644 --- a/packaging/docker-alfresco/pom.xml +++ b/packaging/docker-alfresco/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-packaging - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/packaging/pom.xml b/packaging/pom.xml index 464bf38b04..6570294469 100644 --- a/packaging/pom.xml +++ b/packaging/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/packaging/tests/pom.xml b/packaging/tests/pom.xml index 830ee53379..52e6af2e3a 100644 --- a/packaging/tests/pom.xml +++ b/packaging/tests/pom.xml @@ -6,7 +6,7 @@ org.alfresco alfresco-community-repo-packaging - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/packaging/tests/tas-cmis/pom.xml b/packaging/tests/tas-cmis/pom.xml index fd1b02ffc7..d5c53747c4 100644 --- a/packaging/tests/tas-cmis/pom.xml +++ b/packaging/tests/tas-cmis/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-tests - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/packaging/tests/tas-email/pom.xml b/packaging/tests/tas-email/pom.xml index b81f13655f..e0533e8f52 100644 --- a/packaging/tests/tas-email/pom.xml +++ b/packaging/tests/tas-email/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/packaging/tests/tas-integration/pom.xml b/packaging/tests/tas-integration/pom.xml index 153512c95a..7e44d572ac 100644 --- a/packaging/tests/tas-integration/pom.xml +++ b/packaging/tests/tas-integration/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/packaging/tests/tas-restapi/pom.xml b/packaging/tests/tas-restapi/pom.xml index 5ec23a5ef2..d33ad4d7ae 100644 --- a/packaging/tests/tas-restapi/pom.xml +++ b/packaging/tests/tas-restapi/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-community-repo-tests - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/packaging/tests/tas-webdav/pom.xml b/packaging/tests/tas-webdav/pom.xml index 8b26df1983..c1cb688d83 100644 --- a/packaging/tests/tas-webdav/pom.xml +++ b/packaging/tests/tas-webdav/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/packaging/war/pom.xml b/packaging/war/pom.xml index 39fb824c13..9bec7727e7 100644 --- a/packaging/war/pom.xml +++ b/packaging/war/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-packaging - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/pom.xml b/pom.xml index f07a4eb230..8de2b02298 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 alfresco-community-repo - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT pom Alfresco Community Repo Parent diff --git a/remote-api/pom.xml b/remote-api/pom.xml index 0649d1b339..a0fd52ddb0 100644 --- a/remote-api/pom.xml +++ b/remote-api/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT diff --git a/repository/pom.xml b/repository/pom.xml index d33ad980fa..ba19710a90 100644 --- a/repository/pom.xml +++ b/repository/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 23.1.0.139-SNAPSHOT + 23.1.0.142-SNAPSHOT