diff --git a/e2e-test/java/org/alfresco/rest/comments/AddCommentCoreTests.java b/e2e-test/java/org/alfresco/rest/comments/AddCommentCoreTests.java index 23ea6a54f..7f6955cd9 100644 --- a/e2e-test/java/org/alfresco/rest/comments/AddCommentCoreTests.java +++ b/e2e-test/java/org/alfresco/rest/comments/AddCommentCoreTests.java @@ -138,7 +138,7 @@ public class AddCommentCoreTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.COMMENTS }, executionType = ExecutionType.REGRESSION, description = "Verify comment cannot be added if empty network ID is provided") - @Bug(id = "MNT-16904") + @Bug(id = "MNT-16904", description = "It fails only on environment with tenants") @Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.CORE }) public void addCommentUsingEmptyNetworkId() throws JsonToModelConversionException, Exception { diff --git a/e2e-test/java/org/alfresco/rest/comments/AddCommentSanityTests.java b/e2e-test/java/org/alfresco/rest/comments/AddCommentSanityTests.java index c5625db02..93606fb20 100644 --- a/e2e-test/java/org/alfresco/rest/comments/AddCommentSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/comments/AddCommentSanityTests.java @@ -101,7 +101,7 @@ public class AddCommentSanityTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user gets status code 401 on post comments call") @Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.SANITY }) - @Bug(id = "MNT-16904") + @Bug(id = "MNT-16904", description = "It fails only on environment with tenants") public void unauthenticatedUserIsNotAbleToAddComment() throws JsonToModelConversionException, Exception { restClient.authenticateUser(new UserModel("random user", "random password")); diff --git a/e2e-test/java/org/alfresco/rest/comments/DeleteCommentSanityTests.java b/e2e-test/java/org/alfresco/rest/comments/DeleteCommentSanityTests.java index 32ac39335..aecc7fd06 100644 --- a/e2e-test/java/org/alfresco/rest/comments/DeleteCommentSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/comments/DeleteCommentSanityTests.java @@ -95,7 +95,7 @@ public class DeleteCommentSanityTests extends RestTest @TestRail(section = { TestGroup.REST_API,TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify User gets status code 401 if authentication call fails") @Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.SANITY }) - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void userIsNotAbleToDeleteCommentIfAuthenticationFails() throws JsonToModelConversionException, Exception { restClient.authenticateUser(adminUserModel); diff --git a/e2e-test/java/org/alfresco/rest/comments/GetCommentsSanityTests.java b/e2e-test/java/org/alfresco/rest/comments/GetCommentsSanityTests.java index d3e2927ac..f781e0eea 100644 --- a/e2e-test/java/org/alfresco/rest/comments/GetCommentsSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/comments/GetCommentsSanityTests.java @@ -100,7 +100,7 @@ public class GetCommentsSanityTests extends RestTest @TestRail(section={TestGroup.REST_API, TestGroup.COMMENTS}, executionType= ExecutionType.SANITY, description= "Verify Manager user gets status code 401 if authentication call fails") @Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.SANITY }) - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void managerIsNotAbleToRetrieveCommentIfAuthenticationFails() throws JsonToModelConversionException, Exception { UserModel nonexistentModel = new UserModel("nonexistentUser", "nonexistentPassword"); diff --git a/e2e-test/java/org/alfresco/rest/comments/UpdateCommentSanityTests.java b/e2e-test/java/org/alfresco/rest/comments/UpdateCommentSanityTests.java index b77a895da..c724ef6e3 100644 --- a/e2e-test/java/org/alfresco/rest/comments/UpdateCommentSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/comments/UpdateCommentSanityTests.java @@ -100,7 +100,7 @@ public class UpdateCommentSanityTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user gets status code 401 on update comment call") @Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.SANITY }) - @Bug(id="MNT-16904") + @Bug(id = "MNT-16904", description = "fails only on environment with tenants") public void unauthenticatedUserIsNotAbleToUpdateComment() throws JsonToModelConversionException, Exception { restClient.authenticateUser(adminUserModel); diff --git a/e2e-test/java/org/alfresco/rest/favorites/AddFavoritesSanityTests.java b/e2e-test/java/org/alfresco/rest/favorites/AddFavoritesSanityTests.java index 672fed851..4373b0050 100644 --- a/e2e-test/java/org/alfresco/rest/favorites/AddFavoritesSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/favorites/AddFavoritesSanityTests.java @@ -87,7 +87,7 @@ public class AddFavoritesSanityTests extends RestTest restPersonFavoritesModel.and().field("targetGuid").is(siteModel.getGuid()); } - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") @TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Manager user gets status code 401 if authentication call fails") @Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY }) diff --git a/e2e-test/java/org/alfresco/rest/favorites/DeleteFavoriteSanityTests.java b/e2e-test/java/org/alfresco/rest/favorites/DeleteFavoriteSanityTests.java index 4aabae20f..cc0ed1abf 100644 --- a/e2e-test/java/org/alfresco/rest/favorites/DeleteFavoriteSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/favorites/DeleteFavoriteSanityTests.java @@ -157,7 +157,7 @@ public class DeleteFavoriteSanityTests extends RestTest .assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError().containsSummary(RestErrorModel.PERMISSION_WAS_DENIED); } - @Bug(id = "MNT-16904") + @Bug(id = "MNT-16904", description = "It fails only on environment with tenants") @TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails") @Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY }) diff --git a/e2e-test/java/org/alfresco/rest/favorites/GetFavoriteSanityTests.java b/e2e-test/java/org/alfresco/rest/favorites/GetFavoriteSanityTests.java index 62613ef1f..86de14f71 100644 --- a/e2e-test/java/org/alfresco/rest/favorites/GetFavoriteSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/favorites/GetFavoriteSanityTests.java @@ -281,7 +281,7 @@ public class GetFavoriteSanityTests extends RestTest description = "Verify user gets status code 401 if authentication call fails") @Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY }) @Bug(id = "MNT-16904", description = "fails only on environment with tenants") - public void userIsNotAbleToRetrieveFavoritesIfAuthenticationFails() throws JsonToModelConversionException, Exception + public void userIsNotAbleToRetrieveFavoriteSiteIfAuthenticationFails() throws JsonToModelConversionException, Exception { UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager); siteManager.setPassword("wrongPassword"); diff --git a/e2e-test/java/org/alfresco/rest/favorites/GetFavoritesSanityTests.java b/e2e-test/java/org/alfresco/rest/favorites/GetFavoritesSanityTests.java index 38c0789f1..c27b699fe 100644 --- a/e2e-test/java/org/alfresco/rest/favorites/GetFavoritesSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/favorites/GetFavoritesSanityTests.java @@ -185,7 +185,7 @@ public class GetFavoritesSanityTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails") @Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY }) - @Bug(id = "MNT-16904", description = "fails only on environment with tenants") + @Bug(id = "MNT-16904", description = "It fails only on environment with tenants") public void userIsNotAbleToRetrieveFavoritesIfAuthenticationFails() throws JsonToModelConversionException, Exception { UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager); diff --git a/e2e-test/java/org/alfresco/rest/people/AddFavoriteSiteSanityTests.java b/e2e-test/java/org/alfresco/rest/people/AddFavoriteSiteSanityTests.java index a6c8a7c74..9e7e9ff8b 100644 --- a/e2e-test/java/org/alfresco/rest/people/AddFavoriteSiteSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/people/AddFavoriteSiteSanityTests.java @@ -93,7 +93,7 @@ public class AddFavoriteSiteSanityTests extends RestTest @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify a manager user is NOT Authorized to add a favorite site with Rest API when authentication fails (401)") - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void managerUserNotAuthorizedFailsToAddFavoriteSite() throws Exception { UserModel managerUser = dataUser.usingAdmin().createRandomTestUser(); diff --git a/e2e-test/java/org/alfresco/rest/people/DeleteSiteMembershipRequestSanityTests.java b/e2e-test/java/org/alfresco/rest/people/DeleteSiteMembershipRequestSanityTests.java index 5c6c69a94..af2db17eb 100644 --- a/e2e-test/java/org/alfresco/rest/people/DeleteSiteMembershipRequestSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/people/DeleteSiteMembershipRequestSanityTests.java @@ -125,7 +125,7 @@ public class DeleteSiteMembershipRequestSanityTests extends RestTest @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) @TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, description = "Failed authentication get site member call returns status code 401") - @Bug(id = "MNT-16904") + @Bug(id = "MNT-16904", description = "It fails only on environment with tenants") public void unauthenticatedUserIsNotAuthorizedToDeleteSiteMmebershipRequest() throws JsonToModelConversionException, Exception { restClient.authenticateUser(dataUser.createRandomTestUser()).withCoreAPI().usingAuthUser().addSiteMembershipRequest(siteModel); diff --git a/e2e-test/java/org/alfresco/rest/people/GetFavoriteSiteSanityTests.java b/e2e-test/java/org/alfresco/rest/people/GetFavoriteSiteSanityTests.java index 070a2020f..dcbd77d31 100644 --- a/e2e-test/java/org/alfresco/rest/people/GetFavoriteSiteSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/people/GetFavoriteSiteSanityTests.java @@ -121,7 +121,7 @@ public class GetFavoriteSiteSanityTests extends RestTest @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify manager user is NOT Authorized gets its specific favorite site with Rest API when authentication fails (401)") - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void managerUserNotAuthorizedFailsToGetFavoriteSite() throws Exception { UserModel managerUser = dataUser.usingAdmin().createRandomTestUser(); diff --git a/e2e-test/java/org/alfresco/rest/people/GetFavoriteSitesSanityTests.java b/e2e-test/java/org/alfresco/rest/people/GetFavoriteSitesSanityTests.java index 506945afd..cc7f16302 100644 --- a/e2e-test/java/org/alfresco/rest/people/GetFavoriteSitesSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/people/GetFavoriteSitesSanityTests.java @@ -109,7 +109,7 @@ public class GetFavoriteSitesSanityTests extends RestTest @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify any user is NOT Authorized to get its favorite sites with Rest API when authentication fails (401)") - @Bug(id = "MNT-16904") + @Bug(id = "MNT-16904", description = "It fails only on environment with tenants") public void anyUserNotAuthenticatedIsNotAuthorizedToGetFavoriteSites() throws Exception { UserModel anyUser = dataUser.usingAdmin().createRandomTestUser(); diff --git a/e2e-test/java/org/alfresco/rest/people/GetPeoplePreferenceSanityTests.java b/e2e-test/java/org/alfresco/rest/people/GetPeoplePreferenceSanityTests.java index b9d7427e1..8f5397812 100644 --- a/e2e-test/java/org/alfresco/rest/people/GetPeoplePreferenceSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/people/GetPeoplePreferenceSanityTests.java @@ -105,7 +105,7 @@ public class GetPeoplePreferenceSanityTests extends RestTest @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.PREFERENCES, TestGroup.SANITY }) @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.PREFERENCES }, executionType = ExecutionType.SANITY, description = "Verify manager user is NOT Authorized to get a specific preference with Rest API when authentication fails (401)") - @Bug(id = "MNT-16904") + @Bug(id = "MNT-16904", description = "fails only on environment with tenants") public void managerUserNotAuthorizedFailsToGetsAPreference() throws Exception { UserModel managerUser = dataUser.usingAdmin().createRandomTestUser(); diff --git a/e2e-test/java/org/alfresco/rest/people/GetPeoplePreferencesSanityTests.java b/e2e-test/java/org/alfresco/rest/people/GetPeoplePreferencesSanityTests.java index b7a3da1fd..7e435e681 100644 --- a/e2e-test/java/org/alfresco/rest/people/GetPeoplePreferencesSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/people/GetPeoplePreferencesSanityTests.java @@ -107,7 +107,7 @@ public class GetPeoplePreferencesSanityTests extends RestTest @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.PREFERENCES, TestGroup.SANITY }) @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.PREFERENCES }, executionType = ExecutionType.SANITY, description = "Verify manager user is NOT Authorized to gets its preferences with Rest API when authentication fails(401)") - @Bug(id = "MNT-16904") + @Bug(id = "MNT-16904", description = "It fails only on environment with tenants") public void managerUserGetsPeoplePreferencesIsNotAuthorized() throws Exception { UserModel managerUser = dataUser.usingAdmin().createRandomTestUser(); diff --git a/e2e-test/java/org/alfresco/rest/people/GetSiteMembershipRequestCoreTests.java b/e2e-test/java/org/alfresco/rest/people/GetSiteMembershipRequestCoreTests.java index b5ef3a2a2..1698d7bab 100644 --- a/e2e-test/java/org/alfresco/rest/people/GetSiteMembershipRequestCoreTests.java +++ b/e2e-test/java/org/alfresco/rest/people/GetSiteMembershipRequestCoreTests.java @@ -51,7 +51,7 @@ public class GetSiteMembershipRequestCoreTests extends RestTest @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.CORE }) @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION, description = "Verify collaborator user fails to get all site membership requests of a specific person with Rest API when the authentication fails (401)") - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void unauthorizedCollaboratorUserFailsToGetSiteMembershipRequests() throws Exception { UserModel collaborator = dataUser.usingAdmin().createRandomTestUser(); @@ -64,7 +64,7 @@ public class GetSiteMembershipRequestCoreTests extends RestTest @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.CORE }) @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION, description = "Verify consumer user fails to get all site membership requests of a specific person with Rest API when the authentication fails (401)") - @Bug(id = "MNT-16904") + @Bug(id = "MNT-16904", description = "It fails only on environment with tenants") public void unauthorizedConsumerUserFailsToGetSiteMembershipRequests() throws Exception { UserModel consumer = dataUser.usingAdmin().createRandomTestUser(); diff --git a/e2e-test/java/org/alfresco/rest/people/GetSiteMembershipRequestsSanityTests.java b/e2e-test/java/org/alfresco/rest/people/GetSiteMembershipRequestsSanityTests.java index 1551fa7c3..03cbf8b33 100644 --- a/e2e-test/java/org/alfresco/rest/people/GetSiteMembershipRequestsSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/people/GetSiteMembershipRequestsSanityTests.java @@ -92,7 +92,7 @@ public class GetSiteMembershipRequestsSanityTests extends RestTest } @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) - @Bug(id = "MNT-16904") + @Bug(id = "MNT-16904", description = "It fails only on environment with tenants") @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify manager user fails to get all site membership requests of a specific person with Rest API when the authentication fails (401)") public void unauthorizedUserFailsToGetSiteMembershipRequests() throws Exception { diff --git a/e2e-test/java/org/alfresco/rest/people/GetSiteMembershipSanityTests.java b/e2e-test/java/org/alfresco/rest/people/GetSiteMembershipSanityTests.java index 6d46dfbc2..04766c5d1 100644 --- a/e2e-test/java/org/alfresco/rest/people/GetSiteMembershipSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/people/GetSiteMembershipSanityTests.java @@ -80,7 +80,7 @@ public class GetSiteMembershipSanityTests extends RestTest @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to retrieve site membership information of another user") - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void unauthenticatedUserCannotRetrieveSiteMembershipInformation() throws JsonToModelConversionException, Exception { restClient.authenticateUser(new UserModel("random user", "random password")).withCoreAPI() diff --git a/e2e-test/java/org/alfresco/rest/people/GetSitesMembershipInformationSanityTests.java b/e2e-test/java/org/alfresco/rest/people/GetSitesMembershipInformationSanityTests.java index 74f5b07f3..685d06aee 100644 --- a/e2e-test/java/org/alfresco/rest/people/GetSitesMembershipInformationSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/people/GetSitesMembershipInformationSanityTests.java @@ -78,7 +78,7 @@ public class GetSitesMembershipInformationSanityTests extends RestTest @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY }) @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.SANITY, description = "Verify that unauthenticated user is not able to retrieve sites membership information") - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void unauthenticatedUserCannotRetrieveSitesMembershipInformation() throws JsonToModelConversionException, Exception { UserModel inexistentUser = new UserModel("inexistent user", "wrong password"); diff --git a/e2e-test/java/org/alfresco/rest/ratings/AddRatingCoreTests.java b/e2e-test/java/org/alfresco/rest/ratings/AddRatingCoreTests.java index c2fe21051..493837ee1 100644 --- a/e2e-test/java/org/alfresco/rest/ratings/AddRatingCoreTests.java +++ b/e2e-test/java/org/alfresco/rest/ratings/AddRatingCoreTests.java @@ -15,7 +15,6 @@ import org.alfresco.utility.model.LinkModel; import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.UserModel; -import org.alfresco.utility.report.Bug; import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.annotation.TestRail; import org.apache.commons.lang3.RandomStringUtils; @@ -79,16 +78,20 @@ public class AddRatingCoreTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.RATINGS }, executionType = ExecutionType.REGRESSION, description = "Verify that if nodeId provided cannot be rated 405 status code is returned") @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.CORE }) - @Bug(id = "MNT-16904") public void likeResourceThatCannotBeRated() throws Exception { FolderModel folderModel = dataContent.usingUser(userModel).usingSite(siteModel).createFolder(); FileModel document = dataContent.usingUser(userModel).usingResource(folderModel).createContent(DocumentType.TEXT_PLAIN); LinkModel link = dataLink.usingAdmin().usingSite(siteModel).createRandomLink(); - document.setNodeRef(link.getNodeRef()); + document.setNodeRef(link.getNodeRef().replace("workspace://SpacesStore/", "workspace%3A%2F%2FSpacesStore%2F")); restClient.authenticateUser(adminUser).withCoreAPI().usingResource(document).likeDocument(); - restClient.assertStatusCodeIs(HttpStatus.METHOD_NOT_ALLOWED); + restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND) + .assertLastError() + .containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, document.getNodeRef())) + .containsErrorKey(RestErrorModel.ENTITY_NOT_FOUND_ERRORKEY) + .descriptionURLIs(RestErrorModel.RESTAPIEXPLORER) + .stackTraceIs(RestErrorModel.STACKTRACE); } @TestRail(section = { TestGroup.REST_API, diff --git a/e2e-test/java/org/alfresco/rest/ratings/AddRatingSanityTests.java b/e2e-test/java/org/alfresco/rest/ratings/AddRatingSanityTests.java index 503db0088..8b81a47c6 100644 --- a/e2e-test/java/org/alfresco/rest/ratings/AddRatingSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/ratings/AddRatingSanityTests.java @@ -117,7 +117,7 @@ public class AddRatingSanityTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.RATINGS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to post like rating to a document") @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.SANITY }) - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void unauthenticatedUserIsNotAbleToLikeDocument() throws Exception { FolderModel folderModel = dataContent.usingUser(userModel).usingSite(siteModel).createFolder(); @@ -201,7 +201,7 @@ public class AddRatingSanityTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.RATINGS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to post stars rating to a document") @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.SANITY }) - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "fails only on environment with tenants") public void unauthenticatedUserIsNotAbleToRateStarsToDocument() throws Exception { FolderModel folderModel = dataContent.usingUser(userModel).usingSite(siteModel).createFolder(); diff --git a/e2e-test/java/org/alfresco/rest/ratings/DeleteRatingSanityTests.java b/e2e-test/java/org/alfresco/rest/ratings/DeleteRatingSanityTests.java index 1b2472d2b..10d6bc214 100644 --- a/e2e-test/java/org/alfresco/rest/ratings/DeleteRatingSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/ratings/DeleteRatingSanityTests.java @@ -162,7 +162,7 @@ public class DeleteRatingSanityTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.RATINGS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to remove its own rating of a document") @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.SANITY }) - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void unauthenticatedUserIsNotAbleToDeleteRatings() throws Exception { FolderModel folderModel = dataContent.usingUser(adminUser).usingSite(siteModel).createFolder(); diff --git a/e2e-test/java/org/alfresco/rest/ratings/GetRatingFullTests.java b/e2e-test/java/org/alfresco/rest/ratings/GetRatingFullTests.java new file mode 100644 index 000000000..3fdc99e28 --- /dev/null +++ b/e2e-test/java/org/alfresco/rest/ratings/GetRatingFullTests.java @@ -0,0 +1,199 @@ +package org.alfresco.rest.ratings; + +import org.alfresco.dataprep.CMISUtil.DocumentType; +import org.alfresco.rest.RestTest; +import org.alfresco.rest.model.RestErrorModel; +import org.alfresco.rest.model.RestRatingModel; +import org.alfresco.utility.constants.UserRole; +import org.alfresco.utility.exception.DataPreparationException; +import org.alfresco.utility.model.FileModel; +import org.alfresco.utility.model.FolderModel; +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.apache.commons.lang.RandomStringUtils; +import org.springframework.http.HttpStatus; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class GetRatingFullTests extends RestTest +{ + private SiteModel siteModel; + private UserModel adminUserModel, userModel; + private RestRatingModel returnedRatingModel; + + @BeforeClass(alwaysRun = true) + public void dataPreparation() throws DataPreparationException + { + adminUserModel = dataUser.getAdminUser(); + userModel = dataUser.createRandomTestUser(); + siteModel = dataSite.usingAdmin().createPublicRandomSite(); + dataUser.addUserToSite(userModel, siteModel, UserRole.SiteManager); + } + + @TestRail(section = { TestGroup.REST_API, TestGroup.RATINGS }, executionType = ExecutionType.REGRESSION, description = "Check default error schema") + @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.FULL }) + public void checkDefaultErrorSchema() throws Exception + { + FileModel document = dataContent.usingSite(siteModel).usingAdmin().createContent(DocumentType.TEXT_PLAIN); + String randomNodeRef = RandomStringUtils.randomAlphanumeric(10); + document.setNodeRef(randomNodeRef); + restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(document).getLikeRating(); + restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError() + .containsErrorKey(RestErrorModel.ENTITY_NOT_FOUND_ERRORKEY) + .containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, randomNodeRef)) + .descriptionURLIs(RestErrorModel.RESTAPIEXPLORER) + .stackTraceIs(RestErrorModel.STACKTRACE); + } + + @TestRail(section = { TestGroup.REST_API, TestGroup.RATINGS }, executionType = ExecutionType.REGRESSION, + description = "Get rating of a folder that has only stars") + @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.FULL }) + public void getRatingOfFolderThatHasOnlyStars() throws Exception + { + FolderModel folder = dataContent.usingUser(adminUserModel).usingSite(siteModel).createFolder(); + restClient.authenticateUser(userModel).withCoreAPI().usingResource(folder).rateStarsToDocument(3); + returnedRatingModel = restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(folder).getFiveStarRating(); + restClient.assertStatusCodeIs(HttpStatus.OK); + returnedRatingModel.assertThat().field("id").is("fiveStar") + .getAggregate().assertThat().field("numberOfRatings").is("1") + .assertThat().field("average").is("3.0"); + } + + @TestRail(section = { TestGroup.REST_API, TestGroup.RATINGS }, executionType = ExecutionType.REGRESSION, + description = "Get rating of a folder that has both likes and stars") + @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.FULL }) + public void getRatingOfFolderThatHasLikedAndStars() throws Exception + { + FolderModel folder = dataContent.usingUser(adminUserModel).usingSite(siteModel).createFolder(); + restClient.authenticateUser(userModel).withCoreAPI().usingResource(folder).rateStarsToDocument(3); + restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(folder).likeDocument(); + + returnedRatingModel = restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(folder).getFiveStarRating(); + restClient.assertStatusCodeIs(HttpStatus.OK); + returnedRatingModel.assertThat().field("id").is("fiveStar") + .getAggregate().assertThat().field("numberOfRatings").is("1") + .assertThat().field("average").is("3.0"); + + returnedRatingModel = restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(folder).getLikeRating(); + restClient.assertStatusCodeIs(HttpStatus.OK); + returnedRatingModel.assertThat().field("id").is("likes") + .assertThat().field("myRating").is("true"); + } + + @TestRail(section = { TestGroup.REST_API, TestGroup.RATINGS }, executionType = ExecutionType.REGRESSION, + description = "Get rating of a folder that has no ratings") + @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.FULL }) + public void getRatingOfFolderThatHasNoRatings() throws Exception + { + FolderModel folder = dataContent.usingUser(adminUserModel).usingSite(siteModel).createFolder(); + + returnedRatingModel = restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(folder).getFiveStarRating(); + returnedRatingModel.getAggregate().assertThat().field("numberOfRatings").is("0"); + + returnedRatingModel = restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(folder).getLikeRating(); + returnedRatingModel.getAggregate().assertThat().field("numberOfRatings").is("0"); + } + + @TestRail(section = { TestGroup.REST_API, TestGroup.RATINGS }, executionType = ExecutionType.REGRESSION, + description = "Get rating of a folder after rating was deleted") + @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.FULL }) + public void getDeletedRatingOfAFolder() throws Exception + { + FolderModel folder = dataContent.usingUser(adminUserModel).usingSite(siteModel).createFolder(); + restClient.authenticateUser(userModel).withCoreAPI().usingResource(folder).rateStarsToDocument(3); + restClient.authenticateUser(userModel).withCoreAPI().usingResource(folder).deleteFiveStarRating(); + restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(folder).likeDocument(); + restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(folder).deleteLikeRating(); + + returnedRatingModel = restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(folder).getFiveStarRating(); + returnedRatingModel.assertThat().field("id").is("fiveStar").getAggregate().assertThat().field("numberOfRatings").is("0") + .assertThat().field("average").isNull(); + + returnedRatingModel = restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(folder).getLikeRating(); + returnedRatingModel.assertThat().field("id").is("likes").assertThat().field("myRating").isNull() + .getAggregate().assertThat().field("numberOfRatings").is("0"); + } + + @TestRail(section = { TestGroup.REST_API, TestGroup.RATINGS }, executionType = ExecutionType.REGRESSION, + description = "Get rating of a file after rating was deleted") + @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.FULL }) + public void getDeletedRatingOfAFile() throws Exception + { + FileModel file = dataContent.usingUser(adminUserModel).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN); + restClient.authenticateUser(userModel).withCoreAPI().usingResource(file).rateStarsToDocument(3); + restClient.authenticateUser(userModel).withCoreAPI().usingResource(file).deleteFiveStarRating(); + restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(file).likeDocument(); + restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(file).deleteLikeRating(); + + returnedRatingModel = restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(file).getFiveStarRating(); + returnedRatingModel.assertThat().field("id").is("fiveStar").getAggregate().assertThat().field("numberOfRatings").is("0") + .assertThat().field("average").isNull(); + + returnedRatingModel = restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(file).getLikeRating(); + returnedRatingModel.assertThat().field("id").is("likes").assertThat().field("myRating").isNull() + .getAggregate().assertThat().field("numberOfRatings").is("0"); + } + + @TestRail(section = { TestGroup.REST_API, TestGroup.RATINGS }, executionType = ExecutionType.REGRESSION, + description = "Get rating of another user as admin") + @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.FULL }) + public void getRatingOfAnotherUserAsAdmin() throws Exception + { + FileModel file = dataContent.usingUser(adminUserModel).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN); + restClient.authenticateUser(userModel).withCoreAPI().usingResource(file).rateStarsToDocument(3); + restClient.authenticateUser(userModel).withCoreAPI().usingResource(file).likeDocument(); + + returnedRatingModel = restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(file).getFiveStarRating(); + returnedRatingModel.assertThat().field("id").is("fiveStar").and().field("myRating").isNull() + .getAggregate().assertThat().field("numberOfRatings").is("1").assertThat().field("average").is("3.0"); + + returnedRatingModel = restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(file).getLikeRating(); + returnedRatingModel.assertThat().field("id").is("likes").assertThat().field("myRating").isNull() + .getAggregate().assertThat().field("numberOfRatings").is("1"); + } + + @TestRail(section = { TestGroup.REST_API, TestGroup.RATINGS }, executionType = ExecutionType.REGRESSION, + description = "Get rating of admin with another user") + @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.FULL }) + public void getRatingOfAdminWithAnotherUser() throws Exception + { + FileModel file = dataContent.usingUser(userModel).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN); + restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(file).rateStarsToDocument(3); + restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(file).likeDocument(); + + returnedRatingModel = restClient.authenticateUser(userModel).withCoreAPI().usingResource(file).getFiveStarRating(); + returnedRatingModel.assertThat().field("id").is("fiveStar").and().field("myRating").isNull() + .getAggregate().assertThat().field("numberOfRatings").is("1").assertThat().field("average").is("3.0"); + + returnedRatingModel = restClient.authenticateUser(userModel).withCoreAPI().usingResource(file).getLikeRating(); + returnedRatingModel.assertThat().field("id").is("likes").assertThat().field("myRating").isNull() + .getAggregate().assertThat().field("numberOfRatings").is("1"); + } + + @TestRail(section = { TestGroup.REST_API, TestGroup.RATINGS }, executionType = ExecutionType.REGRESSION, description = "Get five star rating") + @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.FULL }) + public void getFiveStarRating() throws Exception + { + FileModel file = dataContent.usingUser(userModel).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN); + restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(file).rateStarsToDocument(5); + + returnedRatingModel = restClient.authenticateUser(userModel).withCoreAPI().usingResource(file).getFiveStarRating(); + returnedRatingModel.assertThat().field("id").is("fiveStar").and().field("myRating").isNull() + .getAggregate().assertThat().field("numberOfRatings").is("1").assertThat().field("average").is("5.0"); + } + + @TestRail(section = { TestGroup.REST_API, TestGroup.RATINGS }, executionType = ExecutionType.REGRESSION, description = "Get one star rating") + @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.FULL }) + public void getOneStarRating() throws Exception + { + FileModel file = dataContent.usingUser(userModel).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN); + restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(file).rateStarsToDocument(1); + + returnedRatingModel = restClient.authenticateUser(userModel).withCoreAPI().usingResource(file).getFiveStarRating(); + returnedRatingModel.assertThat().field("id").is("fiveStar").and().field("myRating").isNull() + .getAggregate().assertThat().field("numberOfRatings").is("1").assertThat().field("average").is("1.0"); + } +} \ No newline at end of file diff --git a/e2e-test/java/org/alfresco/rest/ratings/GetRatingSanityTests.java b/e2e-test/java/org/alfresco/rest/ratings/GetRatingSanityTests.java index 5ddddd6df..dc9d23178 100644 --- a/e2e-test/java/org/alfresco/rest/ratings/GetRatingSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/ratings/GetRatingSanityTests.java @@ -151,7 +151,7 @@ public class GetRatingSanityTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.RATINGS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to retrieve rating of a document") @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.SANITY }) - @Bug(id = "MNT-16904") + @Bug(id = "MNT-16904", description = "It fails only on environment with tenants") public void unauthenticatedUserIsNotAbleToRetrieveRating() throws Exception { FolderModel folderModel = dataContent.usingUser(adminUser).usingSite(siteModel).createFolder(); diff --git a/e2e-test/java/org/alfresco/rest/ratings/GetRatingsSanityTests.java b/e2e-test/java/org/alfresco/rest/ratings/GetRatingsSanityTests.java index 0c07f6419..a973d37c5 100644 --- a/e2e-test/java/org/alfresco/rest/ratings/GetRatingsSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/ratings/GetRatingsSanityTests.java @@ -131,7 +131,7 @@ public class GetRatingsSanityTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.RATINGS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to retrieve document ratings") @Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.SANITY }) - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void unauthenticatedUserIsNotAbleToRetrieveRatings() throws Exception { FolderModel folderModel = dataContent.usingUser(adminUser).usingSite(siteModel).createFolder(); diff --git a/e2e-test/java/org/alfresco/rest/sites/AddSiteMemberSanityTests.java b/e2e-test/java/org/alfresco/rest/sites/AddSiteMemberSanityTests.java index a99b7713e..3bfb390e1 100644 --- a/e2e-test/java/org/alfresco/rest/sites/AddSiteMemberSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/sites/AddSiteMemberSanityTests.java @@ -105,7 +105,7 @@ public class AddSiteMemberSanityTests extends RestTest @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY }) @TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, description = "Verify that unauthenticated user is not able to add site member") - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void unauthenticatedUserIsNotAuthorizedToAddSiteMmeber() throws Exception{ UserModel testUser = dataUser.createRandomTestUser("testUser"); testUser.setUserRole(UserRole.SiteConsumer); diff --git a/e2e-test/java/org/alfresco/rest/sites/GetSiteContainersSanityTests.java b/e2e-test/java/org/alfresco/rest/sites/GetSiteContainersSanityTests.java index 775947145..1de49a617 100644 --- a/e2e-test/java/org/alfresco/rest/sites/GetSiteContainersSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/sites/GetSiteContainersSanityTests.java @@ -101,7 +101,7 @@ public class GetSiteContainersSanityTests extends RestTest @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY }) @TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, description = "Failed authentication get site containers call returns status code 401 with Manager role") - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void unauthenticatedUserIsNotAuthorizedToRetrieveSiteContainers() throws JsonToModelConversionException, Exception { userModel = dataUser.createRandomTestUser(); diff --git a/e2e-test/java/org/alfresco/rest/sites/GetSiteMemberSanityTests.java b/e2e-test/java/org/alfresco/rest/sites/GetSiteMemberSanityTests.java index 046721e56..8a3348955 100644 --- a/e2e-test/java/org/alfresco/rest/sites/GetSiteMemberSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/sites/GetSiteMemberSanityTests.java @@ -100,7 +100,7 @@ public class GetSiteMemberSanityTests extends RestTest @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY }) @TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, description = "Failed authentication get site member call returns status code 401") - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void unauthenticatedUserIsNotAuthorizedToRetrieveSiteMember() throws JsonToModelConversionException, Exception { UserModel inexistentUser = new UserModel("inexistent user", "inexistent password"); diff --git a/e2e-test/java/org/alfresco/rest/sites/GetSiteMembersSanityTests.java b/e2e-test/java/org/alfresco/rest/sites/GetSiteMembersSanityTests.java index 4b2cf6c80..3c152678e 100644 --- a/e2e-test/java/org/alfresco/rest/sites/GetSiteMembersSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/sites/GetSiteMembersSanityTests.java @@ -97,7 +97,7 @@ public class GetSiteMembersSanityTests extends RestTest @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY }) @TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, description = "Failed authentication get site members call returns status code 401") - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void unauthenticatedUserIsNotAuthorizedToRetrieveSiteMembers() throws JsonToModelConversionException, Exception { userModel = dataUser.createRandomTestUser(); diff --git a/e2e-test/java/org/alfresco/rest/sites/GetSiteSanityTests.java b/e2e-test/java/org/alfresco/rest/sites/GetSiteSanityTests.java index b5813979e..8c8c5f4e1 100644 --- a/e2e-test/java/org/alfresco/rest/sites/GetSiteSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/sites/GetSiteSanityTests.java @@ -105,7 +105,7 @@ public class GetSiteSanityTests extends RestTest @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY }) @TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, description = "Failed authentication get site call returns status code 401") - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void unauthenticatedUserIsNotAuthorizedToRetrieveSite() throws JsonToModelConversionException, Exception { userModel = dataUser.createRandomTestUser(); diff --git a/e2e-test/java/org/alfresco/rest/sites/GetSitesSanityTests.java b/e2e-test/java/org/alfresco/rest/sites/GetSitesSanityTests.java index 12792a552..377b383e6 100644 --- a/e2e-test/java/org/alfresco/rest/sites/GetSitesSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/sites/GetSitesSanityTests.java @@ -102,7 +102,7 @@ public class GetSitesSanityTests extends RestTest @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY }) @TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, description = "Failed authentication get sites call returns status code 401") - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void unauthenticatedUserIsNotAuthorizedToRetrieveSites() throws JsonToModelConversionException, Exception { restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager)); diff --git a/e2e-test/java/org/alfresco/rest/sites/RemoveSiteMemberSanityTests.java b/e2e-test/java/org/alfresco/rest/sites/RemoveSiteMemberSanityTests.java index a1395a62e..0d412043d 100644 --- a/e2e-test/java/org/alfresco/rest/sites/RemoveSiteMemberSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/sites/RemoveSiteMemberSanityTests.java @@ -117,7 +117,7 @@ public class RemoveSiteMemberSanityTests extends RestTest @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY }) @TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, description = "Verify that unauthenticated user is not able to delete site member") - @Bug(id = "MNT-16904") + @Bug(id = "MNT-16904", description = "It fails only on environment with tenants") public void unauthenticatedUserIsNotAuthorizedToDeleteSiteMember() throws Exception { UserModel testUserModel = dataUser.createRandomTestUser(); diff --git a/e2e-test/java/org/alfresco/rest/sites/UpdateSiteMemberSanityTests.java b/e2e-test/java/org/alfresco/rest/sites/UpdateSiteMemberSanityTests.java index f924eb71a..724fb236f 100644 --- a/e2e-test/java/org/alfresco/rest/sites/UpdateSiteMemberSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/sites/UpdateSiteMemberSanityTests.java @@ -103,7 +103,7 @@ public class UpdateSiteMemberSanityTests extends RestTest @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY }) @TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, description = "Verify that unauthenticated user is not able to update site member") - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void unauthenticatedUserIsNotAuthorizedToUpdateSiteMmeber() throws Exception{ UserModel inexistentUser = new UserModel("inexistent user", "inexistent password"); restClient.authenticateUser(inexistentUser); diff --git a/e2e-test/java/org/alfresco/rest/tags/AddTagSanityTests.java b/e2e-test/java/org/alfresco/rest/tags/AddTagSanityTests.java index 84e2d8f10..8de6c31e0 100644 --- a/e2e-test/java/org/alfresco/rest/tags/AddTagSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/tags/AddTagSanityTests.java @@ -121,7 +121,7 @@ public class AddTagSanityTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails") @Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY }) - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void userIsNotAbleToAddTagIfAuthenticationFails() throws JsonToModelConversionException, Exception { UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager); diff --git a/e2e-test/java/org/alfresco/rest/tags/AddTagsSanityTests.java b/e2e-test/java/org/alfresco/rest/tags/AddTagsSanityTests.java index 712715ee2..8ab6b4cbf 100644 --- a/e2e-test/java/org/alfresco/rest/tags/AddTagsSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/tags/AddTagsSanityTests.java @@ -120,7 +120,7 @@ public class AddTagsSanityTests extends RestTest @TestRail(section = { TestGroup.REST_API,TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails") @Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY }) - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void userIsNotAbleToAddTagsIfAuthenticationFails() throws JsonToModelConversionException, Exception { UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager); diff --git a/e2e-test/java/org/alfresco/rest/tags/DeleteTagSanityTests.java b/e2e-test/java/org/alfresco/rest/tags/DeleteTagSanityTests.java index 963cf13ad..b6df9ce7d 100644 --- a/e2e-test/java/org/alfresco/rest/tags/DeleteTagSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/tags/DeleteTagSanityTests.java @@ -120,7 +120,7 @@ public class DeleteTagSanityTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails") @Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY }) - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void userIsNotAbleToDeleteTagIfAuthenticationFails() throws JsonToModelConversionException, Exception { restClient.authenticateUser(adminUserModel); diff --git a/e2e-test/java/org/alfresco/rest/tags/GetNodeTagsSanityTests.java b/e2e-test/java/org/alfresco/rest/tags/GetNodeTagsSanityTests.java index 9c2545c73..82584e862 100644 --- a/e2e-test/java/org/alfresco/rest/tags/GetNodeTagsSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/tags/GetNodeTagsSanityTests.java @@ -12,6 +12,7 @@ import org.alfresco.utility.model.FileModel; import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.model.UserModel; +import org.alfresco.utility.report.Bug; import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.annotation.TestRail; import org.springframework.http.HttpStatus; @@ -119,7 +120,7 @@ public class GetNodeTagsSanityTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user is not able to get node tags") @Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY }) -// @Bug(id="MNT-16904") + @Bug(id = "MNT-16904", description = "fails only on environment with tenants") public void unauthenticatedUserIsNotAbleToRetrieveNodeTags() throws JsonToModelConversionException, Exception { restClient.authenticateUser(new UserModel("random user", "random password")); diff --git a/e2e-test/java/org/alfresco/rest/tags/GetTagSanityTests.java b/e2e-test/java/org/alfresco/rest/tags/GetTagSanityTests.java index 62122f44e..72dd369cd 100644 --- a/e2e-test/java/org/alfresco/rest/tags/GetTagSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/tags/GetTagSanityTests.java @@ -109,7 +109,7 @@ public class GetTagSanityTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify Manager user gets status code 401 if authentication call fails") @Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY }) - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void managerIsNotAbleToGetTagIfAuthenticationFails() throws JsonToModelConversionException, Exception { String tagValue = RandomData.getRandomName("tag"); diff --git a/e2e-test/java/org/alfresco/rest/tags/GetTagsSanityTests.java b/e2e-test/java/org/alfresco/rest/tags/GetTagsSanityTests.java index df502158e..f11250c23 100644 --- a/e2e-test/java/org/alfresco/rest/tags/GetTagsSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/tags/GetTagsSanityTests.java @@ -110,7 +110,7 @@ public class GetTagsSanityTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Failed authentication get tags call returns status code 401 with Manager role") @Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY }) - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void failedAuthenticationReturnsUnauthorizedStatus() throws JsonToModelConversionException, Exception { restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager)); diff --git a/e2e-test/java/org/alfresco/rest/tags/UpdateTagSanityTests.java b/e2e-test/java/org/alfresco/rest/tags/UpdateTagSanityTests.java index 442e24e10..567148d6c 100644 --- a/e2e-test/java/org/alfresco/rest/tags/UpdateTagSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/tags/UpdateTagSanityTests.java @@ -104,7 +104,7 @@ public class UpdateTagSanityTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails") @Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY }) - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void userIsNotAbleToUpdateTagIfAuthenticationFails() throws JsonToModelConversionException, Exception { UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager); diff --git a/e2e-test/java/org/alfresco/rest/workflow/tasks/DeleteTaskVariableCoreTests.java b/e2e-test/java/org/alfresco/rest/workflow/tasks/DeleteTaskVariableCoreTests.java index 3cb14acf9..00b28faf6 100644 --- a/e2e-test/java/org/alfresco/rest/workflow/tasks/DeleteTaskVariableCoreTests.java +++ b/e2e-test/java/org/alfresco/rest/workflow/tasks/DeleteTaskVariableCoreTests.java @@ -111,7 +111,7 @@ public class DeleteTaskVariableCoreTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION, description = "Delete task variable by inexistent user") @Test(groups = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.CORE }) - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void deleteTaskVarialbleByInexistentUser() throws Exception { RestVariableModel variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text"); diff --git a/e2e-test/java/org/alfresco/rest/workflow/tasks/RemoveTaskItemCoreTests.java b/e2e-test/java/org/alfresco/rest/workflow/tasks/RemoveTaskItemCoreTests.java index 462d8e477..6cf8bba17 100644 --- a/e2e-test/java/org/alfresco/rest/workflow/tasks/RemoveTaskItemCoreTests.java +++ b/e2e-test/java/org/alfresco/rest/workflow/tasks/RemoveTaskItemCoreTests.java @@ -122,7 +122,7 @@ public class RemoveTaskItemCoreTests extends RestTest @TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION, description = "Delete existing task item with inexistent user") @Test(groups = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.CORE }) - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void deleteTaskItemWithInexistentUser() throws Exception { taskModel = dataWorkflow.usingUser(userWhoStartsTask).usingSite(siteModel).usingResource(fileModel).createNewTaskAndAssignTo(assigneeUser); diff --git a/e2e-test/java/org/alfresco/rest/workflow/tasks/UpdateTaskVariableCoreTests.java b/e2e-test/java/org/alfresco/rest/workflow/tasks/UpdateTaskVariableCoreTests.java index e38d7ea47..883f78e74 100644 --- a/e2e-test/java/org/alfresco/rest/workflow/tasks/UpdateTaskVariableCoreTests.java +++ b/e2e-test/java/org/alfresco/rest/workflow/tasks/UpdateTaskVariableCoreTests.java @@ -157,7 +157,7 @@ public class UpdateTaskVariableCoreTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION, description = "Update task variable by inexistent user") @Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.CORE }) - @Bug(id="MNT-16904") + @Bug(id="MNT-16904", description = "It fails only on environment with tenants") public void updateTaskVariableByInexistentser() throws Exception { variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text"); diff --git a/e2e-test/resources/default.properties b/e2e-test/resources/default.properties index 460444321..2e4c58893 100644 --- a/e2e-test/resources/default.properties +++ b/e2e-test/resources/default.properties @@ -1,70 +1,71 @@ -# dataprep related -alfresco.scheme=http -alfresco.server=localhost -alfresco.port=8080 - -# in containers we cannot access directly JMX, so we will use http://jolokia.org agent -# disabling this we will use direct JMX calls to server -jmx.useJolokiaAgent=false - -# credentials -admin.user=admin -admin.password=admin - -# TEST MANAGEMENT SECTION - Test Rail -# -# (currently supporting Test Rail v5.2.1.3472 integration) -# -# Example of configuration: -# ------------------------------------------------------ -# if testManagement.enabled=true we enabled TestRailExecutorListener (if used in your suite xml file) -# testManagement.updateTestExecutionResultsOnly=true (this will just update the results of a test: no step will be updated - good for performance) -# testManagement.endPoint=https://alfresco.testrail.com/ -# testManagement.username= -# testManagement.apiKey= -# testManagement.project= -# testManagement.includeOnlyTestCasesExecuted=false #if you want to include in your run ONLY the test cases that you run, then set this value to false -# testManagement.rateLimitInSeconds=1 #is the default rate limit after what minimum time, should we upload the next request. http://docs.gurock.com/testrail-api2/introduction #Rate Limit -# testManagement.suiteId=23 (the id of the Master suite) -# ------------------------------------------------------ -testManagement.enabled=true -testManagement.endPoint=https://alfresco.testrail.com/ -testManagement.username=tas.alfresco@gmail.com -testManagement.apiKey=EYpY7.fV0AoMGWbmyuVC-k5u.nzwHy6a.QWzJq8.S -testManagement.project=7 -testManagement.includeOnlyTestCasesExecuted=true -testManagement.rateLimitInSeconds=1 -testManagement.testRun=MyTestRunInTestRail -testManagement.suiteId=12 - -# The location of the reports path -reports.path=./target/reports - -# -# Database Section -# You should provide here the database URL, that can be a differed server as alfresco. -# https://docs.oracle.com/javase/tutorial/jdbc/basics/connecting.html -# -# Current supported db.url: -# -# MySQL: -# db.url = jdbc:mysql://${alfresco.server}:3306/alfresco -# -# PostgreSQL: -# db.url = jdbc:postgresql://:3306/alfresco -# -# Oracle: -# db.url = jdbc:oracle://:3306/alfresco -# -# MariaDB: -# db.url = jdbc:mariadb://:3306/alfresco -# -db.url = jdbc:mysql://${alfresco.server}:3306/alfresco -db.username = alfresco -db.password = alfresco - -# Server Health section -# in ServerHealth#isServerReachable() - could also be shown. -# enable this option to view if on server there are tenants or not -serverHealth.showTenants=true +# dataprep related +alfresco.scheme=http +alfresco.server=localhost +alfresco.port=8080 + +# credentials +admin.user=admin +admin.password=admin + +# in containers we cannot access directly JMX, so we will use http://jolokia.org agent +# disabling this we will use direct JMX calls to server +jmx.useJolokiaAgent=false + +# Server Health section +# in ServerHealth#isServerReachable() - could also be shown. +# enable this option to view if on server there are tenants or not +serverHealth.showTenants=true + +# TEST MANAGEMENT SECTION - Test Rail +# +# (currently supporting Test Rail v5.2.1.3472 integration) +# +# Example of configuration: +# ------------------------------------------------------ +# if testManagement.enabled=true we enabled TestRailExecutorListener (if used in your suite xml file) +# testManagement.updateTestExecutionResultsOnly=true (this will just update the results of a test: no step will be updated - good for performance) +# testManagement.endPoint=https://alfresco.testrail.com/ +# testManagement.username= +# testManagement.apiKey= +# testManagement.project= +# testManagement.includeOnlyTestCasesExecuted=true #if you want to include in your run ONLY the test cases that you run, then set this value to false +# testManagement.rateLimitInSeconds=1 #is the default rate limit after what minimum time, should we upload the next request. http://docs.gurock.com/testrail-api2/introduction #Rate Limit +# testManagement.suiteId=23 (the id of the Master suite) +# ------------------------------------------------------ +testManagement.enabled=false +testManagement.endPoint=https://alfresco.testrail.com/ +testManagement.username=tas.alfresco@gmail.com +testManagement.apiKey=EYpY7.fV0AoMGWbmyuVC-k5u.nzwHy6a.QWzJq8.S +testManagement.project=7 +testManagement.includeOnlyTestCasesExecuted=true +testManagement.rateLimitInSeconds=1 +testManagement.testRun=MyTestRunInTestRail +testManagement.suiteId=12 + +# The location of the reports path +reports.path=./target/reports + +# +# Database Section +# You should provide here the database URL, that can be a differed server as alfresco. +# https://docs.oracle.com/javase/tutorial/jdbc/basics/connecting.html +# +# Current supported db.url: +# +# MySQL: +# db.url = jdbc:mysql://${alfresco.server}:3306/alfresco +# +# PostgreSQL: +# db.url = jdbc:postgresql://:3306/alfresco +# +# Oracle: +# db.url = jdbc:oracle://:3306/alfresco +# +# MariaDB: +# db.url = jdbc:mariadb://:3306/alfresco +# +db.url = jdbc:mysql://${alfresco.server}:3306/alfresco +db.username = alfresco +db.password = alfresco +