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

View File

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

View File

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

View File

@@ -42,8 +42,8 @@ public class DeleteSiteMemberSanityTests extends RestTest
private SiteMember siteMember; private SiteMember siteMember;
private ListUserWithRoles usersWithRoles; private ListUserWithRoles usersWithRoles;
@BeforeClass @BeforeClass(alwaysRun=true)
public void initTest() throws DataPreparationException public void dataPreparation() throws DataPreparationException
{ {
adminUser = dataUser.getAdminUser(); adminUser = dataUser.getAdminUser();
siteModel = dataSite.usingUser(adminUser).createPublicRandomSite(); 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.BeforeClass;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@Test(groups = { "rest-api", "people" }) @Test(groups = { "rest-api", "people", "sanity" })
public class GetPeopleTests extends RestTest public class GetPeopleTests extends RestTest
{ {
@Autowired @Autowired
@@ -23,7 +23,7 @@ public class GetPeopleTests extends RestTest
SiteModel siteModel; SiteModel siteModel;
UserModel searchedUser; UserModel searchedUser;
@BeforeClass @BeforeClass(alwaysRun=true)
public void dataPreparation() throws Exception public void dataPreparation() throws Exception
{ {
userModel = dataUser.createRandomTestUser(); userModel = dataUser.createRandomTestUser();
@@ -33,7 +33,6 @@ public class GetPeopleTests extends RestTest
peopleApi.useRestClient(restClient); 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") @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 public void managerUserChecksIfPersonIsPresent() throws Exception
{ {
@@ -45,7 +44,6 @@ public class GetPeopleTests extends RestTest
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK); 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") @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 public void collaboratorUserChecksIfPersonIsPresent() throws Exception
{ {
@@ -68,8 +66,7 @@ public class GetPeopleTests extends RestTest
peopleApi.getPerson(searchedUser); peopleApi.getPerson(searchedUser);
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK); 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") @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 public void consumerUserChecksIfPersonIsPresent() throws Exception
{ {
@@ -81,7 +78,6 @@ public class GetPeopleTests extends RestTest
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK); 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") @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 public void adminUserChecksIfPersonIsPresent() throws Exception
{ {
@@ -91,8 +87,7 @@ public class GetPeopleTests extends RestTest
peopleApi.getPerson(searchedUser); peopleApi.getPerson(searchedUser);
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK); 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") @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 public void managerUserChecksIfNonExistingPersonIsPresent() throws Exception
{ {

View File

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

View File

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