TAS-904 failed authentication call returns status code 401 with Manager role

This commit is contained in:
Cristina Jalba
2016-09-28 10:25:48 +03:00
parent 753f3989f5
commit 0bd1d1a85b
@@ -1,4 +1,4 @@
package org.alfresco.rest;
package org.alfresco.rest.comments;
import java.util.Arrays;
import java.util.HashMap;
@@ -86,5 +86,15 @@ public class PostCommentsTest extends RestTest
commentsAPI.addComment(document.getNodeRef(), "This is a new comment added by user with role: " + UserRole.SiteConsumer);
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.FORBIDDEN.toString());
}
@TestRail(section = { "rest-api",
"comments" }, executionType = ExecutionType.SANITY, description = "Verify Manager user gets status code 401 if authentication call fails")
public void managerIsNotAbleToAddCommentIfAuthenticationFails() throws JsonToModelConversionException, Exception
{
usersWithRoles.get(UserRole.SiteManager).setPassword("wrongPassword");
restClient.authenticateUser(usersWithRoles.get(UserRole.SiteManager));
commentsAPI.addComment(document.getNodeRef(), "This is a new comment added by user with role: " + UserRole.SiteManager);
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.UNAUTHORIZED.toString());
}
}