From 8e49b9108b1902d49661e3f53108579fc7324568 Mon Sep 17 00:00:00 2001 From: Iulia Nechita Date: Tue, 27 Sep 2016 16:14:23 +0300 Subject: [PATCH 01/21] TAS-848 getSites with Manager role --- .../java/org/alfresco/rest/GetSitesTests.java | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 e2e-test/java/org/alfresco/rest/GetSitesTests.java diff --git a/e2e-test/java/org/alfresco/rest/GetSitesTests.java b/e2e-test/java/org/alfresco/rest/GetSitesTests.java new file mode 100644 index 000000000..1c95115f5 --- /dev/null +++ b/e2e-test/java/org/alfresco/rest/GetSitesTests.java @@ -0,0 +1,59 @@ +package org.alfresco.rest; + +import java.util.Arrays; +import java.util.HashMap; + +import org.alfresco.rest.exception.JsonToModelConversionException; +import org.alfresco.rest.requests.RestSitesApi; +import org.alfresco.utility.data.DataSite; +import org.alfresco.utility.data.DataUser; +import org.alfresco.utility.data.UserRole; +import org.alfresco.utility.model.SiteModel; +import org.alfresco.utility.model.UserModel; +import org.alfresco.utility.testrail.ExecutionType; +import org.alfresco.utility.testrail.annotation.TestRail; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +/** + * @author iulia.cojocea + */ +@Test(groups = { "rest-api", "comments", "sanity" }) +public class GetSitesTests extends RestTest +{ + @Autowired + RestSitesApi siteAPI; + + @Autowired + DataUser dataUser; + + @Autowired + DataSite dataSite; + + private UserModel adminUserModel; + private HashMap usersWithRoles; + private SiteModel siteModel; + + @BeforeClass + public void initTest() throws Exception + { + adminUserModel = dataUser.getAdminUser(); + restClient.authenticateUser(adminUserModel); + siteAPI.useRestClient(restClient); + siteModel = dataSite.usingUser(adminUserModel).createPublicRandomSite(); + usersWithRoles = dataUser.addUsersWithRolesToSite(siteModel, + Arrays.asList(UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor)); + + } + + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, description = "Verify user with Manager role gets sites information and gets status code OK (200)") + public void getSitesWithManagerRole() throws JsonToModelConversionException, Exception + { + + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteManager)); + siteAPI.getAllSites(); + siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } +} From 2c640e1e703d6b3f1ac3a0872bb29c6c1e6d1e06 Mon Sep 17 00:00:00 2001 From: Iulia Nechita Date: Tue, 27 Sep 2016 16:16:31 +0300 Subject: [PATCH 02/21] TAS-849 getSite with Collaborator role --- e2e-test/java/org/alfresco/rest/GetSitesTests.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/e2e-test/java/org/alfresco/rest/GetSitesTests.java b/e2e-test/java/org/alfresco/rest/GetSitesTests.java index 1c95115f5..6fbaf5098 100644 --- a/e2e-test/java/org/alfresco/rest/GetSitesTests.java +++ b/e2e-test/java/org/alfresco/rest/GetSitesTests.java @@ -56,4 +56,13 @@ public class GetSitesTests extends RestTest siteAPI.getAllSites(); siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } + + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, description = "Verify user with Collaborator role gets sites information and gets status code OK (200)") + public void getSitesWithCollaboratorRole() throws JsonToModelConversionException, Exception + { + + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteCollaborator)); + siteAPI.getAllSites(); + siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } } From 06822847703ffd8ca352402ca3e2b671a777d073 Mon Sep 17 00:00:00 2001 From: Iulia Nechita Date: Tue, 27 Sep 2016 16:17:27 +0300 Subject: [PATCH 03/21] TAS-858 getSites with Contributor role --- e2e-test/java/org/alfresco/rest/GetSitesTests.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/e2e-test/java/org/alfresco/rest/GetSitesTests.java b/e2e-test/java/org/alfresco/rest/GetSitesTests.java index 6fbaf5098..3415133c1 100644 --- a/e2e-test/java/org/alfresco/rest/GetSitesTests.java +++ b/e2e-test/java/org/alfresco/rest/GetSitesTests.java @@ -65,4 +65,13 @@ public class GetSitesTests extends RestTest siteAPI.getAllSites(); siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } + + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, description = "Verify user with Contributor role gets sites information and gets status code OK (200)") + public void getSitesWithContributorRole() throws JsonToModelConversionException, Exception + { + + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteContributor)); + siteAPI.getAllSites(); + siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } } From c74603a8193253f4da220c522b1da6a95d5bfa38 Mon Sep 17 00:00:00 2001 From: Iulia Nechita Date: Tue, 27 Sep 2016 16:19:36 +0300 Subject: [PATCH 04/21] TAS-859 getSites with Consumer role --- e2e-test/java/org/alfresco/rest/GetSitesTests.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/e2e-test/java/org/alfresco/rest/GetSitesTests.java b/e2e-test/java/org/alfresco/rest/GetSitesTests.java index 3415133c1..2f24eb52f 100644 --- a/e2e-test/java/org/alfresco/rest/GetSitesTests.java +++ b/e2e-test/java/org/alfresco/rest/GetSitesTests.java @@ -74,4 +74,13 @@ public class GetSitesTests extends RestTest siteAPI.getAllSites(); siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } + + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, description = "Verify user with Consumer role gets sites information and gets status code OK (200)") + public void getSitesWithConsumerRole() throws JsonToModelConversionException, Exception + { + + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteConsumer)); + siteAPI.getAllSites(); + siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } } From 7441b807cb0c8adebcc1d95c28082afe4d9c686a Mon Sep 17 00:00:00 2001 From: Iulia Nechita Date: Tue, 27 Sep 2016 16:20:23 +0300 Subject: [PATCH 05/21] TAS-860 getSites with admin user --- e2e-test/java/org/alfresco/rest/GetSitesTests.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/e2e-test/java/org/alfresco/rest/GetSitesTests.java b/e2e-test/java/org/alfresco/rest/GetSitesTests.java index 2f24eb52f..d2d3020e7 100644 --- a/e2e-test/java/org/alfresco/rest/GetSitesTests.java +++ b/e2e-test/java/org/alfresco/rest/GetSitesTests.java @@ -83,4 +83,12 @@ public class GetSitesTests extends RestTest siteAPI.getAllSites(); siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } + + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, description = "Verify user with Admin user gets sites information and gets status code OK (200)") + public void getSitesWithAdminUser() throws JsonToModelConversionException, Exception + { + restClient.authenticateUser(adminUserModel); + siteAPI.getAllSites(); + siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } } From 67b46759a22a1e01e3d1eb54c466eb1f866d7f0f Mon Sep 17 00:00:00 2001 From: Cristina Jalba Date: Tue, 27 Sep 2016 16:29:54 +0300 Subject: [PATCH 06/21] TAS-856 getComment with admin --- .../org/alfresco/rest/GetCommentsTest.java | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 e2e-test/java/org/alfresco/rest/GetCommentsTest.java diff --git a/e2e-test/java/org/alfresco/rest/GetCommentsTest.java b/e2e-test/java/org/alfresco/rest/GetCommentsTest.java new file mode 100644 index 000000000..186f16613 --- /dev/null +++ b/e2e-test/java/org/alfresco/rest/GetCommentsTest.java @@ -0,0 +1,50 @@ +package org.alfresco.rest; + +import org.alfresco.dataprep.CMISUtil.DocumentType; +import org.alfresco.rest.exception.JsonToModelConversionException; +import org.alfresco.rest.requests.RestCommentsApi; +import org.alfresco.utility.data.DataUser; +import org.alfresco.utility.model.FileModel; +import org.alfresco.utility.model.SiteModel; +import org.alfresco.utility.model.UserModel; +import org.alfresco.utility.testrail.ExecutionType; +import org.alfresco.utility.testrail.annotation.TestRail; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +@Test(groups = { "rest-api", "comments", "sanity" }) +public class GetCommentsTest extends RestTest +{ + @Autowired + RestCommentsApi commentsAPI; + + @Autowired + DataUser dataUser; + + private UserModel adminUserModel; + + private FileModel document; + private SiteModel siteModel; + + @BeforeClass + public void initTest() throws Exception + { + adminUserModel = dataUser.getAdminUser(); + restClient.authenticateUser(adminUserModel); + siteModel = dataSite.usingUser(adminUserModel).createPublicRandomSite(); + commentsAPI.useRestClient(restClient); + document = dataContent.usingSite(siteModel).usingUser(adminUserModel).createContent(DocumentType.TEXT_PLAIN); + commentsAPI.addComment(document.getNodeRef(), "This is a new comment"); + } + + @TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY, + description= "Verify Admin user gets comments with Rest API and status code is 200") + public void adminIsAbleToRetrieveComments() throws JsonToModelConversionException, Exception + { + commentsAPI.getNodeComments(document.getNodeRef()); + commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } + +} From e54d1c7f87176187d7f50f477b6d663e833f0d40 Mon Sep 17 00:00:00 2001 From: Cristina Jalba Date: Tue, 27 Sep 2016 16:32:31 +0300 Subject: [PATCH 07/21] TAS-851 getComment with Manager --- .../java/org/alfresco/rest/GetCommentsTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/e2e-test/java/org/alfresco/rest/GetCommentsTest.java b/e2e-test/java/org/alfresco/rest/GetCommentsTest.java index 186f16613..5e576a038 100644 --- a/e2e-test/java/org/alfresco/rest/GetCommentsTest.java +++ b/e2e-test/java/org/alfresco/rest/GetCommentsTest.java @@ -1,9 +1,13 @@ package org.alfresco.rest; +import java.util.Arrays; +import java.util.HashMap; + import org.alfresco.dataprep.CMISUtil.DocumentType; import org.alfresco.rest.exception.JsonToModelConversionException; import org.alfresco.rest.requests.RestCommentsApi; import org.alfresco.utility.data.DataUser; +import org.alfresco.utility.data.UserRole; import org.alfresco.utility.model.FileModel; import org.alfresco.utility.model.SiteModel; import org.alfresco.utility.model.UserModel; @@ -27,6 +31,7 @@ public class GetCommentsTest extends RestTest private FileModel document; private SiteModel siteModel; + private HashMap usersWithRoles; @BeforeClass public void initTest() throws Exception @@ -37,6 +42,8 @@ public class GetCommentsTest extends RestTest commentsAPI.useRestClient(restClient); document = dataContent.usingSite(siteModel).usingUser(adminUserModel).createContent(DocumentType.TEXT_PLAIN); commentsAPI.addComment(document.getNodeRef(), "This is a new comment"); + + usersWithRoles = dataUser.addUsersWithRolesToSite(siteModel, Arrays.asList(UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor)); } @TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY, @@ -47,4 +54,12 @@ public class GetCommentsTest extends RestTest commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } + @TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY, + description= "Verify Manager user gets comments created by admin user with Rest API and status code is 200") + public void managerIsAbleToRetrieveComments() throws JsonToModelConversionException, Exception + { + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteManager)); + commentsAPI.getNodeComments(document.getNodeRef()); + commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } } From c0b4eadab0b2f431bf75d98e2b9b750b24ce24e4 Mon Sep 17 00:00:00 2001 From: Cristina Jalba Date: Tue, 27 Sep 2016 16:34:29 +0300 Subject: [PATCH 08/21] TAS-853 getComment with Contributor --- e2e-test/java/org/alfresco/rest/GetCommentsTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/e2e-test/java/org/alfresco/rest/GetCommentsTest.java b/e2e-test/java/org/alfresco/rest/GetCommentsTest.java index 5e576a038..d7083a61d 100644 --- a/e2e-test/java/org/alfresco/rest/GetCommentsTest.java +++ b/e2e-test/java/org/alfresco/rest/GetCommentsTest.java @@ -62,4 +62,13 @@ public class GetCommentsTest extends RestTest commentsAPI.getNodeComments(document.getNodeRef()); commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } + + @TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY, + description= "Verify Contributor user gets comments created by admin user with Rest API and status code is 200") + public void contributorIsAbleToRetrieveComments() throws JsonToModelConversionException, Exception + { + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteContributor)); + commentsAPI.getNodeComments(document.getNodeRef()); + commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } } From 1f4b9752cea0ed9edd171e95a2798623bb3a19a1 Mon Sep 17 00:00:00 2001 From: Cristina Jalba Date: Tue, 27 Sep 2016 16:35:45 +0300 Subject: [PATCH 09/21] TAS-854 getComment with Collaborator --- e2e-test/java/org/alfresco/rest/GetCommentsTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/e2e-test/java/org/alfresco/rest/GetCommentsTest.java b/e2e-test/java/org/alfresco/rest/GetCommentsTest.java index d7083a61d..8e9aefbe9 100644 --- a/e2e-test/java/org/alfresco/rest/GetCommentsTest.java +++ b/e2e-test/java/org/alfresco/rest/GetCommentsTest.java @@ -71,4 +71,13 @@ public class GetCommentsTest extends RestTest commentsAPI.getNodeComments(document.getNodeRef()); commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } + + @TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY, + description= "Verify Collaborator user gets comments created by admin user with Rest API and status code is 200") + public void collaboratorIsAbleToRetrieveComments() throws JsonToModelConversionException, Exception + { + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteCollaborator)); + commentsAPI.getNodeComments(document.getNodeRef()); + commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } } From 3ac827ccc905a7b3480dd53147a7bc489bc31005 Mon Sep 17 00:00:00 2001 From: Cristina Jalba Date: Tue, 27 Sep 2016 16:36:32 +0300 Subject: [PATCH 10/21] TAS-855 getComment with Consumer --- e2e-test/java/org/alfresco/rest/GetCommentsTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/e2e-test/java/org/alfresco/rest/GetCommentsTest.java b/e2e-test/java/org/alfresco/rest/GetCommentsTest.java index 8e9aefbe9..577066e2a 100644 --- a/e2e-test/java/org/alfresco/rest/GetCommentsTest.java +++ b/e2e-test/java/org/alfresco/rest/GetCommentsTest.java @@ -80,4 +80,13 @@ public class GetCommentsTest extends RestTest commentsAPI.getNodeComments(document.getNodeRef()); commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } + + @TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY, + description= "Verify Consumer user gets comments created by admin user with Rest API and status code is 200") + public void consumerIsAbleToRetrieveComments() throws JsonToModelConversionException, Exception + { + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteConsumer)); + commentsAPI.getNodeComments(document.getNodeRef()); + commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } } From bcf916fe5a1b2caccfcebf7c8a3cadd95f7a6377 Mon Sep 17 00:00:00 2001 From: Cristina Jalba Date: Tue, 27 Sep 2016 16:38:24 +0300 Subject: [PATCH 11/21] TAS-857 failed authentication call returns status code 401 with Manager role --- .../java/org/alfresco/rest/GetCommentsTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/e2e-test/java/org/alfresco/rest/GetCommentsTest.java b/e2e-test/java/org/alfresco/rest/GetCommentsTest.java index 577066e2a..79e2a8315 100644 --- a/e2e-test/java/org/alfresco/rest/GetCommentsTest.java +++ b/e2e-test/java/org/alfresco/rest/GetCommentsTest.java @@ -31,6 +31,7 @@ public class GetCommentsTest extends RestTest private FileModel document; private SiteModel siteModel; + private UserModel userModel; private HashMap usersWithRoles; @BeforeClass @@ -89,4 +90,17 @@ public class GetCommentsTest extends RestTest commentsAPI.getNodeComments(document.getNodeRef()); commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } + + @TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY, + description= "Verify Manager user gets status code 401 if authentication call fails") + public void managerIsNotAbleToRetrieveCommentIfAuthenticationFails() throws JsonToModelConversionException, Exception + { + userModel = usersWithRoles.get(UserRole.SiteManager); + userModel.setPassword("incorrectPassword"); + restClient.authenticateUser(userModel); + commentsAPI.getNodeComments(document.getNodeRef()); + commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.UNAUTHORIZED.toString()); + userModel.setPassword("password"); + restClient.authenticateUser(userModel); + } } From e8a4e73cb66c0337fd89ea5c51efeacea8e28cf1 Mon Sep 17 00:00:00 2001 From: Cristina Jalba Date: Tue, 27 Sep 2016 16:39:22 +0300 Subject: [PATCH 12/21] TAS-863 getComment created by another user --- .../java/org/alfresco/rest/GetCommentsTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/e2e-test/java/org/alfresco/rest/GetCommentsTest.java b/e2e-test/java/org/alfresco/rest/GetCommentsTest.java index 79e2a8315..027cb3db7 100644 --- a/e2e-test/java/org/alfresco/rest/GetCommentsTest.java +++ b/e2e-test/java/org/alfresco/rest/GetCommentsTest.java @@ -103,4 +103,17 @@ public class GetCommentsTest extends RestTest userModel.setPassword("password"); restClient.authenticateUser(userModel); } + + @TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY, + description= "Verify Manager user gets comments created by another user and status code is 200") + public void managerIsAbleToRetrieveCommentsCreatedByAnotherUser() throws JsonToModelConversionException, Exception + { + userModel = usersWithRoles.get(UserRole.SiteCollaborator); + restClient.authenticateUser(userModel); + commentsAPI.addComment(document.getNodeRef(), "This is a new comment added by " + userModel.getUsername()); + commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED.toString()); + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteManager)); + commentsAPI.getNodeComments(document.getNodeRef()); + commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } } From 5c455ecbbb5ef51ec9c3c99b2eac9d8cde06be8c Mon Sep 17 00:00:00 2001 From: Cristina Jalba Date: Tue, 27 Sep 2016 16:40:12 +0300 Subject: [PATCH 13/21] TAS-864 admin gets comment created by another user --- .../java/org/alfresco/rest/GetCommentsTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/e2e-test/java/org/alfresco/rest/GetCommentsTest.java b/e2e-test/java/org/alfresco/rest/GetCommentsTest.java index 027cb3db7..15ed3ca25 100644 --- a/e2e-test/java/org/alfresco/rest/GetCommentsTest.java +++ b/e2e-test/java/org/alfresco/rest/GetCommentsTest.java @@ -116,4 +116,17 @@ public class GetCommentsTest extends RestTest commentsAPI.getNodeComments(document.getNodeRef()); commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } + + @TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY, + description= "Verify admin user gets comments created by another user and status code is 200") + public void adminIsAbleToRetrieveCommentsCreatedByAnotherUser() throws JsonToModelConversionException, Exception + { + userModel = usersWithRoles.get(UserRole.SiteCollaborator); + restClient.authenticateUser(userModel); + commentsAPI.addComment(document.getNodeRef(), "This is a new comment added by " + userModel.getUsername()); + commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED.toString()); + restClient.authenticateUser(adminUserModel); + commentsAPI.getNodeComments(document.getNodeRef()); + commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } } From 5fe8c016e84c8288021df9162ed154713576b78f Mon Sep 17 00:00:00 2001 From: Iulia Nechita Date: Tue, 27 Sep 2016 16:49:08 +0300 Subject: [PATCH 14/21] TAS-893 getSite with Manager role --- .../java/org/alfresco/rest/GetSiteTests.java | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 e2e-test/java/org/alfresco/rest/GetSiteTests.java diff --git a/e2e-test/java/org/alfresco/rest/GetSiteTests.java b/e2e-test/java/org/alfresco/rest/GetSiteTests.java new file mode 100644 index 000000000..48b4226ed --- /dev/null +++ b/e2e-test/java/org/alfresco/rest/GetSiteTests.java @@ -0,0 +1,61 @@ +package org.alfresco.rest; + +import java.util.Arrays; +import java.util.HashMap; + +import org.alfresco.rest.exception.JsonToModelConversionException; +import org.alfresco.rest.requests.RestSitesApi; +import org.alfresco.utility.data.DataSite; +import org.alfresco.utility.data.DataUser; +import org.alfresco.utility.data.UserRole; +import org.alfresco.utility.exception.DataPreparationException; +import org.alfresco.utility.model.SiteModel; +import org.alfresco.utility.model.UserModel; +import org.alfresco.utility.testrail.ExecutionType; +import org.alfresco.utility.testrail.annotation.TestRail; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +/** + * @author iulia.cojocea + */ + +@Test(groups = { "rest-api", "sites", "sanity" }) +public class GetSiteTests extends RestTest +{ + + @Autowired + DataUser dataUser; + + @Autowired + RestSitesApi siteAPI; + + @Autowired + DataSite dataSite; + + private UserModel adminUserModel; + private HashMap usersWithRoles; + private SiteModel siteModel; + + @BeforeClass + public void initTest() throws DataPreparationException + { + adminUserModel = dataUser.createRandomTestUser(); + restClient.authenticateUser(adminUserModel); + siteAPI.useRestClient(restClient); + siteModel = dataSite.usingUser(adminUserModel).createPublicRandomSite(); + usersWithRoles = dataUser.addUsersWithRolesToSite(siteModel, + Arrays.asList(UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor)); + } + + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, description = "Verify user with Manager role gets site information and gets status code OK (200)") + public void getSiteWithManagerRole() throws JsonToModelConversionException, Exception + { + + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteManager)); + siteAPI.getSite(siteModel.getId()); + siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } +} From c4a3a3f6d0b35a75874705f52672fcd61768d847 Mon Sep 17 00:00:00 2001 From: Iulia Nechita Date: Tue, 27 Sep 2016 16:50:10 +0300 Subject: [PATCH 15/21] TAS-894 getSite with Collaborator role --- e2e-test/java/org/alfresco/rest/GetSiteTests.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/e2e-test/java/org/alfresco/rest/GetSiteTests.java b/e2e-test/java/org/alfresco/rest/GetSiteTests.java index 48b4226ed..01b43814b 100644 --- a/e2e-test/java/org/alfresco/rest/GetSiteTests.java +++ b/e2e-test/java/org/alfresco/rest/GetSiteTests.java @@ -58,4 +58,13 @@ public class GetSiteTests extends RestTest siteAPI.getSite(siteModel.getId()); siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } + + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, description = "Verify user with Collaborator role gets site information and gets status code OK (200)") + public void getSiteWithCollaboratorRole() throws JsonToModelConversionException, Exception + { + + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteCollaborator)); + siteAPI.getSite(siteModel.getId()); + siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } } From 8992be8755688f43c4df66aa4186cd945fbfb8f2 Mon Sep 17 00:00:00 2001 From: Iulia Nechita Date: Tue, 27 Sep 2016 16:50:51 +0300 Subject: [PATCH 16/21] TAS-895 getSite with Contributor role --- e2e-test/java/org/alfresco/rest/GetSiteTests.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/e2e-test/java/org/alfresco/rest/GetSiteTests.java b/e2e-test/java/org/alfresco/rest/GetSiteTests.java index 01b43814b..25d8da11e 100644 --- a/e2e-test/java/org/alfresco/rest/GetSiteTests.java +++ b/e2e-test/java/org/alfresco/rest/GetSiteTests.java @@ -67,4 +67,13 @@ public class GetSiteTests extends RestTest siteAPI.getSite(siteModel.getId()); siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } + + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, description = "Verify user with Contributor role gets site information and gets status code OK (200)") + public void getSiteWithContributorRole() throws JsonToModelConversionException, Exception + { + + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteContributor)); + siteAPI.getSite(siteModel.getId()); + siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } } From 4f6107294f8b463da1c591167b6a25805d5ba974 Mon Sep 17 00:00:00 2001 From: Iulia Nechita Date: Tue, 27 Sep 2016 16:51:51 +0300 Subject: [PATCH 17/21] TAS-896 getSite with Consumer role --- e2e-test/java/org/alfresco/rest/GetSiteTests.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/e2e-test/java/org/alfresco/rest/GetSiteTests.java b/e2e-test/java/org/alfresco/rest/GetSiteTests.java index 25d8da11e..1788490e2 100644 --- a/e2e-test/java/org/alfresco/rest/GetSiteTests.java +++ b/e2e-test/java/org/alfresco/rest/GetSiteTests.java @@ -76,4 +76,13 @@ public class GetSiteTests extends RestTest siteAPI.getSite(siteModel.getId()); siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } + + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, description = "Verify user with Consumer role gets site information and gets status code OK (200)") + public void getSiteWithConsumerRole() throws JsonToModelConversionException, Exception + { + + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteConsumer)); + siteAPI.getSite(siteModel.getId()); + siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } } From 16758317b886e52ec7e86ce13fe22b6c2b424215 Mon Sep 17 00:00:00 2001 From: Iulia Nechita Date: Tue, 27 Sep 2016 16:52:30 +0300 Subject: [PATCH 18/21] TAS-897 getSite with admin user --- e2e-test/java/org/alfresco/rest/GetSiteTests.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/e2e-test/java/org/alfresco/rest/GetSiteTests.java b/e2e-test/java/org/alfresco/rest/GetSiteTests.java index 1788490e2..9da55c4ab 100644 --- a/e2e-test/java/org/alfresco/rest/GetSiteTests.java +++ b/e2e-test/java/org/alfresco/rest/GetSiteTests.java @@ -85,4 +85,13 @@ public class GetSiteTests extends RestTest siteAPI.getSite(siteModel.getId()); siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } + + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, description = "Verify user with Consumer role gets site information and gets status code OK (200)") + public void getSiteWithAdminRole() throws JsonToModelConversionException, Exception + { + + restClient.authenticateUser(adminUserModel); + siteAPI.getSite(siteModel.getId()); + siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } } From 1471894dc69c1734e4fcf8bbcd65efecd531b13e Mon Sep 17 00:00:00 2001 From: Iulia Nechita Date: Tue, 27 Sep 2016 16:21:28 +0300 Subject: [PATCH 19/21] TAS-861 getsSites 401 with manager role --- .../alfresco/rest/GetSitesSanityTests.java | 111 ++++++++++++++++++ .../java/org/alfresco/rest/GetSitesTests.java | 13 ++ 2 files changed, 124 insertions(+) create mode 100644 e2e-test/java/org/alfresco/rest/GetSitesSanityTests.java diff --git a/e2e-test/java/org/alfresco/rest/GetSitesSanityTests.java b/e2e-test/java/org/alfresco/rest/GetSitesSanityTests.java new file mode 100644 index 000000000..610954b34 --- /dev/null +++ b/e2e-test/java/org/alfresco/rest/GetSitesSanityTests.java @@ -0,0 +1,111 @@ +package org.alfresco.rest; + +import java.util.Arrays; +import java.util.HashMap; + +import org.alfresco.rest.exception.JsonToModelConversionException; +import org.alfresco.rest.requests.RestSitesApi; +import org.alfresco.utility.data.DataSite; +import org.alfresco.utility.data.DataUser; +import org.alfresco.utility.data.UserRole; +import org.alfresco.utility.model.SiteModel; +import org.alfresco.utility.model.UserModel; +import org.alfresco.utility.testrail.ExecutionType; +import org.alfresco.utility.testrail.annotation.TestRail; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +/** + * @author iulia.cojocea + */ +@Test(groups = { "rest-api", "sites", "sanity" }) +public class GetSitesSanityTests extends RestTest +{ + @Autowired + RestSitesApi siteAPI; + + @Autowired + DataUser dataUser; + + @Autowired + DataSite dataSite; + + private UserModel adminUserModel; + private UserModel userModel; + private HashMap usersWithRoles; + private SiteModel siteModel; + + @BeforeClass + public void initTest() throws Exception + { + adminUserModel = dataUser.getAdminUser(); + restClient.authenticateUser(adminUserModel); + siteAPI.useRestClient(restClient); + siteModel = dataSite.usingUser(adminUserModel).createPublicRandomSite(); + usersWithRoles = dataUser.addUsersWithRolesToSite(siteModel, + Arrays.asList(UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor)); + } + + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, description = "Verify user with Manager role gets sites information and gets status code OK (200)") + public void getSitesWithManagerRole() throws JsonToModelConversionException, Exception + { + + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteManager)); + siteAPI.getAllSites(); + siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } + + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, + description = "Verify user with Collaborator role gets sites information and gets status code OK (200)") + public void getSitesWithCollaboratorRole() throws JsonToModelConversionException, Exception + { + + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteCollaborator)); + siteAPI.getAllSites(); + siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } + + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, + description = "Verify user with Contributor role gets sites information and gets status code OK (200)") + public void getSitesWithContributorRole() throws JsonToModelConversionException, Exception + { + + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteContributor)); + siteAPI.getAllSites(); + siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } + + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, + description = "Verify user with Consumer role gets sites information and gets status code OK (200)") + public void getSitesWithConsumerRole() throws JsonToModelConversionException, Exception + { + + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteConsumer)); + siteAPI.getAllSites(); + siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } + + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, + description = "Verify user with Admin user gets sites information and gets status code OK (200)") + public void getSitesWithAdminUser() throws JsonToModelConversionException, Exception + { + restClient.authenticateUser(adminUserModel); + siteAPI.getAllSites(); + siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } + + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, + description = "Failed authentication get sites call returns status code 401 with Manager role") + public void getSitesWithManagerRoleFailedAuth() throws JsonToModelConversionException, Exception + { + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteManager)); + userModel = dataUser.createRandomTestUser(); + userModel.setPassword("user wrong password"); + dataUser.addUserToSite(userModel, siteModel, UserRole.SiteManager); + restClient.authenticateUser(userModel); + siteAPI.getAllSites(); + siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.UNAUTHORIZED.toString()); + } +} diff --git a/e2e-test/java/org/alfresco/rest/GetSitesTests.java b/e2e-test/java/org/alfresco/rest/GetSitesTests.java index d2d3020e7..e1e38d290 100644 --- a/e2e-test/java/org/alfresco/rest/GetSitesTests.java +++ b/e2e-test/java/org/alfresco/rest/GetSitesTests.java @@ -33,6 +33,7 @@ public class GetSitesTests extends RestTest DataSite dataSite; private UserModel adminUserModel; + private UserModel userModel; private HashMap usersWithRoles; private SiteModel siteModel; @@ -91,4 +92,16 @@ public class GetSitesTests extends RestTest siteAPI.getAllSites(); siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } + + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, description = "Failed authentication get sites call returns status code 401 with Manager role") + public void getSitesWithManagerRoleFailedAuth() throws JsonToModelConversionException, Exception + { + restClient.authenticateUser(usersWithRoles.get(UserRole.SiteManager)); + userModel = dataUser.createRandomTestUser(); + userModel.setPassword("user wrong password"); + dataUser.addUserToSite(userModel, siteModel, UserRole.SiteManager); + restClient.authenticateUser(userModel); + siteAPI.getAllSites(); + siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.UNAUTHORIZED.toString()); + } } From a316935c77f5335aa7b6dfa1f7de14b042b71bb1 Mon Sep 17 00:00:00 2001 From: Iulia Nechita Date: Tue, 27 Sep 2016 16:54:49 +0300 Subject: [PATCH 20/21] TAS-898 getSite status code 401 with Manager role --- ...SiteTests.java => GetSiteSanityTests.java} | 37 +++++++++++++------ 1 file changed, 25 insertions(+), 12 deletions(-) rename e2e-test/java/org/alfresco/rest/{GetSiteTests.java => GetSiteSanityTests.java} (69%) diff --git a/e2e-test/java/org/alfresco/rest/GetSiteTests.java b/e2e-test/java/org/alfresco/rest/GetSiteSanityTests.java similarity index 69% rename from e2e-test/java/org/alfresco/rest/GetSiteTests.java rename to e2e-test/java/org/alfresco/rest/GetSiteSanityTests.java index 9da55c4ab..32076dc28 100644 --- a/e2e-test/java/org/alfresco/rest/GetSiteTests.java +++ b/e2e-test/java/org/alfresco/rest/GetSiteSanityTests.java @@ -23,7 +23,7 @@ import org.testng.annotations.Test; */ @Test(groups = { "rest-api", "sites", "sanity" }) -public class GetSiteTests extends RestTest +public class GetSiteSanityTests extends RestTest { @Autowired @@ -37,12 +37,13 @@ public class GetSiteTests extends RestTest private UserModel adminUserModel; private HashMap usersWithRoles; + private UserModel userModel; private SiteModel siteModel; @BeforeClass public void initTest() throws DataPreparationException { - adminUserModel = dataUser.createRandomTestUser(); + adminUserModel = dataUser.getAdminUser(); restClient.authenticateUser(adminUserModel); siteAPI.useRestClient(restClient); siteModel = dataSite.usingUser(adminUserModel).createPublicRandomSite(); @@ -50,48 +51,60 @@ public class GetSiteTests extends RestTest Arrays.asList(UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor)); } - @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, description = "Verify user with Manager role gets site information and gets status code OK (200)") + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, + description = "Verify user with Manager role gets site information and gets status code OK (200)") public void getSiteWithManagerRole() throws JsonToModelConversionException, Exception { - restClient.authenticateUser(usersWithRoles.get(UserRole.SiteManager)); siteAPI.getSite(siteModel.getId()); siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } - @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, description = "Verify user with Collaborator role gets site information and gets status code OK (200)") + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, + description = "Verify user with Collaborator role gets site information and gets status code OK (200)") public void getSiteWithCollaboratorRole() throws JsonToModelConversionException, Exception { - restClient.authenticateUser(usersWithRoles.get(UserRole.SiteCollaborator)); siteAPI.getSite(siteModel.getId()); siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } - @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, description = "Verify user with Contributor role gets site information and gets status code OK (200)") + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, + description = "Verify user with Contributor role gets site information and gets status code OK (200)") public void getSiteWithContributorRole() throws JsonToModelConversionException, Exception { - restClient.authenticateUser(usersWithRoles.get(UserRole.SiteContributor)); siteAPI.getSite(siteModel.getId()); siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } - @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, description = "Verify user with Consumer role gets site information and gets status code OK (200)") + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, + description = "Verify user with Consumer role gets site information and gets status code OK (200)") public void getSiteWithConsumerRole() throws JsonToModelConversionException, Exception { - restClient.authenticateUser(usersWithRoles.get(UserRole.SiteConsumer)); siteAPI.getSite(siteModel.getId()); siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } - @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, description = "Verify user with Consumer role gets site information and gets status code OK (200)") + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, + description = "Verify user with admin role gets site information and gets status code OK (200)") public void getSiteWithAdminRole() throws JsonToModelConversionException, Exception { - restClient.authenticateUser(adminUserModel); siteAPI.getSite(siteModel.getId()); siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } + + @TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY, + description = "Failed authentication get site call returns status code 401 with Manager role") + public void getSiteWithManagerRoleFailedAuth() throws JsonToModelConversionException, Exception + { + userModel = dataUser.createRandomTestUser(); + userModel.setPassword("user wrong password"); + dataUser.addUserToSite(userModel, siteModel, UserRole.SiteManager); + restClient.authenticateUser(userModel); + siteAPI.getAllSites(); + siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.UNAUTHORIZED.toString()); + } } From 8d46b77fb744643203e949e8c486000551d3704c Mon Sep 17 00:00:00 2001 From: Cristina Jalba Date: Tue, 27 Sep 2016 16:40:12 +0300 Subject: [PATCH 21/21] TAS-864 admin gets comment created by another user --- .../GetCommentsSanityTest.java} | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) rename e2e-test/java/org/alfresco/rest/{GetCommentsTest.java => comments/GetCommentsSanityTest.java} (82%) diff --git a/e2e-test/java/org/alfresco/rest/GetCommentsTest.java b/e2e-test/java/org/alfresco/rest/comments/GetCommentsSanityTest.java similarity index 82% rename from e2e-test/java/org/alfresco/rest/GetCommentsTest.java rename to e2e-test/java/org/alfresco/rest/comments/GetCommentsSanityTest.java index 027cb3db7..d2e81797d 100644 --- a/e2e-test/java/org/alfresco/rest/GetCommentsTest.java +++ b/e2e-test/java/org/alfresco/rest/comments/GetCommentsSanityTest.java @@ -1,9 +1,10 @@ -package org.alfresco.rest; +package org.alfresco.rest.comments; import java.util.Arrays; import java.util.HashMap; import org.alfresco.dataprep.CMISUtil.DocumentType; +import org.alfresco.rest.RestTest; import org.alfresco.rest.exception.JsonToModelConversionException; import org.alfresco.rest.requests.RestCommentsApi; import org.alfresco.utility.data.DataUser; @@ -19,7 +20,7 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @Test(groups = { "rest-api", "comments", "sanity" }) -public class GetCommentsTest extends RestTest +public class GetCommentsSanityTest extends RestTest { @Autowired RestCommentsApi commentsAPI; @@ -95,13 +96,10 @@ public class GetCommentsTest extends RestTest description= "Verify Manager user gets status code 401 if authentication call fails") public void managerIsNotAbleToRetrieveCommentIfAuthenticationFails() throws JsonToModelConversionException, Exception { - userModel = usersWithRoles.get(UserRole.SiteManager); - userModel.setPassword("incorrectPassword"); - restClient.authenticateUser(userModel); + UserModel nonexistentModel = new UserModel("nonexistentUser", "nonexistentPassword"); + restClient.authenticateUser(nonexistentModel); commentsAPI.getNodeComments(document.getNodeRef()); commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.UNAUTHORIZED.toString()); - userModel.setPassword("password"); - restClient.authenticateUser(userModel); } @TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY, @@ -116,4 +114,17 @@ public class GetCommentsTest extends RestTest commentsAPI.getNodeComments(document.getNodeRef()); commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); } + + @TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY, + description= "Verify admin user gets comments created by another user and status code is 200") + public void adminIsAbleToRetrieveCommentsCreatedByAnotherUser() throws JsonToModelConversionException, Exception + { + userModel = usersWithRoles.get(UserRole.SiteCollaborator); + restClient.authenticateUser(userModel); + commentsAPI.addComment(document.getNodeRef(), "This is a new comment added by " + userModel.getUsername()); + commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED.toString()); + restClient.authenticateUser(adminUserModel); + commentsAPI.getNodeComments(document.getNodeRef()); + commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString()); + } }