Formatting the code

This commit is contained in:
Cristina Jalba
2016-09-28 16:07:10 +03:00
parent a65db3e70b
commit c1b62b6929

View File

@@ -84,13 +84,14 @@ public class UpdateCommentsSanityTest extends RestTest
commentsAPI.updateComment(document.getNodeRef(), commentModel.getId(), commentModel.getContent()); commentsAPI.updateComment(document.getNodeRef(), commentModel.getId(), commentModel.getContent());
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.FORBIDDEN.toString()); commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.FORBIDDEN.toString());
} }
@TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY, @TestRail(section = { "rest-api",
description= "Verify Collaborator user updates comments created by admin user with Rest API and status code is 200") "comments" }, executionType = ExecutionType.SANITY, description = "Verify Collaborator user updates comments created by admin user with Rest API and status code is 200")
public void collaboratorIsAbleToUpdateComment() throws JsonToModelConversionException, Exception public void collaboratorIsAbleToUpdateComment() throws JsonToModelConversionException, Exception
{ {
restClient.authenticateUser(usersWithRoles.get(UserRole.SiteCollaborator)); restClient.authenticateUser(usersWithRoles.get(UserRole.SiteCollaborator));
RestCommentModel commentEntry = commentsAPI.updateComment(document.getNodeRef(), commentModel.getId(), "This is the updated comment with Collaborator user"); RestCommentModel commentEntry = commentsAPI.updateComment(document.getNodeRef(), commentModel.getId(),
"This is the updated comment with Collaborator user");
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.FORBIDDEN.toString()); commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.FORBIDDEN.toString());
commentEntry.assertCommentContentIs("This is the updated comment with Collaborator user"); commentEntry.assertCommentContentIs("This is the updated comment with Collaborator user");
} }
@@ -104,18 +105,16 @@ public class UpdateCommentsSanityTest extends RestTest
commentsAPI.getNodeComments(document.getNodeRef()); commentsAPI.getNodeComments(document.getNodeRef());
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.UNAUTHORIZED.toString()); commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.UNAUTHORIZED.toString());
} }
@TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY, @TestRail(section = { "rest-api", "comments" }, executionType = ExecutionType.SANITY, description = "Verify if nodeId is not set the status code is 404")
description= "Verify if nodeId is not set the status code is 404")
public void canNotUpdateCommentIfNodeIdIsNotSet() throws JsonToModelConversionException, Exception public void canNotUpdateCommentIfNodeIdIsNotSet() throws JsonToModelConversionException, Exception
{ {
restClient.authenticateUser(adminUserModel); restClient.authenticateUser(adminUserModel);
commentsAPI.updateComment("unexistingId", commentModel.getId(), commentModel.getContent()); commentsAPI.updateComment("unexistingId", commentModel.getId(), commentModel.getContent());
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.NOT_FOUND.toString()); commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.NOT_FOUND.toString());
} }
@TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY, @TestRail(section = { "rest-api", "comments" }, executionType = ExecutionType.SANITY, description = "Verify if commentId is not set the status code is 404")
description= "Verify if commentId is not set the status code is 404")
public void canNotUpdateCommentIfCommentIdIsNotSet() throws JsonToModelConversionException, Exception public void canNotUpdateCommentIfCommentIdIsNotSet() throws JsonToModelConversionException, Exception
{ {
restClient.authenticateUser(adminUserModel); restClient.authenticateUser(adminUserModel);