test: mark @bug test for 5.2.N

This commit is contained in:
Paul Brodner
2016-12-14 12:07:48 +02:00
parent 2a6f1503b6
commit 23bf361238
41 changed files with 125 additions and 94 deletions
@@ -14,7 +14,6 @@ import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.FileType; import org.alfresco.utility.model.FileType;
import org.alfresco.utility.model.LinkModel; import org.alfresco.utility.model.LinkModel;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug; import org.alfresco.utility.report.Bug;
@@ -148,7 +147,7 @@ public class AddCommentCoreTests extends RestTest
restClient.authenticateUser(member) restClient.authenticateUser(member)
.withCoreAPI().usingResource(document).addComment(comment); .withCoreAPI().usingResource(document).addComment(comment);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
@TestRail(section = { TestGroup.REST_API, TestGroup.COMMENTS }, executionType = ExecutionType.REGRESSION, @TestRail(section = { TestGroup.REST_API, TestGroup.COMMENTS }, executionType = ExecutionType.REGRESSION,
@@ -9,7 +9,6 @@ import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.model.FileModel; import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug; import org.alfresco.utility.report.Bug;
@@ -101,12 +100,13 @@ public class AddCommentSanityTests extends RestTest
} }
@TestRail(section = { TestGroup.REST_API, TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user gets status code 401 on post comments call") @TestRail(section = { TestGroup.REST_API, TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user gets status code 401 on post comments call")
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.SANITY })
@Bug(id = "MNT-16904")
public void unauthenticatedUserIsNotAbleToAddComment() throws JsonToModelConversionException, Exception public void unauthenticatedUserIsNotAbleToAddComment() throws JsonToModelConversionException, Exception
{ {
restClient.authenticateUser(new UserModel("random user", "random password")); restClient.authenticateUser(new UserModel("random user", "random password"));
restClient.withCoreAPI().usingResource(document).addComment("This is a new comment"); restClient.withCoreAPI().usingResource(document).addComment("This is a new comment");
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -8,9 +8,9 @@ import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.model.FileModel; import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -82,6 +82,7 @@ public class DeleteCommentsSanityTests extends RestTest
@TestRail(section = { TestGroup.REST_API,TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify User gets status code 401 if authentication call fails") @TestRail(section = { TestGroup.REST_API,TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify User gets status code 401 if authentication call fails")
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.SANITY })
@Bug(id="MNT-16904")
public void userIsNotAbleToDeleteCommentIfAuthenticationFails() throws JsonToModelConversionException, Exception public void userIsNotAbleToDeleteCommentIfAuthenticationFails() throws JsonToModelConversionException, Exception
{ {
restClient.authenticateUser(adminUserModel); restClient.authenticateUser(adminUserModel);
@@ -89,6 +90,6 @@ public class DeleteCommentsSanityTests extends RestTest
UserModel nonexistentModel = new UserModel("nonexistentUser", "nonexistentPassword"); UserModel nonexistentModel = new UserModel("nonexistentUser", "nonexistentPassword");
restClient.authenticateUser(nonexistentModel); restClient.authenticateUser(nonexistentModel);
restClient.withCoreAPI().usingResource(document).deleteComment(comment); restClient.withCoreAPI().usingResource(document).deleteComment(comment);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -8,9 +8,9 @@ import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.model.FileModel; import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -98,12 +98,13 @@ public class GetCommentsSanityTests extends RestTest
@TestRail(section={TestGroup.REST_API, TestGroup.SANITY}, executionType= ExecutionType.SANITY, @TestRail(section={TestGroup.REST_API, TestGroup.SANITY}, executionType= ExecutionType.SANITY,
description= "Verify Manager user gets status code 401 if authentication call fails") description= "Verify Manager user gets status code 401 if authentication call fails")
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.SANITY })
@Bug(id="MNT-16904")
public void managerIsNotAbleToRetrieveCommentIfAuthenticationFails() throws JsonToModelConversionException, Exception public void managerIsNotAbleToRetrieveCommentIfAuthenticationFails() throws JsonToModelConversionException, Exception
{ {
UserModel nonexistentModel = new UserModel("nonexistentUser", "nonexistentPassword"); UserModel nonexistentModel = new UserModel("nonexistentUser", "nonexistentPassword");
restClient.authenticateUser(nonexistentModel).withCoreAPI() restClient.authenticateUser(nonexistentModel).withCoreAPI()
.usingResource(document).getNodeComments(); .usingResource(document).getNodeComments();
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
@TestRail(section={TestGroup.REST_API, TestGroup.SANITY}, executionType= ExecutionType.SANITY, @TestRail(section={TestGroup.REST_API, TestGroup.SANITY}, executionType= ExecutionType.SANITY,
@@ -10,7 +10,6 @@ import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.model.FileModel; import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.FolderModel; import org.alfresco.utility.model.FolderModel;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug; import org.alfresco.utility.report.Bug;
@@ -107,6 +106,7 @@ public class UpdateCommentsSanityTests extends RestTest
@TestRail(section = { TestGroup.REST_API, @TestRail(section = { TestGroup.REST_API,
TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user gets status code 401 on update comment call") TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user gets status code 401 on update comment call")
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.SANITY })
@Bug(id="MNT-16904")
public void unauthenticatedUserIsNotAbleToUpdateComment() throws JsonToModelConversionException, Exception public void unauthenticatedUserIsNotAbleToUpdateComment() throws JsonToModelConversionException, Exception
{ {
restClient.authenticateUser(adminUserModel); restClient.authenticateUser(adminUserModel);
@@ -114,7 +114,7 @@ public class UpdateCommentsSanityTests extends RestTest
UserModel incorrectUserModel = new UserModel("userName", "password"); UserModel incorrectUserModel = new UserModel("userName", "password");
restClient.authenticateUser(incorrectUserModel) restClient.authenticateUser(incorrectUserModel)
.withCoreAPI().usingResource(document).updateComment(commentModel, "try to update"); .withCoreAPI().usingResource(document).updateComment(commentModel, "try to update");
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
@TestRail(section = { TestGroup.REST_API, TestGroup.SANITY }, executionType = ExecutionType.SANITY, description = "Verify update comment with inexistent nodeId returns status code 404") @TestRail(section = { TestGroup.REST_API, TestGroup.SANITY }, executionType = ExecutionType.SANITY, description = "Verify update comment with inexistent nodeId returns status code 404")
@@ -6,7 +6,6 @@ import org.alfresco.rest.model.RestPersonFavoritesModel;
import org.alfresco.utility.constants.UserRole; import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug; import org.alfresco.utility.report.Bug;
@@ -98,6 +97,6 @@ public class AddFavoritesSanityTests extends RestTest
UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager); UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager);
siteManager.setPassword("wrongPassword"); siteManager.setPassword("wrongPassword");
restClient.authenticateUser(siteManager).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel); restClient.authenticateUser(siteManager).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -11,9 +11,9 @@ import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.model.FileModel; import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.FolderModel; import org.alfresco.utility.model.FolderModel;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -175,12 +175,13 @@ public class GetFavoriteSanityTests extends RestTest
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, @TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
description = "Verify user gets status code 401 if authentication call fails") description = "Verify user gets status code 401 if authentication call fails")
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
@Bug(id = "MNT-16904")
public void userIsNotAbleToRetrieveFavoritesIfAuthenticationFails() throws JsonToModelConversionException, Exception public void userIsNotAbleToRetrieveFavoritesIfAuthenticationFails() throws JsonToModelConversionException, Exception
{ {
UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager); UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager);
siteManager.setPassword("wrongPassword"); siteManager.setPassword("wrongPassword");
restClient.authenticateUser(siteManager).withCoreAPI() restClient.authenticateUser(siteManager).withCoreAPI()
.usingUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager)).getFavorite(siteModel.getGuid()); .usingUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager)).getFavorite(siteModel.getGuid());
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -10,9 +10,9 @@ import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.model.FileModel; import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.FolderModel; import org.alfresco.utility.model.FolderModel;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -188,11 +188,12 @@ public class GetFavoritesSanityTests extends RestTest
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, @TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
description = "Verify user gets status code 401 if authentication call fails") description = "Verify user gets status code 401 if authentication call fails")
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
@Bug(id="MNT-16904")
public void userIsNotAbleToRetrieveFavoritesIfAuthenticationFails() throws JsonToModelConversionException, Exception public void userIsNotAbleToRetrieveFavoritesIfAuthenticationFails() throws JsonToModelConversionException, Exception
{ {
UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager); UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager);
siteManager.setPassword("wrongPassword"); siteManager.setPassword("wrongPassword");
restClient.authenticateUser(siteManager).withCoreAPI().usingAuthUser().getFavorites(); restClient.authenticateUser(siteManager).withCoreAPI().usingAuthUser().getFavorites();
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -4,9 +4,9 @@ import org.alfresco.rest.RestTest;
import org.alfresco.rest.model.RestFavoriteSiteModel; import org.alfresco.rest.model.RestFavoriteSiteModel;
import org.alfresco.utility.constants.UserRole; import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -92,6 +92,7 @@ public class AddFavoriteSiteSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify a manager user is NOT Authorized to add a favorite site with Rest API when authentication fails (401)") @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify a manager user is NOT Authorized to add a favorite site with Rest API when authentication fails (401)")
@Bug(id="MNT-16904")
public void managerUserNotAuthorizedFailsToAddFavoriteSite() throws Exception public void managerUserNotAuthorizedFailsToAddFavoriteSite() throws Exception
{ {
UserModel managerUser = dataUser.usingAdmin().createRandomTestUser(); UserModel managerUser = dataUser.usingAdmin().createRandomTestUser();
@@ -99,6 +100,6 @@ public class AddFavoriteSiteSanityTests extends RestTest
managerUser.setPassword("newpassword"); managerUser.setPassword("newpassword");
restClient.authenticateUser(managerUser).withCoreAPI().usingAuthUser().addFavoriteSite(siteModel); restClient.authenticateUser(managerUser).withCoreAPI().usingAuthUser().addFavoriteSite(siteModel);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -9,7 +9,6 @@ import org.alfresco.utility.data.DataUser;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.exception.DataPreparationException; import org.alfresco.utility.exception.DataPreparationException;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug; import org.alfresco.utility.report.Bug;
@@ -19,7 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@Test(groups="DEV")
public class AddSiteMembershipRequestSanityTests extends RestTest public class AddSiteMembershipRequestSanityTests extends RestTest
{ {
@Autowired @Autowired
@@ -104,11 +103,12 @@ public class AddSiteMembershipRequestSanityTests extends RestTest
} }
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to create new site membership request") @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to create new site membership request")
@Bug(id = "MNT-16557")
public void unauthenticatedUserIsNotAbleToCreateSiteMembershipRequest() throws JsonToModelConversionException, Exception public void unauthenticatedUserIsNotAbleToCreateSiteMembershipRequest() throws JsonToModelConversionException, Exception
{ {
UserModel newMember = dataUser.createRandomTestUser(); UserModel newMember = dataUser.createRandomTestUser();
restClient.authenticateUser(new UserModel("random user", "random password")).withCoreAPI().usingUser(newMember).addSiteMembershipRequest(siteModel); restClient.authenticateUser(new UserModel("random user", "random password")).withCoreAPI().usingUser(newMember).addSiteMembershipRequest(siteModel);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -4,9 +4,9 @@ import org.alfresco.rest.RestTest;
import org.alfresco.rest.model.RestErrorModel; import org.alfresco.rest.model.RestErrorModel;
import org.alfresco.utility.constants.UserRole; import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -112,6 +112,7 @@ public class DeleteFavoriteSiteSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify manager user is NOT Authorized to remove a site from its favorite sites list with Rest API when authentication fails (401)") @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify manager user is NOT Authorized to remove a site from its favorite sites list with Rest API when authentication fails (401)")
@Bug(id = "MNT-16904")
public void managerUserNotAuthorizedFailsToRemoveFavoriteSite() throws Exception public void managerUserNotAuthorizedFailsToRemoveFavoriteSite() throws Exception
{ {
UserModel managerUser = dataUser.usingAdmin().createRandomTestUser(); UserModel managerUser = dataUser.usingAdmin().createRandomTestUser();
@@ -121,6 +122,6 @@ public class DeleteFavoriteSiteSanityTests extends RestTest
managerUser.setPassword("newpassword"); managerUser.setPassword("newpassword");
restClient.authenticateUser(managerUser).withCoreAPI().usingAuthUser().removeFavoriteSite(siteModel1); restClient.authenticateUser(managerUser).withCoreAPI().usingAuthUser().removeFavoriteSite(siteModel1);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -7,9 +7,9 @@ import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.exception.DataPreparationException; import org.alfresco.utility.exception.DataPreparationException;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -100,11 +100,12 @@ public class DeleteSiteMemberSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to delete another member of the site") @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to delete another member of the site")
@Bug(id = "MNT-16904")
public void unauthenticatedUserIsNotAbleToDeleteSiteMember() throws JsonToModelConversionException, DataPreparationException, Exception public void unauthenticatedUserIsNotAbleToDeleteSiteMember() throws JsonToModelConversionException, DataPreparationException, Exception
{ {
restClient.authenticateUser(new UserModel("random user", "random password")); restClient.authenticateUser(new UserModel("random user", "random password"));
restClient.withCoreAPI().usingUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer)).deleteSiteMember(siteModel); restClient.withCoreAPI().usingUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer)).deleteSiteMember(siteModel);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -8,7 +8,6 @@ import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.data.RandomData; import org.alfresco.utility.data.RandomData;
import org.alfresco.utility.exception.DataPreparationException; import org.alfresco.utility.exception.DataPreparationException;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug; import org.alfresco.utility.report.Bug;
@@ -126,11 +125,12 @@ public class DeleteSiteMembershipRequestSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, description = "Failed authentication get site member call returns status code 401") @TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, description = "Failed authentication get site member call returns status code 401")
@Bug(id = "MNT-16904")
public void unauthenticatedUserIsNotAuthorizedToDeleteSiteMmebershipRequest() throws JsonToModelConversionException, Exception public void unauthenticatedUserIsNotAuthorizedToDeleteSiteMmebershipRequest() throws JsonToModelConversionException, Exception
{ {
restClient.authenticateUser(dataUser.createRandomTestUser()).withCoreAPI().usingAuthUser().addSiteMembershipRequest(siteModel); restClient.authenticateUser(dataUser.createRandomTestUser()).withCoreAPI().usingAuthUser().addSiteMembershipRequest(siteModel);
UserModel inexistentUser = new UserModel("inexistent user", "inexistent password"); UserModel inexistentUser = new UserModel("inexistent user", "inexistent password");
restClient.authenticateUser(inexistentUser).withCoreAPI().usingAuthUser().deleteSiteMembershipRequest(siteModel); restClient.authenticateUser(inexistentUser).withCoreAPI().usingAuthUser().deleteSiteMembershipRequest(siteModel);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -5,9 +5,9 @@ import org.alfresco.rest.model.RestErrorModel;
import org.alfresco.rest.model.RestSiteModel; import org.alfresco.rest.model.RestSiteModel;
import org.alfresco.utility.constants.UserRole; import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -121,6 +121,7 @@ public class GetFavoriteSiteSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify manager user is NOT Authorized gets its specific favorite site with Rest API when authentication fails (401)") @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify manager user is NOT Authorized gets its specific favorite site with Rest API when authentication fails (401)")
@Bug(id="MNT-16904")
public void managerUserNotAuthorizedFailsToGetFavoriteSite() throws Exception public void managerUserNotAuthorizedFailsToGetFavoriteSite() throws Exception
{ {
UserModel managerUser = dataUser.usingAdmin().createRandomTestUser(); UserModel managerUser = dataUser.usingAdmin().createRandomTestUser();
@@ -130,6 +131,6 @@ public class GetFavoriteSiteSanityTests extends RestTest
managerUser.setPassword("newpassword"); managerUser.setPassword("newpassword");
restClient.authenticateUser(managerUser).withCoreAPI().usingAuthUser().getFavoriteSite(siteModel1); restClient.authenticateUser(managerUser).withCoreAPI().usingAuthUser().getFavoriteSite(siteModel1);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -5,9 +5,9 @@ import org.alfresco.rest.model.RestErrorModel;
import org.alfresco.rest.model.RestSiteModelsCollection; import org.alfresco.rest.model.RestSiteModelsCollection;
import org.alfresco.utility.constants.UserRole; import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -110,6 +110,7 @@ public class GetFavoriteSitesSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify any user is NOT Authorized to get its favorite sites with Rest API when authentication fails (401)") @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify any user is NOT Authorized to get its favorite sites with Rest API when authentication fails (401)")
@Bug(id = "MNT-16904")
public void anyUserNotAuthenticatedIsNotAuthorizedToGetFavoriteSites() throws Exception public void anyUserNotAuthenticatedIsNotAuthorizedToGetFavoriteSites() throws Exception
{ {
UserModel anyUser = dataUser.usingAdmin().createRandomTestUser(); UserModel anyUser = dataUser.usingAdmin().createRandomTestUser();
@@ -117,6 +118,6 @@ public class GetFavoriteSitesSanityTests extends RestTest
anyUser.setPassword("newpassword"); anyUser.setPassword("newpassword");
restClient.authenticateUser(anyUser).withCoreAPI().usingAuthUser().getFavoriteSites(); restClient.authenticateUser(anyUser).withCoreAPI().usingAuthUser().getFavoriteSites();
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -6,9 +6,9 @@ import org.alfresco.rest.model.RestActivityModelsCollection;
import org.alfresco.utility.constants.UserRole; import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser; import org.alfresco.utility.data.DataUser;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -97,9 +97,10 @@ public class GetPeopleActivitiesSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.ACTIVITIES, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.ACTIVITIES, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.ACTIVITIES }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is NOT Authorized to gets another user activities with Rest API") @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.ACTIVITIES }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is NOT Authorized to gets another user activities with Rest API")
@Bug(id = "MNT-16904")
public void unauthenticatedUserShouldNotGetPeopleActivitiesList() throws Exception public void unauthenticatedUserShouldNotGetPeopleActivitiesList() throws Exception
{ {
restClient.authenticateUser(unauthenticatedUser).withCoreAPI().usingUser(userModel).getPersonActivities(); restClient.authenticateUser(unauthenticatedUser).withCoreAPI().usingUser(userModel).getPersonActivities();
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -5,9 +5,9 @@ import org.alfresco.rest.model.RestPreferenceModel;
import org.alfresco.utility.constants.PreferenceName; import org.alfresco.utility.constants.PreferenceName;
import org.alfresco.utility.constants.UserRole; import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -104,6 +104,7 @@ public class GetPeoplePreferenceSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.PREFERENCES, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.PREFERENCES, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.PREFERENCES }, executionType = ExecutionType.SANITY, description = "Verify manager user is NOT Authorized to get a specific preference with Rest API when authentication fails (401)") @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.PREFERENCES }, executionType = ExecutionType.SANITY, description = "Verify manager user is NOT Authorized to get a specific preference with Rest API when authentication fails (401)")
@Bug(id = "MNT-16904")
public void managerUserNotAuthorizedFailsToGetsAPreference() throws Exception public void managerUserNotAuthorizedFailsToGetsAPreference() throws Exception
{ {
UserModel managerUser = dataUser.usingAdmin().createRandomTestUser(); UserModel managerUser = dataUser.usingAdmin().createRandomTestUser();
@@ -113,6 +114,6 @@ public class GetPeoplePreferenceSanityTests extends RestTest
restClient.authenticateUser(managerUser).withCoreAPI().usingAuthUser() restClient.authenticateUser(managerUser).withCoreAPI().usingAuthUser()
.getPersonPreferenceInformation(PreferenceName.SITES_FAVORITES_PREFIX + siteModel.getId()); .getPersonPreferenceInformation(PreferenceName.SITES_FAVORITES_PREFIX + siteModel.getId());
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -5,9 +5,9 @@ import org.alfresco.rest.model.RestPreferenceModelsCollection;
import org.alfresco.utility.constants.PreferenceName; import org.alfresco.utility.constants.PreferenceName;
import org.alfresco.utility.constants.UserRole; import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -106,6 +106,7 @@ public class GetPeoplePreferencesSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.PREFERENCES, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.PREFERENCES, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.PREFERENCES }, executionType = ExecutionType.SANITY, description = "Verify manager user is NOT Authorized to gets its preferences with Rest API when authentication fails(401)") @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.PREFERENCES }, executionType = ExecutionType.SANITY, description = "Verify manager user is NOT Authorized to gets its preferences with Rest API when authentication fails(401)")
@Bug(id = "MNT-16904")
public void managerUserGetsPeoplePreferencesIsNotAuthorized() throws Exception public void managerUserGetsPeoplePreferencesIsNotAuthorized() throws Exception
{ {
UserModel managerUser = dataUser.usingAdmin().createRandomTestUser(); UserModel managerUser = dataUser.usingAdmin().createRandomTestUser();
@@ -114,6 +115,6 @@ public class GetPeoplePreferencesSanityTests extends RestTest
managerUser.setPassword("newpassword"); managerUser.setPassword("newpassword");
restClient.authenticateUser(managerUser).withCoreAPI().usingAuthUser().getPersonPreferences(); restClient.authenticateUser(managerUser).withCoreAPI().usingAuthUser().getPersonPreferences();
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -6,6 +6,7 @@ import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -36,13 +37,14 @@ public class GetSiteMembershipRequestCoreTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.CORE }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.CORE })
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION, description = "Verify contributor user fails to get all site membership requests of a specific person with Rest API when the authentication fails (401)") @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION, description = "Verify contributor user fails to get all site membership requests of a specific person with Rest API when the authentication fails (401)")
@Bug(id="16904")
public void unauthorizedContributorUserFailsToGetSiteMembershipRequests() throws Exception public void unauthorizedContributorUserFailsToGetSiteMembershipRequests() throws Exception
{ {
UserModel contributor = dataUser.usingAdmin().createRandomTestUser(); UserModel contributor = dataUser.usingAdmin().createRandomTestUser();
dataUser.usingUser(userModel).addUserToSite(contributor, siteModel, UserRole.SiteContributor); dataUser.usingUser(userModel).addUserToSite(contributor, siteModel, UserRole.SiteContributor);
contributor.setPassword("newpassword"); contributor.setPassword("newpassword");
restClient.authenticateUser(contributor).withCoreAPI().usingUser(newMember).getSiteMembershipRequest(siteModel); restClient.authenticateUser(contributor).withCoreAPI().usingUser(newMember).getSiteMembershipRequest(siteModel);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.CORE }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.CORE })
@@ -8,7 +8,6 @@ import org.alfresco.utility.data.DataUser;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.exception.DataPreparationException; import org.alfresco.utility.exception.DataPreparationException;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug; import org.alfresco.utility.report.Bug;
@@ -108,12 +107,13 @@ public class GetSiteMembershipRequestSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to retrieve site membership request") @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to retrieve site membership request")
@Bug(id = "MNT-16557")
public void unauthenticatedUserIsNotAbleToRetrieveSiteMembershipRequest() throws JsonToModelConversionException, Exception public void unauthenticatedUserIsNotAbleToRetrieveSiteMembershipRequest() throws JsonToModelConversionException, Exception
{ {
UserModel newMember = dataUser.createRandomTestUser(); UserModel newMember = dataUser.createRandomTestUser();
restClient.authenticateUser(new UserModel("random user", "random password")).withCoreAPI().usingUser(newMember).addSiteMembershipRequest(siteModel); restClient.authenticateUser(new UserModel("random user", "random password")).withCoreAPI().usingUser(newMember).addSiteMembershipRequest(siteModel);
restClient.withCoreAPI().usingUser(newMember).getSiteMembershipRequest(siteModel); restClient.withCoreAPI().usingUser(newMember).getSiteMembershipRequest(siteModel);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -6,9 +6,9 @@ import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.exception.DataPreparationException; import org.alfresco.utility.exception.DataPreparationException;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -79,10 +79,11 @@ public class GetSiteMembershipSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to retrieve site membership information of another user") @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to retrieve site membership information of another user")
@Bug(id="MNT-16904")
public void unauthenticatedUserCannotRetrieveSiteMembershipInformation() throws JsonToModelConversionException, Exception public void unauthenticatedUserCannotRetrieveSiteMembershipInformation() throws JsonToModelConversionException, Exception
{ {
restClient.authenticateUser(new UserModel("random user", "random password")).withCoreAPI() restClient.authenticateUser(new UserModel("random user", "random password")).withCoreAPI()
.usingUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager)).getSiteMembership(siteModel); .usingUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager)).getSiteMembership(siteModel);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -6,9 +6,9 @@ import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.exception.DataPreparationException; import org.alfresco.utility.exception.DataPreparationException;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -77,11 +77,12 @@ public class GetSitesMembershipInformationSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify that unauthenticated user is not able to retrieve sites membership information") @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify that unauthenticated user is not able to retrieve sites membership information")
@Bug(id="MNT-16904")
public void unauthenticatedUserCannotRetrieveSitesMembershipInformation() throws JsonToModelConversionException, Exception public void unauthenticatedUserCannotRetrieveSitesMembershipInformation() throws JsonToModelConversionException, Exception
{ {
UserModel inexistentUser = new UserModel("inexistent user", "wrong password"); UserModel inexistentUser = new UserModel("inexistent user", "wrong password");
restClient.authenticateUser(inexistentUser).withCoreAPI().usingUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager)) restClient.authenticateUser(inexistentUser).withCoreAPI().usingUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager))
.getSitesMembershipInformation(); .getSitesMembershipInformation();
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -5,9 +5,9 @@ import org.alfresco.rest.model.RestErrorModel;
import org.alfresco.rest.model.RestSiteMembershipRequestModel; import org.alfresco.rest.model.RestSiteMembershipRequestModel;
import org.alfresco.utility.exception.DataPreparationException; import org.alfresco.utility.exception.DataPreparationException;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -32,13 +32,14 @@ public class UpdateSiteMembershipRequestCoreTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.CORE }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.CORE })
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION, description = "Verify unauthorized user is not able to update user site membership request") @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION, description = "Verify unauthorized user is not able to update user site membership request")
@Bug(id="MNT-16904")
public void unauthorizedUserIsNotAbleToUpdateSiteMembershipRequest() throws Exception public void unauthorizedUserIsNotAbleToUpdateSiteMembershipRequest() throws Exception
{ {
UserModel newMember = dataUser.createRandomTestUser(); UserModel newMember = dataUser.createRandomTestUser();
restClient.authenticateUser(newMember).withCoreAPI().usingAuthUser().addSiteMembershipRequest(siteModel); restClient.authenticateUser(newMember).withCoreAPI().usingAuthUser().addSiteMembershipRequest(siteModel);
newMember.setPassword("fakePass"); newMember.setPassword("fakePass");
restClient.withCoreAPI().usingUser(newMember).updateSiteMembershipRequest(siteModel, updatedMessage); restClient.withCoreAPI().usingUser(newMember).updateSiteMembershipRequest(siteModel, updatedMessage);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.CORE }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.CORE })
@@ -2,7 +2,6 @@ package org.alfresco.rest.ratings;
import org.alfresco.dataprep.CMISUtil.DocumentType; import org.alfresco.dataprep.CMISUtil.DocumentType;
import org.alfresco.rest.RestTest; import org.alfresco.rest.RestTest;
import org.alfresco.rest.model.RestErrorModel;
import org.alfresco.rest.model.RestRatingModel; import org.alfresco.rest.model.RestRatingModel;
import org.alfresco.utility.constants.UserRole; import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
@@ -10,9 +9,9 @@ import org.alfresco.utility.exception.DataPreparationException;
import org.alfresco.utility.model.FileModel; import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.FolderModel; import org.alfresco.utility.model.FolderModel;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
@@ -20,7 +19,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@Test(groups="DEV")
public class AddRatingSanityTests extends RestTest public class AddRatingSanityTests extends RestTest
{ {
private UserModel userModel; private UserModel userModel;
@@ -116,14 +115,15 @@ public class AddRatingSanityTests extends RestTest
@TestRail(section = { TestGroup.REST_API, @TestRail(section = { TestGroup.REST_API,
TestGroup.RATINGS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to post like rating to a document") TestGroup.RATINGS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to post like rating to a document")
@Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.SANITY })
@Bug(id="MNT-16904")
public void unauthenticatedUserIsNotAbleToLikeDocument() throws Exception public void unauthenticatedUserIsNotAbleToLikeDocument() throws Exception
{ {
FolderModel folderModel = dataContent.usingUser(userModel).usingSite(siteModel).createFolder(); FolderModel folderModel = dataContent.usingUser(userModel).usingSite(siteModel).createFolder();
FileModel document = dataContent.usingUser(userModel).usingResource(folderModel).createContent(DocumentType.TEXT_PLAIN); FileModel document = dataContent.usingUser(userModel).usingResource(folderModel).createContent(DocumentType.TEXT_PLAIN);
restClient.authenticateUser(new UserModel("random user", "random password")).withCoreAPI().usingResource(document).likeDocument(); restClient.authenticateUser(new UserModel("random user", "random password")).withCoreAPI().usingResource(document).likeDocument();
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(RestErrorModel.AUTHENTICATION_FAILED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
@TestRail(section = { TestGroup.REST_API, @TestRail(section = { TestGroup.REST_API,
@@ -198,13 +198,14 @@ public class AddRatingSanityTests extends RestTest
@TestRail(section = { TestGroup.REST_API, @TestRail(section = { TestGroup.REST_API,
TestGroup.RATINGS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to post stars rating to a document") TestGroup.RATINGS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to post stars rating to a document")
@Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.SANITY })
@Bug(id="MNT-16904")
public void unauthenticatedUserIsNotAbleToRateStarsToDocument() throws Exception public void unauthenticatedUserIsNotAbleToRateStarsToDocument() throws Exception
{ {
FolderModel folderModel = dataContent.usingUser(userModel).usingSite(siteModel).createFolder(); FolderModel folderModel = dataContent.usingUser(userModel).usingSite(siteModel).createFolder();
FileModel document = dataContent.usingUser(userModel).usingResource(folderModel).createContent(DocumentType.TEXT_PLAIN); FileModel document = dataContent.usingUser(userModel).usingResource(folderModel).createContent(DocumentType.TEXT_PLAIN);
restClient.authenticateUser(new UserModel("random user", "random password")).withCoreAPI().usingResource(document).rateStarsToDocument(5); restClient.authenticateUser(new UserModel("random user", "random password")).withCoreAPI().usingResource(document).rateStarsToDocument(5);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -9,9 +9,9 @@ import org.alfresco.utility.exception.DataPreparationException;
import org.alfresco.utility.model.FileModel; import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.FolderModel; import org.alfresco.utility.model.FolderModel;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -161,6 +161,7 @@ public class DeleteRatingSanityTests extends RestTest
@TestRail(section = { TestGroup.REST_API, @TestRail(section = { TestGroup.REST_API,
TestGroup.RATINGS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to remove its own rating of a document") TestGroup.RATINGS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to remove its own rating of a document")
@Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.SANITY })
@Bug(id="MNT-16904")
public void unauthenticatedUserIsNotAbleToDeleteRatings() throws Exception public void unauthenticatedUserIsNotAbleToDeleteRatings() throws Exception
{ {
FolderModel folderModel = dataContent.usingUser(adminUser).usingSite(siteModel).createFolder(); FolderModel folderModel = dataContent.usingUser(adminUser).usingSite(siteModel).createFolder();
@@ -176,14 +177,15 @@ public class DeleteRatingSanityTests extends RestTest
restClient.authenticateUser(new UserModel("random user", "random password")); restClient.authenticateUser(new UserModel("random user", "random password"));
restClient.withCoreAPI().usingResource(document).deleteLikeRating(); restClient.withCoreAPI().usingResource(document).deleteLikeRating();
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
restClient.withCoreAPI().usingResource(document).deleteFiveStarRating(); restClient.withCoreAPI().usingResource(document).deleteFiveStarRating();
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
@TestRail(section = { TestGroup.REST_API,TestGroup.RATINGS }, executionType = ExecutionType.SANITY, description = "Verify one user is not able to remove rating added by another user") @TestRail(section = { TestGroup.REST_API,TestGroup.RATINGS }, executionType = ExecutionType.SANITY, description = "Verify one user is not able to remove rating added by another user")
@Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.SANITY })
@Bug(id = "ACE-5459")
public void oneUserIsNotAbleToDeleteRatingsOfAnotherUser() throws Exception public void oneUserIsNotAbleToDeleteRatingsOfAnotherUser() throws Exception
{ {
FolderModel folderModel = dataContent.usingUser(adminUser).usingSite(siteModel).createFolder(); FolderModel folderModel = dataContent.usingUser(adminUser).usingSite(siteModel).createFolder();
@@ -199,9 +201,9 @@ public class DeleteRatingSanityTests extends RestTest
restClient.authenticateUser(userB); restClient.authenticateUser(userB);
restClient.authenticateUser(userB).withCoreAPI().usingResource(document).deleteLikeRating(); restClient.authenticateUser(userB).withCoreAPI().usingResource(document).deleteLikeRating();
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
restClient.withCoreAPI().usingResource(document).deleteFiveStarRating(); restClient.withCoreAPI().usingResource(document).deleteFiveStarRating();
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -4,9 +4,9 @@ import org.alfresco.rest.RestTest;
import org.alfresco.utility.constants.UserRole; import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -104,12 +104,13 @@ public class AddSiteMemberSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, @TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
description = "Verify that unauthenticated user is not able to add site member") description = "Verify that unauthenticated user is not able to add site member")
@Bug(id="MNT-16904")
public void unauthenticatedUserIsNotAuthorizedToAddSiteMmeber() throws Exception{ public void unauthenticatedUserIsNotAuthorizedToAddSiteMmeber() throws Exception{
UserModel testUser = dataUser.createRandomTestUser("testUser"); UserModel testUser = dataUser.createRandomTestUser("testUser");
testUser.setUserRole(UserRole.SiteConsumer); testUser.setUserRole(UserRole.SiteConsumer);
UserModel inexistentUser = new UserModel("inexistent user", "inexistent password"); UserModel inexistentUser = new UserModel("inexistent user", "inexistent password");
restClient.authenticateUser(inexistentUser) restClient.authenticateUser(inexistentUser)
.withCoreAPI().usingSite(siteModel).addPerson(testUser); .withCoreAPI().usingSite(siteModel).addPerson(testUser);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -5,9 +5,9 @@ import org.alfresco.rest.model.RestSiteContainerModel;
import org.alfresco.utility.constants.UserRole; import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -101,7 +101,8 @@ public class GetSiteContainerSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, @TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
description = "Failed authentication get site container call returns status code 401") description = "Failed authentication get site container call returns status code 401")
@Bug(id="MNT-16904")
public void unauthenticatedUserIsNotAuthorizedToRetrieveSiteContainer() throws Exception public void unauthenticatedUserIsNotAuthorizedToRetrieveSiteContainer() throws Exception
{ {
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager)); restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
@@ -111,6 +112,6 @@ public class GetSiteContainerSanityTests extends RestTest
dataUser.addUserToSite(userModel, siteModel, UserRole.SiteManager); dataUser.addUserToSite(userModel, siteModel, UserRole.SiteManager);
restClient.authenticateUser(userModel) restClient.authenticateUser(userModel)
.withCoreAPI().usingSite(siteModel).getSiteContainer(siteContainerModel.onModel()); .withCoreAPI().usingSite(siteModel).getSiteContainer(siteContainerModel.onModel());
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -5,9 +5,9 @@ import org.alfresco.rest.exception.JsonToModelConversionException;
import org.alfresco.utility.constants.UserRole; import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -100,6 +100,7 @@ public class GetSiteContainersSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, @TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
description = "Failed authentication get site containers call returns status code 401 with Manager role") description = "Failed authentication get site containers call returns status code 401 with Manager role")
@Bug(id="MNT-16904")
public void unauthenticatedUserIsNotAuthorizedToRetrieveSiteContainers() throws JsonToModelConversionException, Exception public void unauthenticatedUserIsNotAuthorizedToRetrieveSiteContainers() throws JsonToModelConversionException, Exception
{ {
userModel = dataUser.createRandomTestUser(); userModel = dataUser.createRandomTestUser();
@@ -107,6 +108,6 @@ public class GetSiteContainersSanityTests extends RestTest
dataUser.addUserToSite(userModel, siteModel, UserRole.SiteManager); dataUser.addUserToSite(userModel, siteModel, UserRole.SiteManager);
restClient.authenticateUser(userModel) restClient.authenticateUser(userModel)
.withCoreAPI().usingSite(siteModel).getSiteContainers(); .withCoreAPI().usingSite(siteModel).getSiteContainers();
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -6,9 +6,9 @@ import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.exception.DataPreparationException; import org.alfresco.utility.exception.DataPreparationException;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -99,11 +99,12 @@ public class GetSiteMemberSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, @TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
description = "Failed authentication get site member call returns status code 401") description = "Failed authentication get site member call returns status code 401")
@Bug(id="MNT-16904")
public void unauthenticatedUserIsNotAuthorizedToRetrieveSiteMember() throws JsonToModelConversionException, Exception public void unauthenticatedUserIsNotAuthorizedToRetrieveSiteMember() throws JsonToModelConversionException, Exception
{ {
UserModel inexistentUser = new UserModel("inexistent user", "inexistent password"); UserModel inexistentUser = new UserModel("inexistent user", "inexistent password");
restClient.authenticateUser(inexistentUser); restClient.authenticateUser(inexistentUser);
restClient.withCoreAPI().usingSite(siteModel).getSiteMember(userModel); restClient.withCoreAPI().usingSite(siteModel).getSiteMember(userModel);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -6,9 +6,9 @@ import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.exception.DataPreparationException; import org.alfresco.utility.exception.DataPreparationException;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -96,6 +96,7 @@ public class GetSiteMembersSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, @TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
description = "Failed authentication get site members call returns status code 401") description = "Failed authentication get site members call returns status code 401")
@Bug(id="MNT-16904")
public void unauthenticatedUserIsNotAuthorizedToRetrieveSiteMembers() throws JsonToModelConversionException, Exception public void unauthenticatedUserIsNotAuthorizedToRetrieveSiteMembers() throws JsonToModelConversionException, Exception
{ {
userModel = dataUser.createRandomTestUser(); userModel = dataUser.createRandomTestUser();
@@ -103,6 +104,6 @@ public class GetSiteMembersSanityTests extends RestTest
dataUser.addUserToSite(userModel, siteModel, UserRole.SiteManager); dataUser.addUserToSite(userModel, siteModel, UserRole.SiteManager);
restClient.authenticateUser(userModel) restClient.authenticateUser(userModel)
.withCoreAPI().usingSite(siteModel).getSiteMembers(); .withCoreAPI().usingSite(siteModel).getSiteMembers();
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -6,9 +6,9 @@ import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.exception.DataPreparationException; import org.alfresco.utility.exception.DataPreparationException;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -104,6 +104,7 @@ public class GetSiteSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, @TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
description = "Failed authentication get site call returns status code 401") description = "Failed authentication get site call returns status code 401")
@Bug(id="MNT-16904")
public void unauthenticatedUserIsNotAuthorizedToRetrieveSite() throws JsonToModelConversionException, Exception public void unauthenticatedUserIsNotAuthorizedToRetrieveSite() throws JsonToModelConversionException, Exception
{ {
userModel = dataUser.createRandomTestUser(); userModel = dataUser.createRandomTestUser();
@@ -112,6 +113,6 @@ public class GetSiteSanityTests extends RestTest
restClient.authenticateUser(userModel).withParams("maxItems=10000") restClient.authenticateUser(userModel).withParams("maxItems=10000")
.withCoreAPI() .withCoreAPI()
.getSites(); .getSites();
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -5,9 +5,9 @@ import org.alfresco.rest.exception.JsonToModelConversionException;
import org.alfresco.utility.constants.UserRole; import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -101,6 +101,7 @@ public class GetSitesSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, @TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
description = "Failed authentication get sites call returns status code 401") description = "Failed authentication get sites call returns status code 401")
@Bug(id="MNT-16904")
public void unauthenticatedUserIsNotAuthorizedToRetrieveSites() throws JsonToModelConversionException, Exception public void unauthenticatedUserIsNotAuthorizedToRetrieveSites() throws JsonToModelConversionException, Exception
{ {
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager)); restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
@@ -109,6 +110,6 @@ public class GetSitesSanityTests extends RestTest
dataUser.addUserToSite(userModel, siteModel, UserRole.SiteManager); dataUser.addUserToSite(userModel, siteModel, UserRole.SiteManager);
restClient.authenticateUser(userModel).withParams("maxItems=1000") restClient.authenticateUser(userModel).withParams("maxItems=1000")
.withCoreAPI().getSites(); .withCoreAPI().getSites();
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -5,7 +5,6 @@ import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.exception.DataPreparationException; import org.alfresco.utility.exception.DataPreparationException;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug; import org.alfresco.utility.report.Bug;
@@ -105,11 +104,12 @@ public class RemoveSiteMemberSanityTests extends RestTest
@Test(groups = {TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY}) @Test(groups = {TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY})
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, @TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
description = "Verify that unauthenticated user is not able to delete site member") description = "Verify that unauthenticated user is not able to delete site member")
@Bug(id="MNT-16904")
public void unauthenticatedUserIsNotAuthorizedToDeleteSiteMember() throws Exception{ public void unauthenticatedUserIsNotAuthorizedToDeleteSiteMember() throws Exception{
UserModel inexistentUser = new UserModel("inexistent user", "inexistent password"); UserModel inexistentUser = new UserModel("inexistent user", "inexistent password");
restClient.authenticateUser(inexistentUser) restClient.authenticateUser(inexistentUser)
.withCoreAPI().usingSite(siteModel).deleteSiteMember(testUserModel); .withCoreAPI().usingSite(siteModel).deleteSiteMember(testUserModel);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -4,7 +4,6 @@ import org.alfresco.rest.RestTest;
import org.alfresco.utility.constants.UserRole; import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles; import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug; import org.alfresco.utility.report.Bug;
@@ -103,11 +102,12 @@ public class UpdateSiteMemberSanityTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, @TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
description = "Verify that unauthenticated user is not able to update site member") description = "Verify that unauthenticated user is not able to update site member")
@Bug(id="MNT-16904")
public void unauthenticatedUserIsNotAuthorizedToUpdateSiteMmeber() throws Exception{ public void unauthenticatedUserIsNotAuthorizedToUpdateSiteMmeber() throws Exception{
UserModel inexistentUser = new UserModel("inexistent user", "inexistent password"); UserModel inexistentUser = new UserModel("inexistent user", "inexistent password");
restClient.authenticateUser(inexistentUser); restClient.authenticateUser(inexistentUser);
testUserModel.setUserRole(UserRole.SiteCollaborator); testUserModel.setUserRole(UserRole.SiteCollaborator);
restClient.withCoreAPI().usingSite(siteModel).updateSiteMember(testUserModel); restClient.withCoreAPI().usingSite(siteModel).updateSiteMember(testUserModel);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -10,9 +10,9 @@ import org.alfresco.utility.data.DataUser;
import org.alfresco.utility.data.RandomData; import org.alfresco.utility.data.RandomData;
import org.alfresco.utility.model.FileModel; import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -121,12 +121,13 @@ public class AddTagSanityTests extends RestTest
@TestRail(section = { TestGroup.REST_API, @TestRail(section = { TestGroup.REST_API,
TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails") TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails")
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
@Bug(id="MNT-16904")
public void userIsNotAbleToAddTagIfAuthenticationFails() throws JsonToModelConversionException, Exception public void userIsNotAbleToAddTagIfAuthenticationFails() throws JsonToModelConversionException, Exception
{ {
UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager); UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager);
siteManager.setPassword("wrongPassword"); siteManager.setPassword("wrongPassword");
restClient.authenticateUser(siteManager); restClient.authenticateUser(siteManager);
restClient.withCoreAPI().usingResource(document).addTag("tagUnauthorized"); restClient.withCoreAPI().usingResource(document).addTag("tagUnauthorized");
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -10,9 +10,9 @@ import org.alfresco.utility.data.DataUser;
import org.alfresco.utility.data.RandomData; import org.alfresco.utility.data.RandomData;
import org.alfresco.utility.model.FileModel; import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -120,11 +120,12 @@ public class AddTagsSanityTests extends RestTest
@TestRail(section = { TestGroup.REST_API,TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails") @TestRail(section = { TestGroup.REST_API,TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails")
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
@Bug(id="MNT-16904")
public void userIsNotAbleToAddTagsIfAuthenticationFails() throws JsonToModelConversionException, Exception public void userIsNotAbleToAddTagsIfAuthenticationFails() throws JsonToModelConversionException, Exception
{ {
UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager); UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager);
siteManager.setPassword("wrongPassword"); siteManager.setPassword("wrongPassword");
restClient.authenticateUser(siteManager).withCoreAPI().usingResource(document).addTags(tag1, tag2); restClient.authenticateUser(siteManager).withCoreAPI().usingResource(document).addTags(tag1, tag2);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -10,9 +10,9 @@ import org.alfresco.utility.data.DataUser;
import org.alfresco.utility.data.RandomData; import org.alfresco.utility.data.RandomData;
import org.alfresco.utility.model.FileModel; import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -120,6 +120,7 @@ public class DeleteTagSanityTests extends RestTest
@TestRail(section = { TestGroup.REST_API, @TestRail(section = { TestGroup.REST_API,
TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails") TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails")
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
@Bug(id="MNT-16904")
public void userIsNotAbleToDeleteTagIfAuthenticationFails() throws JsonToModelConversionException, Exception public void userIsNotAbleToDeleteTagIfAuthenticationFails() throws JsonToModelConversionException, Exception
{ {
restClient.authenticateUser(adminUserModel); restClient.authenticateUser(adminUserModel);
@@ -129,6 +130,6 @@ public class DeleteTagSanityTests extends RestTest
siteManager.setPassword("wrongPassword"); siteManager.setPassword("wrongPassword");
restClient.authenticateUser(siteManager); restClient.authenticateUser(siteManager);
restClient.withCoreAPI().usingResource(document).deleteTag(tag); restClient.withCoreAPI().usingResource(document).deleteTag(tag);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -9,9 +9,9 @@ import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.data.RandomData; import org.alfresco.utility.data.RandomData;
import org.alfresco.utility.model.FileModel; import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -119,10 +119,11 @@ public class GetNodeTagsSanityTests extends RestTest
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, @TestRail(section = { TestGroup.REST_API, TestGroup.TAGS },
executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to get node tags") executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to get node tags")
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
@Bug(id="MNT-16904")
public void unauthenticatedUserIsNotAbleToRetrieveNodeTags() throws JsonToModelConversionException, Exception public void unauthenticatedUserIsNotAbleToRetrieveNodeTags() throws JsonToModelConversionException, Exception
{ {
restClient.authenticateUser(new UserModel("random user", "random password")); restClient.authenticateUser(new UserModel("random user", "random password"));
restClient.withCoreAPI().usingResource(document).getNodeTags(); restClient.withCoreAPI().usingResource(document).getNodeTags();
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -9,9 +9,9 @@ import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.data.RandomData; import org.alfresco.utility.data.RandomData;
import org.alfresco.utility.model.FileModel; import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -108,6 +108,7 @@ public class GetTagSanityTests extends RestTest
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify Manager user gets status code 401 if authentication call fails") @TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify Manager user gets status code 401 if authentication call fails")
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
@Bug(id="MNT-16904")
public void managerIsNotAbleToGetTagIfAuthenticationFails() throws JsonToModelConversionException, Exception public void managerIsNotAbleToGetTagIfAuthenticationFails() throws JsonToModelConversionException, Exception
{ {
String tagValue = RandomData.getRandomName("tag"); String tagValue = RandomData.getRandomName("tag");
@@ -119,7 +120,7 @@ public class GetTagSanityTests extends RestTest
managerUser.setPassword("wrongPassword"); managerUser.setPassword("wrongPassword");
restClient.authenticateUser(managerUser); restClient.authenticateUser(managerUser);
restClient.withCoreAPI().getTag(tag); restClient.withCoreAPI().getTag(tag);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -10,9 +10,9 @@ import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.data.RandomData; import org.alfresco.utility.data.RandomData;
import org.alfresco.utility.model.FileModel; import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail; import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -109,6 +109,7 @@ public class GetTagsSanityTests extends RestTest
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Failed authentication get tags call returns status code 401 with Manager role") @TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Failed authentication get tags call returns status code 401 with Manager role")
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
@Bug(id="MNT-16904")
public void failedAuthenticationReturnsUnauthorizedStatus() throws JsonToModelConversionException, Exception public void failedAuthenticationReturnsUnauthorizedStatus() throws JsonToModelConversionException, Exception
{ {
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager)); restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
@@ -117,6 +118,6 @@ public class GetTagsSanityTests extends RestTest
dataUser.addUserToSite(userModel, siteModel, UserRole.SiteManager); dataUser.addUserToSite(userModel, siteModel, UserRole.SiteManager);
restClient.authenticateUser(userModel); restClient.authenticateUser(userModel);
restClient.withCoreAPI().getTags(); restClient.withCoreAPI().getTags();
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }
@@ -10,7 +10,6 @@ import org.alfresco.utility.data.DataUser;
import org.alfresco.utility.data.RandomData; import org.alfresco.utility.data.RandomData;
import org.alfresco.utility.model.FileModel; import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel; import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug; import org.alfresco.utility.report.Bug;
@@ -105,12 +104,13 @@ public class UpdateTagSanityTests extends RestTest
@TestRail(section = { TestGroup.REST_API, @TestRail(section = { TestGroup.REST_API,
TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails") TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails")
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
@Bug(id="MNT-16904")
public void userIsNotAbleToUpdateTagIfAuthenticationFails() throws JsonToModelConversionException, Exception public void userIsNotAbleToUpdateTagIfAuthenticationFails() throws JsonToModelConversionException, Exception
{ {
UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager); UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager);
siteManager.setPassword("wrongPassword"); siteManager.setPassword("wrongPassword");
restClient.authenticateUser(siteManager); restClient.authenticateUser(siteManager);
restClient.withCoreAPI().usingTag(oldTag).update(randomTag); restClient.withCoreAPI().usingTag(oldTag).update(randomTag);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastStatus().hasName(StatusModel.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastExceptionContains(HttpStatus.UNAUTHORIZED.toString());
} }
} }