mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-09-17 14:21:20 +00:00
organised the packages
This commit is contained in:
56
e2e-test/java/org/alfresco/rest/demo/SamplePeopleTest.java
Normal file
56
e2e-test/java/org/alfresco/rest/demo/SamplePeopleTest.java
Normal file
@@ -0,0 +1,56 @@
|
||||
package org.alfresco.rest.demo;
|
||||
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.requests.RestPeopleApi;
|
||||
import org.alfresco.utility.data.DataUser;
|
||||
import org.alfresco.utility.exception.DataPreparationException;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
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", "people", "sanity" })
|
||||
public class SamplePeopleTest extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
RestPeopleApi peopleAPI;
|
||||
|
||||
@Autowired
|
||||
DataUser dataUser;
|
||||
|
||||
private UserModel userModel;
|
||||
private UserModel adminUser;
|
||||
|
||||
@BeforeClass
|
||||
public void setUp() throws DataPreparationException
|
||||
{
|
||||
userModel = dataUser.createUser(RandomStringUtils.randomAlphanumeric(20));
|
||||
adminUser = dataUser.getAdminUser();
|
||||
restClient.authenticateUser(adminUser);
|
||||
peopleAPI.useRestClient(restClient);
|
||||
}
|
||||
|
||||
@TestRail(section={"rest-api", "people"}, executionType= ExecutionType.SANITY,
|
||||
description = "Verify admin user gets person with Rest API and response is not empty")
|
||||
public void adminShouldRetrievePerson() throws Exception
|
||||
{
|
||||
peopleAPI.getPerson(userModel.getUsername())
|
||||
.assertResponseIsNotEmpty();
|
||||
|
||||
peopleAPI.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK.toString());
|
||||
}
|
||||
|
||||
@TestRail(section={"rest-api", "people"}, executionType= ExecutionType.SANITY,
|
||||
description = "Admin user gets own person information with Rest Api and assert that name is correct")
|
||||
public void adminShouldRetrieveItself() throws Exception
|
||||
{
|
||||
peopleAPI.getPerson(adminUser.getUsername())
|
||||
.assertPersonHasName(adminUser.getUsername());
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user