From ce99c122d3edebd53770924016b5e5ae36f6d2ac Mon Sep 17 00:00:00 2001 From: cagache Date: Wed, 23 Nov 2016 14:27:09 +0200 Subject: [PATCH] added bug annotation --- .../rest/comments/DeleteCommentsSanityTests.java | 16 ++++++++-------- .../rest/people/DeleteSiteMemberSanityTests.java | 3 ++- .../rest/sites/GetSiteMembersSanityTests.java | 3 ++- .../alfresco/rest/tags/DeleteTagSanityTests.java | 2 ++ 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/e2e-test/java/org/alfresco/rest/comments/DeleteCommentsSanityTests.java b/e2e-test/java/org/alfresco/rest/comments/DeleteCommentsSanityTests.java index cce059c56..359a3f27d 100644 --- a/e2e-test/java/org/alfresco/rest/comments/DeleteCommentsSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/comments/DeleteCommentsSanityTests.java @@ -6,10 +6,8 @@ import org.alfresco.rest.exception.JsonToModelConversionException; import org.alfresco.rest.model.RestCommentModel; import org.alfresco.utility.constants.UserRole; import org.alfresco.utility.data.DataUser.ListUserWithRoles; -import org.alfresco.utility.model.FileModel; -import org.alfresco.utility.model.SiteModel; -import org.alfresco.utility.model.TestGroup; -import org.alfresco.utility.model.UserModel; +import org.alfresco.utility.model.*; +import org.alfresco.utility.report.Bug; import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.annotation.TestRail; import org.springframework.http.HttpStatus; @@ -76,14 +74,16 @@ public class DeleteCommentsSanityTests extends RestTest restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT); } + @Bug(id="MNT-16904") @TestRail(section = { TestGroup.REST_API, - TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify Manager user gets status code 401 if authentication call fails") - public void managerIsNotAbleToDeleteCommentIfAuthenticationFails() throws JsonToModelConversionException, Exception + TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify User gets status code 401 if authentication call fails") + public void userIsNotAbleToDeleteCommentIfAuthenticationFails() throws JsonToModelConversionException, Exception { + restClient.authenticateUser(adminUserModel); + comment = restClient.withCoreAPI().usingResource(document).addComment("New comment addded by admin"); UserModel nonexistentModel = new UserModel("nonexistentUser", "nonexistentPassword"); restClient.authenticateUser(nonexistentModel); - comment = restClient.withCoreAPI().usingResource(document).addComment("New comment addded by Manager"); restClient.withCoreAPI().usingResource(document).deleteComment(comment); - restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED); + restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastException().hasName(StatusModel.UNAUTHORIZED); } } diff --git a/e2e-test/java/org/alfresco/rest/people/DeleteSiteMemberSanityTests.java b/e2e-test/java/org/alfresco/rest/people/DeleteSiteMemberSanityTests.java index f93657375..48540caac 100644 --- a/e2e-test/java/org/alfresco/rest/people/DeleteSiteMemberSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/people/DeleteSiteMemberSanityTests.java @@ -115,7 +115,8 @@ public class DeleteSiteMemberSanityTests extends RestTest restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN) .assertLastError().containsSummary(ErrorModel.PERMISSION_WAS_DENIED); } - + + @Bug(id="MNT-16904") @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to delete another member of the site") diff --git a/e2e-test/java/org/alfresco/rest/sites/GetSiteMembersSanityTests.java b/e2e-test/java/org/alfresco/rest/sites/GetSiteMembersSanityTests.java index acf806253..752cfa6f4 100644 --- a/e2e-test/java/org/alfresco/rest/sites/GetSiteMembersSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/sites/GetSiteMembersSanityTests.java @@ -8,6 +8,7 @@ import org.alfresco.utility.data.DataUser; import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.exception.DataPreparationException; import org.alfresco.utility.model.SiteModel; +import org.alfresco.utility.model.StatusModel; import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.UserModel; import org.alfresco.utility.report.Bug; @@ -108,6 +109,6 @@ public class GetSiteMembersSanityTests extends RestTest dataUser.addUserToSite(userModel, siteModel, UserRole.SiteManager); restClient.authenticateUser(userModel) .withCoreAPI().usingSite(siteModel).getSiteMembers(); - restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED); + restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastException().hasName(StatusModel.UNAUTHORIZED); } } diff --git a/e2e-test/java/org/alfresco/rest/tags/DeleteTagSanityTests.java b/e2e-test/java/org/alfresco/rest/tags/DeleteTagSanityTests.java index 8d55a4699..97a23746a 100644 --- a/e2e-test/java/org/alfresco/rest/tags/DeleteTagSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/tags/DeleteTagSanityTests.java @@ -13,6 +13,7 @@ import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.StatusModel; import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.UserModel; +import org.alfresco.utility.report.Bug; import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.annotation.TestRail; import org.springframework.http.HttpStatus; @@ -112,6 +113,7 @@ public class DeleteTagSanityTests extends RestTest restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError().containsSummary(ErrorModel.PERMISSION_WAS_DENIED); } + @Bug(id="MNT-16904") @TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails") public void userIsNotAbleToDeleteTagIfAuthenticationFails() throws JsonToModelConversionException, Exception