mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
fix: updateCommentsCoreTests - add @Bug, move groups to method level
This commit is contained in:
@@ -8,7 +8,12 @@ import org.alfresco.rest.model.RestCommentModelsCollection;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.utility.constants.UserRole;
|
||||
import org.alfresco.utility.data.DataUser.ListUserWithRoles;
|
||||
import org.alfresco.utility.model.*;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.FileType;
|
||||
import org.alfresco.utility.model.LinkModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
@@ -16,7 +21,6 @@ import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.CORE })
|
||||
public class UpdateCommentsCoreTests extends RestTest
|
||||
{
|
||||
private UserModel adminUserModel;
|
||||
@@ -39,6 +43,7 @@ public class UpdateCommentsCoreTests extends RestTest
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SANITY }, executionType = ExecutionType.SANITY, description = "Verify can not update comment if NodeId is neither document or folder and returns status code 405")
|
||||
@Bug(id="MNT-16904")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.CORE })
|
||||
public void canNotUpdateCommentIfNodeIdIsNeitherDocumentOrFolder() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
FileModel content = FileModel.getRandomFileModel(FileType.TEXT_PLAIN);
|
||||
@@ -57,6 +62,7 @@ public class UpdateCommentsCoreTests extends RestTest
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify Admin user is not able to update with empty comment body and status code is 400")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.CORE })
|
||||
public void adminIsNotAbleToUpdateWithEmptyCommentBody() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
@@ -69,6 +75,7 @@ public class UpdateCommentsCoreTests extends RestTest
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify updated comment by Manager is listed when calling getComments and status code is 200")
|
||||
@Bug(id="REPO-1011")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.CORE })
|
||||
public void updatedCommentByManagerIsListed() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
@@ -81,17 +88,20 @@ public class UpdateCommentsCoreTests extends RestTest
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify Collaborator user can not update comments of another user and status code is 200")
|
||||
@Bug(id="MNT-2502",description="seems it's one old issue: also logged as MNT-2502, MNT-2346")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.CORE })
|
||||
public void collaboratorIsNotAbleToUpdateCommentOfAnotherUser() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
commentModel = restClient.withCoreAPI().usingResource(document).addComment("This is a new comment added by admin");
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||
restClient.withCoreAPI().usingResource(document).updateComment(commentModel, "This is the updated comment with Collaborator user");
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator))
|
||||
.withCoreAPI().usingResource(document).updateComment(commentModel, "This is the updated comment with Collaborator user");
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError().containsSummary(RestErrorModel.PERMISSION_WAS_DENIED);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify entry content in response")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.CORE })
|
||||
public void checkEntryContentInResponse() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
|
||||
Reference in New Issue
Block a user