TAS-2608 New full test for getPerson using -me-

This commit is contained in:
Cristina Axinte
2017-01-05 10:46:26 +02:00
parent b00e453d90
commit 83b40da3cb
2 changed files with 48 additions and 1 deletions
@@ -0,0 +1,48 @@
package org.alfresco.rest.people;
import org.alfresco.rest.RestTest;
import org.alfresco.rest.model.RestPersonModel;
import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class GetPeopleFullTests extends RestTest
{
UserModel userModel;
SiteModel siteModel;
UserModel searchedUser;
UserModel adminUser;
private RestPersonModel personModel;
private String domain = "@tas-automation.org";
@BeforeClass(alwaysRun = true)
public void dataPreparation() throws Exception
{
adminUser = dataUser.getAdminUser();
userModel = dataUser.createRandomTestUser();
siteModel = dataSite.usingUser(userModel).createPublicRandomSite();
searchedUser = dataUser.createRandomTestUser();
}
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.FULL })
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION, description = "Verify user gets person using '-me-' instead of personId with Rest API and response is successful")
public void checkGetPersonIsSuccessfulForMe() throws Exception
{
UserModel managerUser = dataUser.usingAdmin().createRandomTestUser();
dataUser.usingUser(userModel).addUserToSite(managerUser, siteModel, UserRole.SiteManager);
personModel = restClient.authenticateUser(managerUser).withCoreAPI().usingMe().getPerson();
restClient.assertStatusCodeIs(HttpStatus.OK);
personModel.assertThat().field("id").is(managerUser.getUsername())
.and().field("firstName").is(managerUser.getUsername() + " FirstName")
.and().field("email").is(managerUser.getUsername() + domain)
.and().field("emailNotificationsEnabled").is("true");
}
}
@@ -69,7 +69,6 @@ public class GetPeopleSanityTests extends RestTest
restClient.assertStatusCodeIs(HttpStatus.OK);
personModel.assertThat().field("id").is(searchedUser.getUsername()).assertThat().field("firstName").is(searchedUser.getUsername() + " FirstName").and()
.field("email").is(searchedUser.getUsername() + domain).and().field("emailNotificationsEnabled").is("true");
;
}
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })