REPO-3097 Update error messages after jackson upgrade

This commit is contained in:
Alex Mukha
2017-12-15 11:06:42 +00:00
parent 5fe22a8418
commit 60970324ed
6 changed files with 13 additions and 12 deletions
@@ -441,6 +441,6 @@ public class AddFavoritesTests extends RestTest
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, "", "people/{personId}/favorites", adminUserModel.getUsername());
restClient.processModel(RestPersonFavoritesModel.class, request);
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError()
.containsSummary(String.format(RestErrorModel.NO_CONTENT, "No content to map to Object due to end of input"));;
.containsSummary(String.format(RestErrorModel.NO_CONTENT, "No content to map due to end-of-input"));
}
}
@@ -371,7 +371,7 @@ public class AddRatingTests extends RestTest
restClient.authenticateUser(adminUser).withCoreAPI().usingResource(document).addInvalidRating("");
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError()
.containsSummary(String.format(RestErrorModel.NO_CONTENT, "No content to map to Object due to end of input"));
.containsSummary(String.format(RestErrorModel.NO_CONTENT, "No content to map due to end-of-input"));
}
@TestRail(section = { TestGroup.REST_API, TestGroup.RATINGS },
@@ -384,7 +384,8 @@ public class AddRatingTests extends RestTest
restClient.authenticateUser(adminUser).withCoreAPI().usingResource(document).addInvalidRating("{\"id\":\"\"}");
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError()
.containsSummary(String.format(RestErrorModel.NO_CONTENT, "N/A (through reference chain: org.alfresco.rest.api.model.NodeRating[\"id\"])"));
// The message is shortened for comparison as there is a Java object id in the message (random)
.containsSummary(String.format(RestErrorModel.NO_CONTENT, "N/A"));
}
@TestRail(section = { TestGroup.REST_API, TestGroup.RATINGS },
@@ -417,8 +417,8 @@ public class AddSiteMemberTests extends RestTest
publicSiteModel.getId(), restClient.getParameters());
restClient.processModel(RestSiteMemberModel.class, request);
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError()
.containsSummary(String.format(RestErrorModel.NO_CONTENT, "No content to map to Object due to end of input"))
.containsErrorKey(String.format(RestErrorModel.NO_CONTENT, "No content to map to Object due to end of input"))
.containsSummary(String.format(RestErrorModel.NO_CONTENT, "No content to map due to end-of-input"))
.containsErrorKey(String.format(RestErrorModel.NO_CONTENT, "No content to map due to end-of-input"))
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
.stackTraceIs(RestErrorModel.STACKTRACE);
}
@@ -463,8 +463,8 @@ public class AddSiteMemberTests extends RestTest
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, json, "sites/{siteId}/members?{parameters}", publicSiteModel.getId(), restClient.getParameters());
restClient.processModel(RestSiteMemberModel.class, request);
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError()
.containsErrorKey(String.format(RestErrorModel.NO_CONTENT, "N/A (through reference chain: org.alfresco.rest.api.model.SiteMember[\"role\"])"))
.containsSummary(String.format(RestErrorModel.NO_CONTENT, "N/A (through reference chain: org.alfresco.rest.api.model.SiteMember[\"role\"])"))
.containsErrorKey(String.format(RestErrorModel.NO_CONTENT, "N/A"))
.containsSummary(String.format(RestErrorModel.NO_CONTENT, "N/A"))
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
.stackTraceIs(RestErrorModel.STACKTRACE);
}
@@ -523,8 +523,8 @@ public class UpdateSiteMemberTests extends RestTest
RestRequest request = RestRequest.requestWithBody(HttpMethod.PUT, "", "sites/{siteId}/members/{personId}", publicSite.getId(), siteCollaborator.getUsername());
restClient.processModel(RestSiteMemberModel.class, request);
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError()
.containsSummary(String.format(RestErrorModel.NO_CONTENT, "No content to map to Object due to end of input"))
.containsErrorKey(String.format(RestErrorModel.NO_CONTENT, "No content to map to Object due to end of input"))
.containsSummary(String.format(RestErrorModel.NO_CONTENT, "No content to map due to end-of-input"))
.containsErrorKey(String.format(RestErrorModel.NO_CONTENT, "No content to map due to end-of-input"))
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
.stackTraceIs(RestErrorModel.STACKTRACE);
}
@@ -146,7 +146,7 @@ public class AddSiteMembershipRequestTests extends RestTest
UserModel newMember = dataUser.createRandomTestUser();
restClient.authenticateUser(newMember).withCoreAPI().usingMe().addSiteMembershipRequest("");
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
.assertLastError().containsSummary(String.format(RestErrorModel.NO_CONTENT, "No content to map to Object due to end of input"));
.assertLastError().containsSummary(String.format(RestErrorModel.NO_CONTENT, "No content to map due to end-of-input"));
}
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION })
@@ -439,8 +439,8 @@ public class UpdateSiteMembershipRequestTests extends RestTest
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
.assertLastError()
.containsSummary(String.format(RestErrorModel.NO_CONTENT, "No content to map to Object due to end of input"))
.containsErrorKey(String.format(RestErrorModel.NO_CONTENT, "No content to map to Object due to end of input"))
.containsSummary(String.format(RestErrorModel.NO_CONTENT, "No content to map due to end-of-input"))
.containsErrorKey(String.format(RestErrorModel.NO_CONTENT, "No content to map due to end-of-input"))
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
.stackTraceIs(RestErrorModel.STACKTRACE);
}