mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-10-01 14:41:19 +00:00
TAS-856 getComment with admin
This commit is contained in:
50
e2e-test/java/org/alfresco/rest/GetCommentsTest.java
Normal file
50
e2e-test/java/org/alfresco/rest/GetCommentsTest.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package org.alfresco.rest;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.requests.RestCommentsApi;
|
||||
import org.alfresco.utility.data.DataUser;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test(groups = { "rest-api", "comments", "sanity" })
|
||||
public class GetCommentsTest extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
RestCommentsApi commentsAPI;
|
||||
|
||||
@Autowired
|
||||
DataUser dataUser;
|
||||
|
||||
private UserModel adminUserModel;
|
||||
|
||||
private FileModel document;
|
||||
private SiteModel siteModel;
|
||||
|
||||
@BeforeClass
|
||||
public void initTest() throws Exception
|
||||
{
|
||||
adminUserModel = dataUser.getAdminUser();
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
siteModel = dataSite.usingUser(adminUserModel).createPublicRandomSite();
|
||||
commentsAPI.useRestClient(restClient);
|
||||
document = dataContent.usingSite(siteModel).usingUser(adminUserModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
commentsAPI.addComment(document.getNodeRef(), "This is a new comment");
|
||||
}
|
||||
|
||||
@TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY,
|
||||
description= "Verify Admin user gets comments with Rest API and status code is 200")
|
||||
public void adminIsAbleToRetrieveComments() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
commentsAPI.getNodeComments(document.getNodeRef());
|
||||
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString());
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user