test- define new constant in RestErrorModel, updated tests

This commit is contained in:
mionescu
2017-03-02 15:36:05 +02:00
parent 17db722925
commit 0cc33e6f1c
3 changed files with 9 additions and 9 deletions
@@ -154,9 +154,9 @@ public class AddCommentsFullTests extends RestTest
restClient.processModel(RestCommentModel.class, request);
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST);
restClient.assertLastError().getErrorKey().contains("Unrecognized field \"content2\"");
restClient.assertLastError().containsSummary("Unrecognized field \"content2\"");
restClient.assertLastError().getDescriptionURL().contains("https://api-explorer.alfresco.com");
restClient.assertLastError().getStackTrace().contains("For security reasons the stack trace is no longer displayed, but the property is kept for previous versions");
restClient.assertLastError().containsErrorKey(String.format(RestErrorModel.UNRECOGNIZED_FIELD, "content2"));
restClient.assertLastError().containsSummary(String.format(RestErrorModel.UNRECOGNIZED_FIELD, "content2"));
restClient.assertLastError().descriptionURLIs(RestErrorModel.RESTAPIEXPLORER);
restClient.assertLastError().stackTraceIs(RestErrorModel.STACKTRACE);
}
}
@@ -207,9 +207,9 @@ public class GetCommentsFullTests extends RestTest
restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(file).usingParams("maxItems=0").getNodeComments();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError().containsSummary(RestErrorModel.ONLY_POSITIVE_VALUES_MAXITEMS);
restClient.assertLastError().getErrorKey().contains("Only positive values supported for maxItems.");
restClient.assertLastError().containsSummary("Only positive values supported for maxItems.");
restClient.assertLastError().getDescriptionURL().contains("https://api-explorer.alfresco.com");
restClient.assertLastError().getStackTrace().contains("For security reasons the stack trace is no longer displayed, but the property is kept for previous versions");
restClient.assertLastError().containsErrorKey(RestErrorModel.ONLY_POSITIVE_VALUES_MAXITEMS);
restClient.assertLastError().containsSummary(RestErrorModel.ONLY_POSITIVE_VALUES_MAXITEMS);
restClient.assertLastError().descriptionURLIs(RestErrorModel.RESTAPIEXPLORER);
restClient.assertLastError().stackTraceIs(RestErrorModel.STACKTRACE);
}
}
@@ -43,7 +43,7 @@ public class DeleteProcessFullTests extends RestTest
restClient.withWorkflowAPI().usingProcess(process).deleteProcess();
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError()
.containsErrorKey(RestErrorModel.ENTITY_NOT_FOUND_ERRORKEY)
.containsSummary(String.format("%s: %s ", "The entity with id" , process.getId(), RestErrorModel.ENTITY_NOT_FOUND))
.containsSummary(String.format(RestErrorModel.ENTITY_WAS_NOT_FOUND, process.getId()))
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
.stackTraceIs(RestErrorModel.STACKTRACE);