TAS-964 manager gets status code 401 if authentication fails

This commit is contained in:
Cristina Jalba
2016-09-29 10:28:18 +03:00
parent 135a26ca57
commit 93309b75ac

View File

@@ -102,4 +102,14 @@ public class DeleteCommentsSanityTests extends RestTest
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.FORBIDDEN.toString()); 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 managerIsNotAbleToDeleteCommentIfAuthenticationFails() throws JsonToModelConversionException, Exception
{
UserModel nonexistentModel = new UserModel("nonexistentUser", "nonexistentPassword");
restClient.authenticateUser(nonexistentModel);
commentsAPI.deleteComment(document.getNodeRef(), commentId);
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.UNAUTHORIZED.toString());
}
} }