- fix a few rest-api [tas] tests according with some recent changes from tas-utility

This commit is contained in:
Adina Parpalita
2020-11-02 13:19:44 +02:00
committed by dependabot-preview[bot]
parent 5e0d8cba20
commit 7208d4963e
3 changed files with 23 additions and 13 deletions

View File

@@ -317,7 +317,7 @@ public class GetCommentsTests extends RestTest
restClient.authenticateUser(user1).withCoreAPI().usingResource(file).addComment(comment); restClient.authenticateUser(user1).withCoreAPI().usingResource(file).addComment(comment);
comments = restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(file).getNodeComments(); comments = restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(file).getNodeComments();
comments.getOneRandomEntry().onModel().getCreatedBy().assertThat().field("firstName").is(user1.getUsername() + " FirstName") comments.getOneRandomEntry().onModel().getCreatedBy().assertThat().field("firstName").is("FN-" + user1.getUsername())
.assertThat().field("lastName").is("LN-" + user1.getUsername()); .assertThat().field("lastName").is("LN-" + user1.getUsername());
} }
@@ -393,7 +393,7 @@ public class GetCommentsTests extends RestTest
comments.assertThat().paginationField("totalItems").is("2"); comments.assertThat().paginationField("totalItems").is("2");
comments.getEntries().get(0).onModel().getCreatedBy() comments.getEntries().get(0).onModel().getCreatedBy()
.assertThat().field("firstName").is(usersWithRoles.getOneUserWithRole(UserRole.SiteManager).getUsername() + " FirstName") .assertThat().field("firstName").is("FN-" + usersWithRoles.getOneUserWithRole(UserRole.SiteManager).getUsername())
.assertThat().field("lastName").is("LN-" + usersWithRoles.getOneUserWithRole(UserRole.SiteManager).getUsername()); .assertThat().field("lastName").is("LN-" + usersWithRoles.getOneUserWithRole(UserRole.SiteManager).getUsername());
comments.getEntries().get(1).onModel().getCreatedBy() comments.getEntries().get(1).onModel().getCreatedBy()

View File

@@ -41,8 +41,10 @@ public class GetPeopleSanityTests extends RestTest
personModel = restClient.authenticateUser(managerUser).withCoreAPI().usingUser(searchedUser).getPerson(); personModel = restClient.authenticateUser(managerUser).withCoreAPI().usingUser(searchedUser).getPerson();
restClient.assertStatusCodeIs(HttpStatus.OK); restClient.assertStatusCodeIs(HttpStatus.OK);
personModel.assertThat().field("id").is(searchedUser.getUsername()).assertThat().field("firstName").is(searchedUser.getUsername() + " FirstName").and() personModel.assertThat().field("id").is(searchedUser.getUsername())
.field("email").is(searchedUser.getUsername() + domain).and().field("emailNotificationsEnabled").is("true"); .and().field("firstName").is("FN-" + searchedUser.getUsername())
.and().field("email").is(searchedUser.getUsername() + domain)
.and().field("emailNotificationsEnabled").is("true");
} }
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
@@ -54,8 +56,10 @@ public class GetPeopleSanityTests extends RestTest
personModel = restClient.authenticateUser(collaboratorUser).withCoreAPI().usingUser(searchedUser).getPerson(); personModel = restClient.authenticateUser(collaboratorUser).withCoreAPI().usingUser(searchedUser).getPerson();
restClient.assertStatusCodeIs(HttpStatus.OK); restClient.assertStatusCodeIs(HttpStatus.OK);
personModel.assertThat().field("id").is(searchedUser.getUsername()).assertThat().field("firstName").is(searchedUser.getUsername() + " FirstName").and() personModel.assertThat().field("id").is(searchedUser.getUsername())
.field("email").is(searchedUser.getUsername() + domain).and().field("emailNotificationsEnabled").is("true"); .and().field("firstName").is("FN-" + searchedUser.getUsername())
.and().field("email").is(searchedUser.getUsername() + domain)
.and().field("emailNotificationsEnabled").is("true");
} }
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.COMMENTS, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.COMMENTS, TestGroup.SANITY })
@@ -67,8 +71,10 @@ public class GetPeopleSanityTests extends RestTest
personModel = restClient.authenticateUser(contributorUser).withCoreAPI().usingUser(searchedUser).getPerson(); personModel = restClient.authenticateUser(contributorUser).withCoreAPI().usingUser(searchedUser).getPerson();
restClient.assertStatusCodeIs(HttpStatus.OK); restClient.assertStatusCodeIs(HttpStatus.OK);
personModel.assertThat().field("id").is(searchedUser.getUsername()).assertThat().field("firstName").is(searchedUser.getUsername() + " FirstName").and() personModel.assertThat().field("id").is(searchedUser.getUsername())
.field("email").is(searchedUser.getUsername() + domain).and().field("emailNotificationsEnabled").is("true"); .and().field("firstName").is("FN-" + searchedUser.getUsername())
.and().field("email").is(searchedUser.getUsername() + domain)
.and().field("emailNotificationsEnabled").is("true");
} }
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
@@ -80,8 +86,10 @@ public class GetPeopleSanityTests extends RestTest
personModel = restClient.authenticateUser(consumerUser).withCoreAPI().usingUser(searchedUser).getPerson(); personModel = restClient.authenticateUser(consumerUser).withCoreAPI().usingUser(searchedUser).getPerson();
restClient.assertStatusCodeIs(HttpStatus.OK); restClient.assertStatusCodeIs(HttpStatus.OK);
personModel.assertThat().field("id").is(searchedUser.getUsername()).assertThat().field("firstName").is(searchedUser.getUsername() + " FirstName").and() personModel.assertThat().field("id").is(searchedUser.getUsername())
.field("email").is(searchedUser.getUsername() + domain).and().field("emailNotificationsEnabled").is("true"); .and().field("firstName").is("FN-" + searchedUser.getUsername())
.and().field("email").is(searchedUser.getUsername() + domain)
.and().field("emailNotificationsEnabled").is("true");
; ;
} }
@@ -91,8 +99,10 @@ public class GetPeopleSanityTests extends RestTest
{ {
personModel = restClient.authenticateUser(adminUser).withCoreAPI().usingUser(searchedUser).getPerson(); personModel = restClient.authenticateUser(adminUser).withCoreAPI().usingUser(searchedUser).getPerson();
restClient.assertStatusCodeIs(HttpStatus.OK); restClient.assertStatusCodeIs(HttpStatus.OK);
personModel.assertThat().field("id").is(searchedUser.getUsername()).assertThat().field("firstName").is(searchedUser.getUsername() + " FirstName").and() personModel.assertThat().field("id").is(searchedUser.getUsername())
.field("email").is(searchedUser.getUsername() + domain).and().field("emailNotificationsEnabled").is("true"); .and().field("firstName").is("FN-" + searchedUser.getUsername())
.and().field("email").is(searchedUser.getUsername() + domain)
.and().field("emailNotificationsEnabled").is("true");
; ;
} }

View File

@@ -63,7 +63,7 @@ public class GetPeopleActivitiesFullTests extends RestTest
// after repo-4250 a file is created first and then update it with content, so there are more entries than previously // after repo-4250 a file is created first and then update it with content, so there are more entries than previously
restActivityModelsCollection.assertThat().paginationField("count").is("2"); restActivityModelsCollection.assertThat().paginationField("count").is("2");
RestActivitySummaryModel summary = restActivityModelsCollection.getEntries().get(0).onModel().getActivitySummary(); RestActivitySummaryModel summary = restActivityModelsCollection.getEntries().get(0).onModel().getActivitySummary();
summary.assertThat().field("firstName").is(userModel.getUsername() + " FirstName") summary.assertThat().field("firstName").is("FN-" + userModel.getUsername())
.and().field("lastName").is("LN-" + userModel.getUsername()) .and().field("lastName").is("LN-" + userModel.getUsername())
.and().field("title").is(fileInSite1.getName()) .and().field("title").is(fileInSite1.getName())
.and().field("objectId").is(fileInSite1.getNodeRefWithoutVersion()); .and().field("objectId").is(fileInSite1.getNodeRefWithoutVersion());