Merge branch 'TAS-949' of gitlab.alfresco.com:tas/alfresco-tas-restapi-test

# Conflicts:
#	src/main/java/org/alfresco/rest/model/RestCommentModelsCollection.java
#	src/main/java/org/alfresco/rest/model/RestPersonModel.java
#	src/main/java/org/alfresco/rest/requests/RestCommentsApi.java
#	src/main/java/org/alfresco/rest/requests/RestSitesApi.java
#	src/test/java/org/alfresco/rest/demo/RestDemoTests.java
This commit is contained in:
Paul Brodner
2016-09-29 16:56:54 +03:00
7 changed files with 19 additions and 24 deletions

View File

@@ -36,8 +36,8 @@ public class DeleteCommentsSanityTests extends RestTest
private RestCommentModel comment;
private ListUserWithRoles usersWithRoles;
@BeforeClass
public void initTest() throws Exception
@BeforeClass(alwaysRun=true)
public void dataPreparation() throws Exception
{
adminUserModel = dataUser.getAdminUser();
restClient.authenticateUser(adminUserModel);
@@ -48,8 +48,8 @@ public class DeleteCommentsSanityTests extends RestTest
usersWithRoles = dataUser.addUsersWithRolesToSite(siteModel,UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor);
}
@BeforeMethod
public void initMethod() throws Exception
@BeforeMethod(alwaysRun=true)
public void addCommentToDocument() throws Exception
{
restClient.authenticateUser(adminUserModel);
commentsAPI.useRestClient(restClient);

View File

@@ -78,18 +78,18 @@ public class RestDemoTests extends RestTest
// add new comment
RestCommentModel commentEntry = commentsAPI.addComment(fileModel, "This is a new comment");
commentsAPI.getNodeComments(fileModel)
.assertThatResponseIsNotEmpty()
.assertThatCommentWithIdExists(commentEntry)
.assertThatCommentWithContentExists("This is a new comment");
.assertResponseIsNotEmpty()
.assertCommentWithIdExists(commentEntry);
// update comment
commentEntry = commentsAPI.updateComment(fileModel,
commentEntry,
"This is the updated comment");
commentsAPI.getNodeComments(fileModel)
.assertThatResponseIsNotEmpty()
.assertThatCommentWithIdExists(commentEntry)
.assertThatCommentWithContentExists("This is the updated comment");
.assertResponseIsNotEmpty()
.assertCommentWithIdExists(commentEntry)
.assertCommentWithContentExists("This is the updated comment");
}
/**

View File

@@ -55,7 +55,7 @@ public class SampleSitesTests extends RestTest
public void adminShouldAccessSites() throws JsonToModelConversionException, Exception
{
siteAPI.getSites()
.assertThatResponseIsNotEmpty();
.assertResponseIsNotEmpty();
}
@TestRail(section={"demo", "sample-section"}, executionType= ExecutionType.SANITY,

View File

@@ -42,8 +42,8 @@ public class DeleteSiteMemberSanityTests extends RestTest
private SiteMember siteMember;
private ListUserWithRoles usersWithRoles;
@BeforeClass
public void initTest() throws DataPreparationException
@BeforeClass(alwaysRun=true)
public void dataPreparation() throws DataPreparationException
{
adminUser = dataUser.getAdminUser();
siteModel = dataSite.usingUser(adminUser).createPublicRandomSite();

View File

@@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { "rest-api", "people" })
@Test(groups = { "rest-api", "people", "sanity" })
public class GetPeopleTests extends RestTest
{
@Autowired
@@ -23,7 +23,7 @@ public class GetPeopleTests extends RestTest
SiteModel siteModel;
UserModel searchedUser;
@BeforeClass
@BeforeClass(alwaysRun=true)
public void dataPreparation() throws Exception
{
userModel = dataUser.createRandomTestUser();
@@ -33,7 +33,6 @@ public class GetPeopleTests extends RestTest
peopleApi.useRestClient(restClient);
}
@Test(groups = "sanity")
@TestRail(section = { "rest-api", "people" }, executionType = ExecutionType.SANITY, description = "Verify manager user gets a person with Rest API and response is successful")
public void managerUserChecksIfPersonIsPresent() throws Exception
{
@@ -45,7 +44,6 @@ public class GetPeopleTests extends RestTest
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = "sanity")
@TestRail(section = { "rest-api", "people" }, executionType = ExecutionType.SANITY, description = "Verify collaborator user gets a person with Rest API and response is successful")
public void collaboratorUserChecksIfPersonIsPresent() throws Exception
{
@@ -68,8 +66,7 @@ public class GetPeopleTests extends RestTest
peopleApi.getPerson(searchedUser);
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = "sanity")
@TestRail(section = { "rest-api", "people" }, executionType = ExecutionType.SANITY, description = "Verify consumer user gets a person with Rest API and response is successful")
public void consumerUserChecksIfPersonIsPresent() throws Exception
{
@@ -81,7 +78,6 @@ public class GetPeopleTests extends RestTest
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = "sanity")
@TestRail(section = { "rest-api", "people" }, executionType = ExecutionType.SANITY, description = "Verify admin user gets a person with Rest API and response is successful")
public void adminUserChecksIfPersonIsPresent() throws Exception
{
@@ -91,8 +87,7 @@ public class GetPeopleTests extends RestTest
peopleApi.getPerson(searchedUser);
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = "sanity")
@TestRail(section = { "rest-api", "people" }, executionType = ExecutionType.SANITY, description = "Verify manager user gets a non existing person with Rest API and person is not found")
public void managerUserChecksIfNonExistingPersonIsPresent() throws Exception
{

View File

@@ -37,7 +37,7 @@ public class AddSiteMembershipRequestSanityTests extends RestTest
private UserModel adminUser;
@BeforeClass(alwaysRun=true)
public void initTest() throws DataPreparationException
public void dataPreparation() throws DataPreparationException
{
adminUser = dataUser.getAdminUser();
siteModel = dataSite.usingUser(adminUser).createPublicRandomSite();

View File

@@ -36,7 +36,7 @@ public class GetSiteContainersSanityTests extends RestTest
private ListUserWithRoles usersWithRoles;
private UserModel userModel;
@BeforeClass
@BeforeClass(alwaysRun=true)
public void dataPreparation() throws Exception
{
adminUserModel = dataUser.getAdminUser();