mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
perform changes for rest api assertion
This commit is contained in:
@@ -64,8 +64,8 @@ public class UpdateCommentsSanityTests extends RestTest
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
commentsAPI.updateComment(document, commentModel, "This is the updated comment with Manager user")
|
||||
.and().assertField("content").is("This is the updated comment with Manager user")
|
||||
.and().assertField("canDelete").is(true);
|
||||
.assertThat().field("content").is("This is the updated comment with Manager user")
|
||||
.and().field("canDelete").is(true);
|
||||
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ public class UpdateCommentsSanityTests extends RestTest
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||
commentsAPI.updateComment(document, commentModel, "This is the updated comment with Collaborator user")
|
||||
.and().assertField("content").is("This is the updated comment with Collaborator user");
|
||||
.assertThat().field("content").is("This is the updated comment with Collaborator user");
|
||||
|
||||
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.FORBIDDEN);
|
||||
}
|
||||
|
||||
@@ -30,9 +30,9 @@ public class RMDemoTest extends RestTest {
|
||||
public void adminCanSeeDetailsOfARandomSiteCreated() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
sitesApi.getSite(siteModel)
|
||||
.and().assertField("id").isNotNull()
|
||||
.and().assertField("description").is(siteModel.getDescription())
|
||||
.and().assertField("title").is(siteModel.getTitle());
|
||||
.assertThat().field("id").isNotNull()
|
||||
.and().field("description").is(siteModel.getDescription())
|
||||
.and().field("title").is(siteModel.getTitle());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -46,10 +46,10 @@ public class RMDemoTest extends RestTest {
|
||||
dataSite.usingAdmin().createSite(siteModel);
|
||||
|
||||
sitesApi.getSite(siteModel)
|
||||
.and().assertField("id").isNotNull()
|
||||
.and().assertField("description").is("my description")
|
||||
.and().assertField("title").is("MyTitle")
|
||||
.and().assertField("visibility").is(Visibility.PUBLIC);
|
||||
.assertThat().field("id").isNotNull()
|
||||
.and().field("description").is("my description")
|
||||
.and().field("title").is("MyTitle")
|
||||
.and().field("visibility").is(Visibility.PUBLIC);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,7 +61,7 @@ public class RMDemoTest extends RestTest {
|
||||
public void assertingWithFieldsThatDoesNotExist() throws JsonToModelConversionException, Exception {
|
||||
siteModel = dataSite.createPublicRandomSite();
|
||||
|
||||
sitesApi.getSite(siteModel).and().assertField("fieldA").isNotNull();
|
||||
sitesApi.getSite(siteModel).assertThat().field("fieldA").isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -72,9 +72,10 @@ public class RMDemoTest extends RestTest {
|
||||
* you can use withParams(String... parameters) method before calling the http method.
|
||||
*/
|
||||
sitesApi.withParams("maxItems=2", "orderyBy=name").getSites()
|
||||
.assertPaginationExist()
|
||||
.assertPaginationField("maxItems").is("2")
|
||||
.assertPaginationField("skipCount").is("0");
|
||||
.assertThat().paginationExist()
|
||||
.and().paginationField("maxItems").is("2")
|
||||
.and().paginationField("skipCount").is("0");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -56,12 +56,12 @@ public class RestDemoTests extends RestTest
|
||||
{
|
||||
|
||||
sitesApi.getAllSites()
|
||||
.assertEntriesListContains("id", siteModel.getId())
|
||||
.entriesListContains("id", siteModel.getId())
|
||||
.getSite(siteModel)
|
||||
.and().assertField("id").isNotNull()
|
||||
.and().assertField("description").is(siteModel.getDescription())
|
||||
.and().assertField("title").is(siteModel.getTitle())
|
||||
.and().assertField("visibility").is(Visibility.PUBLIC);
|
||||
.assertThat().field("id").isNotNull()
|
||||
.assertThat().field("description").is(siteModel.getDescription())
|
||||
.assertThat().field("title").is(siteModel.getTitle())
|
||||
.assertThat().field("visibility").is(Visibility.PUBLIC);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,8 +80,8 @@ public class RestDemoTests extends RestTest
|
||||
// add new comment
|
||||
RestCommentModel commentEntry = commentsAPI.addComment(fileModel, "This is a new comment");
|
||||
commentsAPI.getNodeComments(fileModel)
|
||||
.assertEntriesListIsNotEmpty()
|
||||
.assertEntriesListContains("content", "This is a new comment");
|
||||
.entriesListIsNotEmpty()
|
||||
.entriesListContains("content", "This is a new comment");
|
||||
//.assertEntriesListIsEmpty()
|
||||
//.assertCommentWithIdExists(commentEntry);
|
||||
|
||||
@@ -111,7 +111,7 @@ public class RestDemoTests extends RestTest
|
||||
|
||||
// add user as Consumer to site
|
||||
sitesApi.addPerson(siteModel, testUser);
|
||||
sitesApi.getSiteMembers(siteModel).assertEntriesListContains("id", testUser.getUsername())
|
||||
sitesApi.getSiteMembers(siteModel).entriesListContains("id", testUser.getUsername())
|
||||
.getSiteMember(testUser.getUsername())
|
||||
.assertSiteMemberHasRole(Role.SiteConsumer);
|
||||
|
||||
@@ -119,7 +119,7 @@ public class RestDemoTests extends RestTest
|
||||
testUser.setUserRole(UserRole.SiteCollaborator);
|
||||
sitesApi.updateSiteMember(siteModel, testUser);
|
||||
sitesApi.getSiteMembers(siteModel)
|
||||
.assertEntriesListContains("id", testUser.getUsername())
|
||||
.entriesListContains("id", testUser.getUsername())
|
||||
.getSiteMember(testUser.getUsername())
|
||||
.assertSiteMemberHasRole(Role.SiteCollaborator);
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public class SampleCommentsTests extends RestTest
|
||||
RestCommentModel commentModel = commentsAPI.addComment(document, "This is a new comment");
|
||||
|
||||
commentsAPI.updateComment(document, commentModel, "This is the updated comment with Collaborator user")
|
||||
.and().assertField("content").is("This is the updated comment");
|
||||
.assertThat().field("content").is("This is the updated comment");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,7 +34,7 @@ public class SamplePeopleTests extends RestTest
|
||||
description = "Verify admin user gets person with Rest API and response is not empty")
|
||||
public void adminShouldRetrievePerson() throws Exception
|
||||
{
|
||||
peopleAPI.getPerson(userModel).and().assertField("id").isNotEmpty();
|
||||
peopleAPI.getPerson(userModel).assertThat().field("id").isNotEmpty();
|
||||
|
||||
peopleAPI.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
@@ -37,7 +37,7 @@ public class SampleSitesTests extends RestTest
|
||||
public void adminShouldGetSiteDetails() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
siteAPI.getSite(siteModel)
|
||||
.and().assertField("id").isNotNull();
|
||||
.assertThat().field("id").isNotNull();
|
||||
}
|
||||
|
||||
@TestRail(section={"demo", "sample-section"}, executionType= ExecutionType.SANITY,
|
||||
@@ -54,7 +54,7 @@ public class SampleSitesTests extends RestTest
|
||||
public void adminShouldAccessSites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
siteAPI.getSites()
|
||||
.assertEntriesListIsNotEmpty();
|
||||
.entriesListIsNotEmpty();
|
||||
}
|
||||
|
||||
@TestRail(section={"demo", "sample-section"}, executionType= ExecutionType.SANITY,
|
||||
@@ -71,7 +71,7 @@ public class SampleSitesTests extends RestTest
|
||||
public void adminShouldAccessResponsePagination() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
siteAPI.getSites()
|
||||
.assertPaginationExist();
|
||||
.paginationExist();
|
||||
}
|
||||
|
||||
@TestRail(section={"demo", "sample-section"}, executionType= ExecutionType.SANITY,
|
||||
@@ -90,7 +90,7 @@ public class SampleSitesTests extends RestTest
|
||||
public void adminShouldGetSiteFromSitesList() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
siteAPI.getAllSites()
|
||||
.assertEntriesListContains("id", siteModel.getId());
|
||||
.entriesListContains("id", siteModel.getId());
|
||||
}
|
||||
|
||||
@TestRail(section={"demo", "sample-section"}, executionType= ExecutionType.SANITY,
|
||||
@@ -98,10 +98,10 @@ public class SampleSitesTests extends RestTest
|
||||
public void adminShouldAccessSiteDetails() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
siteAPI.getSite(siteModel)
|
||||
.and().assertField("id").isNotNull()
|
||||
.and().assertField("description").is(siteModel.getDescription())
|
||||
.and().assertField("title").is(siteModel.getTitle())
|
||||
.and().assertField("visibility").is(siteModel.getVisibility());
|
||||
.assertThat().field("id").isNotNull()
|
||||
.and().field("description").is(siteModel.getDescription())
|
||||
.and().field("title").is(siteModel.getTitle())
|
||||
.and().field("visibility").is(siteModel.getVisibility());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class GetFavoriteSiteSanityTests extends RestTest
|
||||
dataSite.usingUser(managerUser).usingSite(siteModel2).addSiteToFavorites();
|
||||
|
||||
restClient.authenticateUser(managerUser);
|
||||
peopleApi.getFavoriteSite(managerUser, siteModel1).and().assertField("id").isNotNull();
|
||||
peopleApi.getFavoriteSite(managerUser, siteModel1).assertThat().field("id").isNotNull();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class GetFavoriteSiteSanityTests extends RestTest
|
||||
dataSite.usingUser(collaboratorUser).usingSite(siteModel2).addSiteToFavorites();
|
||||
|
||||
restClient.authenticateUser(collaboratorUser);
|
||||
peopleApi.getFavoriteSite(collaboratorUser, siteModel1).and().assertField("id").isNotNull();
|
||||
peopleApi.getFavoriteSite(collaboratorUser, siteModel1).assertThat().field("id").isNotNull();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class GetFavoriteSiteSanityTests extends RestTest
|
||||
dataSite.usingUser(contributorUser).usingSite(siteModel2).addSiteToFavorites();
|
||||
|
||||
restClient.authenticateUser(contributorUser);
|
||||
peopleApi.getFavoriteSite(contributorUser, siteModel1).and().assertField("id").isNotNull();
|
||||
peopleApi.getFavoriteSite(contributorUser, siteModel1).assertThat().field("id").isNotNull();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class GetFavoriteSiteSanityTests extends RestTest
|
||||
dataSite.usingUser(consumerUser).usingSite(siteModel2).addSiteToFavorites();
|
||||
|
||||
restClient.authenticateUser(consumerUser);
|
||||
peopleApi.getFavoriteSite(consumerUser, siteModel1).and().assertField("id").isNotNull();
|
||||
peopleApi.getFavoriteSite(consumerUser, siteModel1).assertThat().field("id").isNotNull();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public class GetFavoriteSiteSanityTests extends RestTest
|
||||
dataSite.usingUser(anyUser).usingSite(siteModel2).addSiteToFavorites();
|
||||
|
||||
restClient.authenticateUser(adminUset);
|
||||
peopleApi.getFavoriteSite(anyUser, siteModel1).and().assertField("id").isNotNull();
|
||||
peopleApi.getFavoriteSite(anyUser, siteModel1).assertThat().field("id").isNotNull();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ public class GetFavoriteSitesSanityTests extends RestTest
|
||||
dataSite.usingUser(anotherUser).usingSite(siteModel).addSiteToFavorites();
|
||||
|
||||
restClient.authenticateUser(adminUser);
|
||||
peopleApi.getFavoriteSites(anotherUser).assertEntriesListIsNotEmpty();
|
||||
peopleApi.getFavoriteSites(anotherUser).entriesListIsNotEmpty();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public class GetPeopleActivitiesSanityTests extends RestTest
|
||||
dataContent.usingUser(managerUser).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
|
||||
restClient.authenticateUser(managerUser);
|
||||
peopleApi.getPersonActivities(managerUser).assertEntriesListIsNotEmpty();
|
||||
peopleApi.getPersonActivities(managerUser).entriesListIsNotEmpty();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class GetPeopleActivitiesSanityTests extends RestTest
|
||||
dataContent.usingUser(collaboratorUser).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
|
||||
restClient.authenticateUser(collaboratorUser);
|
||||
peopleApi.getPersonActivities(collaboratorUser).assertEntriesListIsNotEmpty();
|
||||
peopleApi.getPersonActivities(collaboratorUser).entriesListIsNotEmpty();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class GetPeopleActivitiesSanityTests extends RestTest
|
||||
dataContent.usingUser(contributorUser).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
|
||||
restClient.authenticateUser(contributorUser);
|
||||
peopleApi.getPersonActivities(contributorUser).assertEntriesListIsNotEmpty();
|
||||
peopleApi.getPersonActivities(contributorUser).entriesListIsNotEmpty();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public class GetPeopleActivitiesSanityTests extends RestTest
|
||||
dataUser.usingUser(userModel).addUserToSite(consumerUser, siteModel, UserRole.SiteConsumer);
|
||||
|
||||
restClient.authenticateUser(consumerUser);
|
||||
peopleApi.getPersonActivities(consumerUser).assertEntriesListIsNotEmpty();
|
||||
peopleApi.getPersonActivities(consumerUser).entriesListIsNotEmpty();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class GetPeopleActivitiesSanityTests extends RestTest
|
||||
public void adminUserShouldGetPeopleActivitiesList() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(dataUser.getAdminUser());
|
||||
peopleApi.getPersonActivities(userModel).assertEntriesListIsNotEmpty();
|
||||
peopleApi.getPersonActivities(userModel).entriesListIsNotEmpty();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public class GetPeoplePreferencesSanityTests extends RestTest
|
||||
dataSite.usingUser(managerUser).usingSite(siteModel).addSiteToFavorites();
|
||||
|
||||
restClient.authenticateUser(managerUser);
|
||||
peopleApi.getPersonPreferences(managerUser).assertEntriesListIsNotEmpty();
|
||||
peopleApi.getPersonPreferences(managerUser).entriesListIsNotEmpty();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class GetPeoplePreferencesSanityTests extends RestTest
|
||||
dataSite.usingUser(collaboratorUser).usingSite(siteModel).addSiteToFavorites();
|
||||
|
||||
restClient.authenticateUser(collaboratorUser);
|
||||
peopleApi.getPersonPreferences(collaboratorUser).assertEntriesListIsNotEmpty();
|
||||
peopleApi.getPersonPreferences(collaboratorUser).entriesListIsNotEmpty();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public class GetPeoplePreferencesSanityTests extends RestTest
|
||||
dataSite.usingUser(contributorUser).usingSite(siteModel).addSiteToFavorites();
|
||||
|
||||
restClient.authenticateUser(contributorUser);
|
||||
peopleApi.getPersonPreferences(contributorUser).assertEntriesListIsNotEmpty();
|
||||
peopleApi.getPersonPreferences(contributorUser).entriesListIsNotEmpty();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class GetPeoplePreferencesSanityTests extends RestTest
|
||||
dataSite.usingUser(consumerUser).usingSite(siteModel).addSiteToFavorites();
|
||||
|
||||
restClient.authenticateUser(consumerUser);
|
||||
peopleApi.getPersonPreferences(consumerUser).assertEntriesListIsNotEmpty();
|
||||
peopleApi.getPersonPreferences(consumerUser).entriesListIsNotEmpty();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ public class GetPeoplePreferencesSanityTests extends RestTest
|
||||
UserModel adminUser = dataUser.getAdminUser();
|
||||
|
||||
restClient.authenticateUser(adminUser);
|
||||
peopleApi.getPersonPreferences(managerUser).assertEntriesListIsNotEmpty();
|
||||
peopleApi.getPersonPreferences(managerUser).entriesListIsNotEmpty();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public class GetPeopleSanityTests extends RestTest
|
||||
dataUser.usingUser(userModel).addUserToSite(managerUser, siteModel, UserRole.SiteManager);
|
||||
|
||||
restClient.authenticateUser(managerUser);
|
||||
peopleApi.getPerson(searchedUser).and().assertField("id").is(searchedUser.getUsername());;
|
||||
peopleApi.getPerson(searchedUser).assertThat().field("id").is(searchedUser.getUsername());;
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ public class GetSiteMembershipRequestsSanityTests extends RestTest
|
||||
dataUser.usingUser(userModel).addUserToSite(managerUser, siteModel, UserRole.SiteManager);
|
||||
|
||||
restClient.authenticateUser(managerUser);
|
||||
peopleApi.getSiteMembershipRequests(newMember).assertEntriesListIsNotEmpty();
|
||||
peopleApi.getSiteMembershipRequests(newMember).entriesListIsNotEmpty();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public class GetSiteMembershipRequestsSanityTests extends RestTest
|
||||
UserModel adminUser = dataUser.getAdminUser();
|
||||
|
||||
restClient.authenticateUser(adminUser);
|
||||
peopleApi.getSiteMembershipRequests(newMember).assertEntriesListIsNotEmpty();
|
||||
peopleApi.getSiteMembershipRequests(newMember).entriesListIsNotEmpty();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ public class GetSiteMembershipRequestsSanityTests extends RestTest
|
||||
public void oneUserGetsItsOwnSiteMembershipRequestsWithSuccess() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(newMember);
|
||||
peopleApi.getSiteMembershipRequests(newMember).assertEntriesListIsNotEmpty();
|
||||
peopleApi.getSiteMembershipRequests(newMember).entriesListIsNotEmpty();
|
||||
peopleApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,15 +60,15 @@ public class GetRatingSanityTests extends RestTest
|
||||
ratingsApi.rateStarsToDocument(document, 5);
|
||||
|
||||
ratingsApi.getLikeRating(document)
|
||||
.and().assertField("id").is("likes")
|
||||
.and().assertField("myRating").is("true");
|
||||
.assertThat().field("id").is("likes")
|
||||
.and().field("myRating").is("true");
|
||||
|
||||
ratingsApi.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
ratingsApi.getFiveStarRating(document)
|
||||
.and().assertField("id").is("fiveStar")
|
||||
.and().assertField("myRating").is("5");
|
||||
.assertThat().field("id").is("fiveStar")
|
||||
.and().field("myRating").is("5");
|
||||
ratingsApi.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
@@ -83,14 +83,14 @@ public class GetRatingSanityTests extends RestTest
|
||||
ratingsApi.rateStarsToDocument(document, 5);
|
||||
|
||||
ratingsApi.getLikeRating(document)
|
||||
.and().assertField("id").is("likes")
|
||||
.and().assertField("myRating").is("true");
|
||||
.assertThat().field("id").is("likes")
|
||||
.and().field("myRating").is("true");
|
||||
ratingsApi.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
ratingsApi.getFiveStarRating(document)
|
||||
.and().assertField("id").is("fiveStar")
|
||||
.and().assertField("myRating").is("5");
|
||||
.assertThat().field("id").is("fiveStar")
|
||||
.and().field("myRating").is("5");
|
||||
ratingsApi.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
@@ -105,14 +105,14 @@ public class GetRatingSanityTests extends RestTest
|
||||
ratingsApi.rateStarsToDocument(document, 5);
|
||||
|
||||
ratingsApi.getLikeRating(document)
|
||||
.and().assertField("id").is("likes")
|
||||
.and().assertField("myRating").is("true");
|
||||
.assertThat().field("id").is("likes")
|
||||
.and().field("myRating").is("true");
|
||||
ratingsApi.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
ratingsApi.getFiveStarRating(document)
|
||||
.and().assertField("id").is("fiveStar")
|
||||
.and().assertField("myRating").is("5");
|
||||
.assertThat().field("id").is("fiveStar")
|
||||
.and().field("myRating").is("5");
|
||||
ratingsApi.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
@@ -127,14 +127,14 @@ public class GetRatingSanityTests extends RestTest
|
||||
ratingsApi.rateStarsToDocument(document, 5);
|
||||
|
||||
ratingsApi.getLikeRating(document)
|
||||
.and().assertField("id").is("likes")
|
||||
.and().assertField("myRating").is("true");
|
||||
.assertThat().field("id").is("likes")
|
||||
.and().field("myRating").is("true");
|
||||
ratingsApi.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
ratingsApi.getFiveStarRating(document)
|
||||
.and().assertField("id").is("fiveStar")
|
||||
.and().assertField("myRating").is("5");
|
||||
.assertThat().field("id").is("fiveStar")
|
||||
.and().field("myRating").is("5");
|
||||
ratingsApi.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
@@ -150,14 +150,14 @@ public class GetRatingSanityTests extends RestTest
|
||||
ratingsApi.rateStarsToDocument(document, 5);
|
||||
|
||||
ratingsApi.getLikeRating(document)
|
||||
.and().assertField("id").is("likes")
|
||||
.and().assertField("myRating").is("true");
|
||||
.assertThat().field("id").is("likes")
|
||||
.and().field("myRating").is("true");
|
||||
ratingsApi.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
ratingsApi.getFiveStarRating(document)
|
||||
.and().assertField("id").is("fiveStar")
|
||||
.and().assertField("myRating").is("5");
|
||||
.assertThat().field("id").is("fiveStar")
|
||||
.and().field("myRating").is("5");
|
||||
ratingsApi.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,9 @@ public class AddTagSanityTests extends RestTest
|
||||
public void adminIsAbleToAddTag() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
tagsAPI.addTag(document, tagValue).assertTagIs(tagValue);
|
||||
tagsAPI.addTag(document, tagValue)
|
||||
.assertThat().field("tag").is("tagValue")
|
||||
.and().field("id").isNotEmpty();
|
||||
tagsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
}
|
||||
@@ -71,7 +73,9 @@ public class AddTagSanityTests extends RestTest
|
||||
public void managerIsAbleToAddTag() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
tagsAPI.addTag(document, tagValue).assertTagIs(tagValue);
|
||||
tagsAPI.addTag(document, tagValue)
|
||||
.assertThat().field("id").isNotEmpty()
|
||||
.and().field("tag").is(tagValue);
|
||||
tagsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@@ -80,7 +84,9 @@ public class AddTagSanityTests extends RestTest
|
||||
public void collaboratorIsAbleToAddTag() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||
tagsAPI.addTag(document, tagValue).assertTagIs(tagValue);
|
||||
tagsAPI.addTag(document, tagValue)
|
||||
.assertThat().field("id").isNotEmpty()
|
||||
.and().field("tag").is(tagValue);
|
||||
tagsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@@ -89,7 +95,9 @@ public class AddTagSanityTests extends RestTest
|
||||
public void contributorIsNotAbleToAddTagToAnotherContent() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor));
|
||||
tagsAPI.addTag(document, tagValue);
|
||||
tagsAPI.addTag(document, tagValue)
|
||||
.assertThat().field("id").isNotEmpty()
|
||||
.and().field("tag").is(tagValue);
|
||||
tagsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.FORBIDDEN);
|
||||
}
|
||||
|
||||
@@ -100,7 +108,9 @@ public class AddTagSanityTests extends RestTest
|
||||
userModel = usersWithRoles.getOneUserWithRole(UserRole.SiteContributor);
|
||||
restClient.authenticateUser(userModel);
|
||||
contributorDoc = dataContent.usingSite(siteModel).usingUser(userModel).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
tagsAPI.addTag(contributorDoc, tagValue).assertTagIs(tagValue);
|
||||
tagsAPI.addTag(contributorDoc, tagValue)
|
||||
.assertThat().field("id").isNotEmpty()
|
||||
.and().field("tag").is(tagValue);
|
||||
tagsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@@ -109,7 +119,9 @@ public class AddTagSanityTests extends RestTest
|
||||
public void consumerIsNotAbleToAddTag() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
|
||||
tagsAPI.addTag(document, tagValue);
|
||||
tagsAPI.addTag(document, tagValue)
|
||||
.assertThat().field("id").isNotEmpty()
|
||||
.and().field("tag").is(tagValue);
|
||||
tagsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.FORBIDDEN);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,8 +63,8 @@ public class AddTagsSanityTests extends RestTest
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
tagsAPI.addTags(document, tag1, tag2)
|
||||
.assertEntriesListContains("tag", tag1.toLowerCase())
|
||||
.assertEntriesListContains("tag", tag2.toLowerCase());
|
||||
.assertThat().entriesListContains("tag", tag1.toLowerCase())
|
||||
.and().entriesListContains("tag", tag2.toLowerCase());
|
||||
|
||||
tagsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
}
|
||||
@@ -75,8 +75,8 @@ public class AddTagsSanityTests extends RestTest
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
tagsAPI.addTags(document, tag1, tag2)
|
||||
.assertEntriesListContains("tag", tag1.toLowerCase())
|
||||
.assertEntriesListContains("tag", tag2.toLowerCase());
|
||||
.assertThat().entriesListContains("tag", tag1.toLowerCase())
|
||||
.and().entriesListContains("tag", tag2.toLowerCase());
|
||||
|
||||
tagsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
}
|
||||
@@ -87,8 +87,8 @@ public class AddTagsSanityTests extends RestTest
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||
tagsAPI.addTags(document, tag1, tag2)
|
||||
.assertEntriesListContains("tag", tag1.toLowerCase())
|
||||
.assertEntriesListContains("tag", tag2.toLowerCase());
|
||||
.assertThat().entriesListContains("tag", tag1.toLowerCase())
|
||||
.and().entriesListContains("tag", tag2.toLowerCase());
|
||||
|
||||
tagsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
}
|
||||
@@ -110,8 +110,8 @@ public class AddTagsSanityTests extends RestTest
|
||||
restClient.authenticateUser(userModel);
|
||||
contributorDoc = dataContent.usingSite(siteModel).usingUser(userModel).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
tagsAPI.addTags(contributorDoc, tag1, tag2)
|
||||
.assertEntriesListContains("tag", tag1.toLowerCase())
|
||||
.assertEntriesListContains("tag", tag2.toLowerCase());
|
||||
.assertThat().entriesListContains("tag", tag1.toLowerCase())
|
||||
.and().entriesListContains("tag", tag2.toLowerCase());
|
||||
tagsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ public class GetNodeTagsSanityTests extends RestTest
|
||||
tagsAPI.addTag(document, tagValue);
|
||||
|
||||
tagsAPI.getNodeTags(document)
|
||||
.assertEntriesListContains("tag", tagValue.toLowerCase());
|
||||
.entriesListContains("tag", tagValue.toLowerCase());
|
||||
|
||||
tagsAPI.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK);
|
||||
@@ -75,7 +75,7 @@ public class GetNodeTagsSanityTests extends RestTest
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||
|
||||
|
||||
tagsAPI.getNodeTags(document).assertEntriesListContains("tag", tagValue.toLowerCase());
|
||||
tagsAPI.getNodeTags(document).entriesListContains("tag", tagValue.toLowerCase());
|
||||
|
||||
tagsAPI.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK);
|
||||
@@ -86,7 +86,7 @@ public class GetNodeTagsSanityTests extends RestTest
|
||||
public void siteContributorIsAbleToRetrieveNodeTags() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor));
|
||||
tagsAPI.getNodeTags(document).assertEntriesListContains("tag", tagValue.toLowerCase());
|
||||
tagsAPI.getNodeTags(document).entriesListContains("tag", tagValue.toLowerCase());
|
||||
|
||||
tagsAPI.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK);
|
||||
@@ -97,7 +97,7 @@ public class GetNodeTagsSanityTests extends RestTest
|
||||
public void siteConsumerIsAbleToRetrieveNodeTags() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
|
||||
tagsAPI.getNodeTags(document).assertEntriesListContains("tag", tagValue.toLowerCase());
|
||||
tagsAPI.getNodeTags(document).entriesListContains("tag", tagValue.toLowerCase());
|
||||
|
||||
tagsAPI.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK);
|
||||
@@ -108,7 +108,7 @@ public class GetNodeTagsSanityTests extends RestTest
|
||||
public void adminIsAbleToRetrieveNodeTags() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
tagsAPI.getNodeTags(document).assertEntriesListContains("tag", tagValue.toLowerCase());
|
||||
tagsAPI.getNodeTags(document).entriesListContains("tag", tagValue.toLowerCase());
|
||||
|
||||
tagsAPI.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK);
|
||||
@@ -120,7 +120,7 @@ public class GetNodeTagsSanityTests extends RestTest
|
||||
public void unauthenticatedUserIsNotAbleToRetrieveNodeTags() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(new UserModel("random user", "random password"));
|
||||
tagsAPI.getNodeTags(document).assertEntriesListContains("tag", tagValue.toLowerCase());
|
||||
tagsAPI.getNodeTags(document).entriesListContains("tag", tagValue.toLowerCase());
|
||||
|
||||
tagsAPI.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.UNAUTHORIZED);
|
||||
|
||||
@@ -56,7 +56,7 @@ public class GetTagSanityTests extends RestTest
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
RestTagModel tag = tagsAPI.addTag(document, tagValue);
|
||||
|
||||
tagsAPI.getTag(tag).assertTagIs(tagValue.toLowerCase());
|
||||
tagsAPI.getTag(tag).assertThat().field("tag").is(tagValue.toLowerCase());
|
||||
tagsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class GetTagSanityTests extends RestTest
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
RestTagModel tag = tagsAPI.addTag(document, tagValue);
|
||||
|
||||
tagsAPI.getTag(tag).assertTagIs(tagValue.toLowerCase());
|
||||
tagsAPI.getTag(tag).assertThat().field("tag").is(tagValue.toLowerCase());
|
||||
tagsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class GetTagSanityTests extends RestTest
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||
RestTagModel tag = tagsAPI.addTag(document, tagValue);
|
||||
|
||||
tagsAPI.getTag(tag).assertTagIs(tagValue.toLowerCase());
|
||||
tagsAPI.getTag(tag).assertThat().field("tag").is(tagValue.toLowerCase());
|
||||
tagsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public class GetTagSanityTests extends RestTest
|
||||
RestTagModel tag = tagsAPI.addTag(document, tagValue);
|
||||
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor));
|
||||
tagsAPI.getTag(tag).assertTagIs(tagValue.toLowerCase());
|
||||
tagsAPI.getTag(tag).assertThat().field("tag").is(tagValue.toLowerCase());
|
||||
tagsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ public class GetTagSanityTests extends RestTest
|
||||
RestTagModel tag = tagsAPI.addTag(document, tagValue);
|
||||
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
|
||||
tagsAPI.getTag(tag).assertTagIs(tagValue.toLowerCase());
|
||||
tagsAPI.getTag(tag).assertThat().field("tag").is(tagValue.toLowerCase());
|
||||
tagsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public class UpdateTagSanityTests extends RestTest
|
||||
public void adminIsAbleToUpdateTags() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
tagsAPI.updateTag(oldTag, randomTag).assertTagIs(randomTag);
|
||||
tagsAPI.updateTag(oldTag, randomTag).assertThat().field("tag").is(randomTag);
|
||||
tagsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ public class DeleteDeploymentSanityTests extends RestWorkflowTest
|
||||
restClient.authenticateUser(adminUser);
|
||||
// The deployment with name "customWorkflowExtentionForRest.bpmn" is created by Workflow Extention Point
|
||||
deploymentsApi.getDeployments()
|
||||
.assertEntriesListContains("name", "customWorkflowExtentionForRest.bpmn");
|
||||
.entriesListContains("name", "customWorkflowExtentionForRest.bpmn");
|
||||
|
||||
deployment = deploymentsApi.getDeployments().getDeploymentByName("customWorkflowExtentionForRest.bpmn");
|
||||
deploymentsApi.deleteDeployment(deployment);
|
||||
|
||||
@@ -43,7 +43,7 @@ public class GetDeploymentsSanityTests extends RestWorkflowTest
|
||||
public void getNonNetworkDeploymentsWithAdmin() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
deploymentsApi.getDeployments().assertEntriesListIsNotEmpty();
|
||||
deploymentsApi.getDeployments().entriesListIsNotEmpty();
|
||||
deploymentsApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class GetDeploymentsSanityTests extends RestWorkflowTest
|
||||
tenantApi.useRestClient(restClient);
|
||||
tenantApi.createTenant(adminTenantUser);
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
deploymentsApi.getDeployments().assertEntriesListIsNotEmpty();
|
||||
deploymentsApi.getDeployments().entriesListIsNotEmpty();
|
||||
deploymentsApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -43,9 +43,9 @@ public class GetProcessDefinitionSanityTests extends RestWorkflowTest
|
||||
{
|
||||
|
||||
processDefinitionsApi.getProcessDefinition(randomProcessDefinition).
|
||||
and().assertField("name").is(randomProcessDefinition.onModel().getName());
|
||||
assertThat().field("name").is(randomProcessDefinition.onModel().getName());
|
||||
|
||||
processDefinitionsApi.getProcessDefinition(randomProcessDefinition).and().assertField("name").is(randomProcessDefinition.onModel().getName());
|
||||
processDefinitionsApi.getProcessDefinition(randomProcessDefinition).assertThat().field("name").is(randomProcessDefinition.onModel().getName());
|
||||
processDefinitionsApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class GetProcessDefinitionSanityTests extends RestWorkflowTest
|
||||
public void anyUserGetsProcessDefinition() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(testUser);
|
||||
processDefinitionsApi.getProcessDefinition(randomProcessDefinition).and().assertField("name").is(randomProcessDefinition.onModel().getName());
|
||||
processDefinitionsApi.getProcessDefinition(randomProcessDefinition).assertThat().field("name").is(randomProcessDefinition.onModel().getName());
|
||||
processDefinitionsApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -45,7 +45,7 @@ public class GetProcessDefinitionStartFormModelSanityTests extends RestWorkflowT
|
||||
public void nonNetworkAdminGetsStartFormModel() throws Exception
|
||||
{
|
||||
randomProcessDefinition = processDefinitionsApi.getProcessDefinitions().getOneRandomEntry();
|
||||
processDefinitionsApi.getProcessDefinitionStartFormModel(randomProcessDefinition).assertEntriesListIsNotEmpty();
|
||||
processDefinitionsApi.getProcessDefinitionStartFormModel(randomProcessDefinition).entriesListIsNotEmpty();
|
||||
processDefinitionsApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class GetProcessDefinitionStartFormModelSanityTests extends RestWorkflowT
|
||||
tenantApi.createTenant(adminTenantUser);
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
randomProcessDefinition = processDefinitionsApi.getProcessDefinitions().getOneRandomEntry();
|
||||
processDefinitionsApi.getProcessDefinitionStartFormModel(randomProcessDefinition).assertEntriesListIsNotEmpty();
|
||||
processDefinitionsApi.getProcessDefinitionStartFormModel(randomProcessDefinition).entriesListIsNotEmpty();
|
||||
processDefinitionsApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -43,7 +43,7 @@ public class GetProcessDefinitionsSanityTests extends RestWorkflowTest
|
||||
public void nonNetworkAdminGetsProcessDefinitions() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
processDefinitionsApi.getProcessDefinitions().assertEntriesListIsNotEmpty();
|
||||
processDefinitionsApi.getProcessDefinitions().entriesListIsNotEmpty();
|
||||
processDefinitionsApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class GetProcessDefinitionsSanityTests extends RestWorkflowTest
|
||||
tenantApi.useRestClient(restClient);
|
||||
tenantApi.createTenant(adminTenantUser);
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
processDefinitionsApi.getProcessDefinitions().assertEntriesListIsNotEmpty();
|
||||
processDefinitionsApi.getProcessDefinitions().entriesListIsNotEmpty();
|
||||
processDefinitionsApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class AddProcessItemSanityTests extends RestWorkflowTest
|
||||
processModel = processesApi.getProcesses().getOneRandomEntry();
|
||||
processItem = processesApi.addProcessItem(processModel, document2);
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
processesApi.getProcessesItems(processModel).assertEntriesListContains("id", processItem.getId());
|
||||
processesApi.getProcessesItems(processModel).entriesListContains("id", processItem.getId());
|
||||
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class AddProcessItemSanityTests extends RestWorkflowTest
|
||||
processModel = processesApi.getProcesses().getOneRandomEntry();
|
||||
processItem = processesApi.addProcessItem(processModel, document3);
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
processesApi.getProcessesItems(processModel).assertEntriesListContains("id", processItem.getId());
|
||||
processesApi.getProcessesItems(processModel).entriesListContains("id", processItem.getId());
|
||||
processItem = processesApi.addProcessItem(processModel, document3);
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class AddProcessSanityTests extends RestWorkflowTest
|
||||
|
||||
restClient.authenticateUser(userWhoStartsProcess);
|
||||
addedProcess = processesApi.addProcess("activitiAdhoc", assignee, false, Priority.Normal);
|
||||
processesApi.getProcesses().assertEntriesListContains("id", addedProcess.getId());
|
||||
processesApi.getProcesses().entriesListContains("id", addedProcess.getId());
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class AddProcessSanityTests extends RestWorkflowTest
|
||||
|
||||
restClient.authenticateUser(tenantUserWhoStartsProcess);
|
||||
addedProcess = processesApi.addProcess("activitiAdhoc", tenantAssignee, false, Priority.Normal);
|
||||
processesApi.getProcesses().assertEntriesListContains("id", addedProcess.getId());
|
||||
processesApi.getProcesses().entriesListContains("id", addedProcess.getId());
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class DeleteProcessSanityTests extends RestWorkflowTest
|
||||
processesApi.deleteProcess(task);
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
|
||||
processesApi.getProcesses().assertEntriesListDoesNotContain("id", task.getNodeRef());
|
||||
processesApi.getProcesses().entriesListDoesNotContain("id", task.getNodeRef());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
@@ -65,7 +65,7 @@ public class DeleteProcessSanityTests extends RestWorkflowTest
|
||||
processesApi.deleteProcess(task);
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
|
||||
processesApi.getProcesses().assertEntriesListDoesNotContain("id", task.getNodeRef());
|
||||
processesApi.getProcesses().entriesListDoesNotContain("id", task.getNodeRef());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.SANITY, description = "Verify User that is not involved in a process is not authorized to delete it using REST API and status code is 403")
|
||||
|
||||
+10
-10
@@ -52,10 +52,10 @@ public class GetProcessTasksSanityTests extends RestWorkflowTest
|
||||
{
|
||||
restClient.authenticateUser(userModel);
|
||||
processesApi.getProcessTasks(process)
|
||||
.assertEntriesListIsNotEmpty()
|
||||
.assertEntriesListContains("assignee", assignee1.getUsername())
|
||||
.assertEntriesListContains("assignee", assignee2.getUsername())
|
||||
.assertEntriesListContains("assignee", assignee2.getUsername());
|
||||
.entriesListIsNotEmpty()
|
||||
.entriesListContains("assignee", assignee1.getUsername())
|
||||
.entriesListContains("assignee", assignee2.getUsername())
|
||||
.entriesListContains("assignee", assignee2.getUsername());
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -64,10 +64,10 @@ public class GetProcessTasksSanityTests extends RestWorkflowTest
|
||||
{
|
||||
restClient.authenticateUser(assignee1);
|
||||
processesApi.getProcessTasks(process)
|
||||
.assertEntriesListIsNotEmpty()
|
||||
.assertEntriesListContains("assignee", assignee1.getUsername())
|
||||
.assertEntriesListContains("assignee", assignee2.getUsername())
|
||||
.assertEntriesListContains("assignee", assignee2.getUsername());
|
||||
.entriesListIsNotEmpty()
|
||||
.entriesListContains("assignee", assignee1.getUsername())
|
||||
.entriesListContains("assignee", assignee2.getUsername())
|
||||
.entriesListContains("assignee", assignee2.getUsername());
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -80,8 +80,8 @@ public class GetProcessTasksSanityTests extends RestWorkflowTest
|
||||
|
||||
restClient.authenticateUser(assignee2);
|
||||
processesApi.getProcessTasks(process)
|
||||
.assertEntriesListIsNotEmpty()
|
||||
.assertEntriesListContains("assignee", userModel.getUsername());
|
||||
.entriesListIsNotEmpty()
|
||||
.entriesListContains("assignee", userModel.getUsername());
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class GetProcessesSanityTests extends RestWorkflowTest
|
||||
{
|
||||
restClient.authenticateUser(userWhoStartsTask);
|
||||
|
||||
processesApi.getProcesses().assertEntriesListContains("id", task.getNodeRef());
|
||||
processesApi.getProcesses().entriesListContains("id", task.getNodeRef());
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class GetProcessesSanityTests extends RestWorkflowTest
|
||||
{
|
||||
restClient.authenticateUser(assignee);
|
||||
|
||||
processesApi.getProcesses().assertEntriesListContains("id", task.getNodeRef());
|
||||
processesApi.getProcesses().entriesListContains("id", task.getNodeRef());
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class GetProcessesSanityTests extends RestWorkflowTest
|
||||
{
|
||||
restClient.authenticateUser(anotherUser);
|
||||
|
||||
processesApi.getProcesses().assertEntriesListDoesNotContain("id", task.getNodeRef());
|
||||
processesApi.getProcesses().entriesListDoesNotContain("id", task.getNodeRef());
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class GetProcessesSanityTests extends RestWorkflowTest
|
||||
{
|
||||
restClient.authenticateUser(dataUser.getAdminUser());
|
||||
|
||||
processesApi.getProcesses().assertEntriesListContains("id", task.getNodeRef());
|
||||
processesApi.getProcesses().entriesListContains("id", task.getNodeRef());
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ public class RemoveProcessItemSanityTests extends RestWorkflowTest
|
||||
processItem = processesApi.addProcessItem(processModel, document2);
|
||||
processesApi.deleteProcessItem(processModel, processItem);
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
processesApi.getProcessesItems(processModel).assertEntriesListDoesNotContain("id", processItem.getId());
|
||||
processesApi.getProcessesItems(processModel).entriesListDoesNotContain("id", processItem.getId());
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ public class RemoveProcessVariableSanityTests extends RestWorkflowTest
|
||||
processesApi.addProcessVariable(processModel, variableModel);
|
||||
processesApi.deleteProcessVariable(processModel, variableModel);
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
processesApi.getProcessesVariables(processModel).assertEntriesListDoesNotContain("name", variableModel.getName());
|
||||
processesApi.getProcessesVariables(processModel).entriesListDoesNotContain("name", variableModel.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
|
||||
+2
-2
@@ -56,7 +56,7 @@ public class UpdateProcessVariableSanityTests extends RestWorkflowTest
|
||||
RestProcessVariableModel variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processModel = processesApi.getProcesses().getOneRandomEntry();
|
||||
processesApi.updateProcessVariable(processModel, variableModel);
|
||||
processesApi.getProcessesVariables(processModel).assertEntriesListContains("name", variableModel.getName());
|
||||
processesApi.getProcessesVariables(processModel).entriesListContains("name", variableModel.getName());
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class UpdateProcessVariableSanityTests extends RestWorkflowTest
|
||||
processModel = processesApi.getProcesses().getOneRandomEntry();
|
||||
processesApi.addProcessVariable(processModel, variableModel);
|
||||
variableModel.setValue("newValue");
|
||||
processesApi.updateProcessVariable(processModel, variableModel).and().assertField("value").is("newValue");
|
||||
processesApi.updateProcessVariable(processModel, variableModel).assertThat().field("value").is("newValue");
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,14 +57,14 @@ public class AddTaskItemSanityTests extends RestWorkflowTest
|
||||
document2 = dataContent.usingSite(siteModel).createContent(DocumentType.XML);
|
||||
taskItem = tasksApi.addTaskItem(taskModel, document2);
|
||||
|
||||
taskItem.and().assertField("createdAt").is(taskItem.getCreatedAt())
|
||||
.and().assertField("size").is(taskItem.getSize())
|
||||
.and().assertField("createdBy").is(taskItem.getCreatedBy())
|
||||
.and().assertField("modifiedAt").is(taskItem.getModifiedAt())
|
||||
.and().assertField("name").is(taskItem.getName())
|
||||
.and().assertField("modifiedBy").is(taskItem.getModifiedBy())
|
||||
.and().assertField("id").is(taskItem.getId())
|
||||
.and().assertField("mimeType").is(taskItem.getMimeType());
|
||||
taskItem.assertThat().field("createdAt").is(taskItem.getCreatedAt())
|
||||
.assertThat().field("size").is(taskItem.getSize())
|
||||
.assertThat().field("createdBy").is(taskItem.getCreatedBy())
|
||||
.assertThat().field("modifiedAt").is(taskItem.getModifiedAt())
|
||||
.assertThat().field("name").is(taskItem.getName())
|
||||
.assertThat().field("modifiedBy").is(taskItem.getModifiedBy())
|
||||
.assertThat().field("id").is(taskItem.getId())
|
||||
.assertThat().field("mimeType").is(taskItem.getMimeType());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@@ -77,14 +77,14 @@ public class AddTaskItemSanityTests extends RestWorkflowTest
|
||||
restClient.authenticateUser(adminUser);
|
||||
document3 = dataContent.usingSite(siteModel).createContent(DocumentType.XML);
|
||||
taskItem = tasksApi.addTaskItem(taskModel, document3);
|
||||
taskItem.and().assertField("createdAt").is(taskItem.getCreatedAt())
|
||||
.and().assertField("size").is(taskItem.getSize())
|
||||
.and().assertField("createdBy").is(taskItem.getCreatedBy())
|
||||
.and().assertField("modifiedAt").is(taskItem.getModifiedAt())
|
||||
.and().assertField("name").is(taskItem.getName())
|
||||
.and().assertField("modifiedBy").is(taskItem.getModifiedBy())
|
||||
.and().assertField("id").is(taskItem.getId())
|
||||
.and().assertField("mimeType").is(taskItem.getMimeType());
|
||||
taskItem.assertThat().field("createdAt").is(taskItem.getCreatedAt())
|
||||
.assertThat().field("size").is(taskItem.getSize())
|
||||
.and().field("createdBy").is(taskItem.getCreatedBy())
|
||||
.and().field("modifiedAt").is(taskItem.getModifiedAt())
|
||||
.and().field("name").is(taskItem.getName())
|
||||
.and().field("modifiedBy").is(taskItem.getModifiedBy())
|
||||
.and().field("id").is(taskItem.getId())
|
||||
.and().field("mimeType").is(taskItem.getMimeType());
|
||||
taskItem = tasksApi.addTaskItem(taskModel, document3);
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
@@ -52,10 +52,10 @@ public class AddTaskVariablesSanityTests extends RestWorkflowTest
|
||||
restClient.authenticateUser(adminUser);
|
||||
RestVariableModel variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
tasksApi.addTaskVariable(taskModel, variableModel)
|
||||
.and().assertField("scope").is(variableModel.getScope())
|
||||
.and().assertField("name").is(variableModel.getName())
|
||||
.and().assertField("value").is(variableModel.getValue())
|
||||
.and().assertField("type").is(variableModel.getType());
|
||||
.assertThat().field("scope").is(variableModel.getScope())
|
||||
.and().field("name").is(variableModel.getName())
|
||||
.and().field("value").is(variableModel.getValue())
|
||||
.and().field("type").is(variableModel.getType());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@@ -66,10 +66,10 @@ public class AddTaskVariablesSanityTests extends RestWorkflowTest
|
||||
restClient.authenticateUser(assigneeUser);
|
||||
RestVariableModel variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
tasksApi.addTaskVariable(taskModel, variableModel)
|
||||
.and().assertField("scope").is(variableModel.getScope())
|
||||
.and().assertField("name").is(variableModel.getName())
|
||||
.and().assertField("value").is(variableModel.getValue())
|
||||
.and().assertField("type").is(variableModel.getType());
|
||||
.assertThat().field("scope").is(variableModel.getScope())
|
||||
.and().field("name").is(variableModel.getName())
|
||||
.and().field("value").is(variableModel.getValue())
|
||||
.and().field("type").is(variableModel.getType());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@@ -80,10 +80,10 @@ public class AddTaskVariablesSanityTests extends RestWorkflowTest
|
||||
restClient.authenticateUser(userWhoStartsTask);
|
||||
RestVariableModel variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
tasksApi.addTaskVariable(taskModel, variableModel)
|
||||
.and().assertField("scope").is(variableModel.getScope())
|
||||
.and().assertField("name").is(variableModel.getName())
|
||||
.and().assertField("value").is(variableModel.getValue())
|
||||
.and().assertField("type").is(variableModel.getType());
|
||||
.assertThat().field("scope").is(variableModel.getScope())
|
||||
.and().field("name").is(variableModel.getName())
|
||||
.and().field("value").is(variableModel.getValue())
|
||||
.and().field("type").is(variableModel.getType());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public class GetTaskFormModelSanityTests extends RestWorkflowTest
|
||||
RestFormModelsCollection returnedCollection = tasksApi.getTaskFormModel(taskModel);
|
||||
|
||||
|
||||
returnedCollection.assertEntriesListIsNotEmpty();
|
||||
returnedCollection.entriesListIsNotEmpty();
|
||||
|
||||
String[] qualifiedNames = {
|
||||
"{http://www.alfresco.org/model/bpm/1.0}percentComplete",
|
||||
@@ -65,7 +65,7 @@ public class GetTaskFormModelSanityTests extends RestWorkflowTest
|
||||
|
||||
for(String formQualifiedName : qualifiedNames)
|
||||
{
|
||||
returnedCollection.assertEntriesListContains("qualifiedName", formQualifiedName);
|
||||
returnedCollection.entriesListContains("qualifiedName", formQualifiedName);
|
||||
}
|
||||
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
@@ -76,7 +76,7 @@ public class GetTaskFormModelSanityTests extends RestWorkflowTest
|
||||
public void involvedUserGetsTaskFormModels() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(userModel);
|
||||
tasksApi.getTaskFormModel(taskModel).assertEntriesListIsNotEmpty();
|
||||
tasksApi.getTaskFormModel(taskModel).entriesListIsNotEmpty();
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ public class GetTaskItemsSanityTests extends RestWorkflowTest
|
||||
document1 = dataContent.usingSite(siteModel).createContent(DocumentType.XML);
|
||||
taskItem = tasksApi.addTaskItem(taskModel, document1);
|
||||
tasksApi.getTaskItems(taskModel)
|
||||
.assertEntriesListIsNotEmpty()
|
||||
.assertEntriesListContains("id", taskItem.getId());
|
||||
.entriesListIsNotEmpty()
|
||||
.entriesListContains("id", taskItem.getId());
|
||||
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
@@ -66,8 +66,8 @@ public class GetTaskItemsSanityTests extends RestWorkflowTest
|
||||
document1 = dataContent.usingSite(siteModel).createContent(DocumentType.XML);
|
||||
taskItem = tasksApi.addTaskItem(taskModel, document1);
|
||||
tasksApi.getTaskItems(taskModel)
|
||||
.assertEntriesListIsNotEmpty()
|
||||
.assertEntriesListContains("id", taskItem.getId());
|
||||
.entriesListIsNotEmpty()
|
||||
.entriesListContains("id", taskItem.getId());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -92,8 +92,8 @@ public class GetTaskItemsSanityTests extends RestWorkflowTest
|
||||
document1 = dataContent.usingSite(siteModel).createContent(DocumentType.XML);
|
||||
taskItem = tasksApi.addTaskItem(taskModel, document1);
|
||||
tasksApi.getTaskItems(taskModel)
|
||||
.assertEntriesListIsNotEmpty()
|
||||
.assertEntriesListContains("id", taskItem.getId());
|
||||
.entriesListIsNotEmpty()
|
||||
.entriesListContains("id", taskItem.getId());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class GetTasksSanityTests extends RestWorkflowTest
|
||||
{
|
||||
UserModel adminUser = dataUser.getAdminUser();
|
||||
restClient.authenticateUser(adminUser);
|
||||
tasksApi.getTasks().assertEntriesListIsNotEmpty();
|
||||
tasksApi.getTasks().entriesListIsNotEmpty();
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class GetTasksSanityTests extends RestWorkflowTest
|
||||
public void asigneeUserGetsItsTasks() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(assigneeUser);
|
||||
tasksApi.getTasks().assertEntriesListIsNotEmpty();
|
||||
tasksApi.getTasks().entriesListIsNotEmpty();
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public class GetTasksSanityTests extends RestWorkflowTest
|
||||
dataWorkflow.usingUser(userModel).usingSite(siteModel).usingResource(fileModel).createPooledReviewTaskAndAssignTo(group);
|
||||
|
||||
restClient.authenticateUser(userModel1);
|
||||
tasksApi.getTasks().assertEntriesListIsNotEmpty();
|
||||
tasksApi.getTasks().entriesListIsNotEmpty();
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ public class GetTasksSanityTests extends RestWorkflowTest
|
||||
dataWorkflow.usingUser(userModel1).claimTask(taskModel);
|
||||
|
||||
restClient.authenticateUser(userModel1);
|
||||
tasksApi.getTasks().assertEntriesListIsNotEmpty();
|
||||
tasksApi.getTasks().entriesListIsNotEmpty();
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class GetTasksSanityTests extends RestWorkflowTest
|
||||
dataWorkflow.usingUser(userModel1).claimTask(taskModel);
|
||||
|
||||
restClient.authenticateUser(userModel2);
|
||||
tasksApi.getTasks().assertEntriesListIsEmpty();
|
||||
tasksApi.getTasks().entriesListIsEmpty();
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user