From c4e3c6f6846d5de58c72e090d32142f4cd049e21 Mon Sep 17 00:00:00 2001 From: cnechifor Date: Tue, 18 Oct 2016 00:34:39 +0300 Subject: [PATCH] added authentication step for admin tests --- .../java/org/alfresco/rest/comments/AddCommentSanityTests.java | 1 + .../java/org/alfresco/rest/comments/AddCommentsSanityTests.java | 1 + .../org/alfresco/rest/comments/DeleteCommentsSanityTests.java | 1 + .../java/org/alfresco/rest/comments/GetCommentsSanityTests.java | 1 + .../org/alfresco/rest/comments/UpdateCommentsSanityTests.java | 1 + e2e-test/java/org/alfresco/rest/tags/UpdateTagSanityTests.java | 1 + 6 files changed, 6 insertions(+) diff --git a/e2e-test/java/org/alfresco/rest/comments/AddCommentSanityTests.java b/e2e-test/java/org/alfresco/rest/comments/AddCommentSanityTests.java index a7e0d9621..f9a375b77 100644 --- a/e2e-test/java/org/alfresco/rest/comments/AddCommentSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/comments/AddCommentSanityTests.java @@ -48,6 +48,7 @@ public class AddCommentSanityTests extends RestTest TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify admin user adds comments with Rest API and status code is 201") public void adminIsAbleToAddComment() throws JsonToModelConversionException, Exception { + restClient.authenticateUser(adminUserModel); commentsAPI.addComment(document, "This is a new comment added by " + adminUserModel.getUsername()); commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED); } diff --git a/e2e-test/java/org/alfresco/rest/comments/AddCommentsSanityTests.java b/e2e-test/java/org/alfresco/rest/comments/AddCommentsSanityTests.java index 9ee678cd5..d60499925 100644 --- a/e2e-test/java/org/alfresco/rest/comments/AddCommentsSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/comments/AddCommentsSanityTests.java @@ -58,6 +58,7 @@ public class AddCommentsSanityTests extends RestTest TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify admin user adds multiple comments with Rest API and status code is 201") public void adminIsAbleToAddComments() throws JsonToModelConversionException, Exception { + restClient.authenticateUser(adminUserModel); commentsAPI.addComments(document, comment1, comment2); commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED); } diff --git a/e2e-test/java/org/alfresco/rest/comments/DeleteCommentsSanityTests.java b/e2e-test/java/org/alfresco/rest/comments/DeleteCommentsSanityTests.java index 96e4183db..e9ebd6296 100644 --- a/e2e-test/java/org/alfresco/rest/comments/DeleteCommentsSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/comments/DeleteCommentsSanityTests.java @@ -61,6 +61,7 @@ public class DeleteCommentsSanityTests extends RestTest TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify Admin user delete comments with Rest API and status code is 204") public void adminIsAbleToDeleteComments() throws JsonToModelConversionException, Exception { + restClient.authenticateUser(adminUserModel); commentsAPI.deleteComment(document, comment); commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.NO_CONTENT); } diff --git a/e2e-test/java/org/alfresco/rest/comments/GetCommentsSanityTests.java b/e2e-test/java/org/alfresco/rest/comments/GetCommentsSanityTests.java index b0e80372d..d1a82d698 100644 --- a/e2e-test/java/org/alfresco/rest/comments/GetCommentsSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/comments/GetCommentsSanityTests.java @@ -52,6 +52,7 @@ public class GetCommentsSanityTests extends RestTest description= "Verify Admin user gets comments with Rest API and status code is 200") public void adminIsAbleToRetrieveComments() throws JsonToModelConversionException, Exception { + restClient.authenticateUser(adminUserModel); commentsAPI.getNodeComments(document); commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK); } diff --git a/e2e-test/java/org/alfresco/rest/comments/UpdateCommentsSanityTests.java b/e2e-test/java/org/alfresco/rest/comments/UpdateCommentsSanityTests.java index e6a4f9e36..5937f4910 100644 --- a/e2e-test/java/org/alfresco/rest/comments/UpdateCommentsSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/comments/UpdateCommentsSanityTests.java @@ -53,6 +53,7 @@ public class UpdateCommentsSanityTests extends RestTest TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify Admin user updates comments and status code is 200") public void adminIsAbleToUpdateComments() throws JsonToModelConversionException, Exception { + restClient.authenticateUser(adminUserModel); commentsAPI.updateComment(document, commentModel, "This is the updated comment with admin user"); commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK); } diff --git a/e2e-test/java/org/alfresco/rest/tags/UpdateTagSanityTests.java b/e2e-test/java/org/alfresco/rest/tags/UpdateTagSanityTests.java index e8f7f6947..b4cd32b6e 100644 --- a/e2e-test/java/org/alfresco/rest/tags/UpdateTagSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/tags/UpdateTagSanityTests.java @@ -60,6 +60,7 @@ public class UpdateTagSanityTests extends RestTest @Bug(id="MNT-16917") public void adminIsAbleToUpdateTags() throws JsonToModelConversionException, Exception { + restClient.authenticateUser(adminUserModel); tagsAPI.updateTag(oldTag, randomTag).assertTagIs(randomTag); tagsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK); }