From 11dd5307a7c2c840920b486fba9776822e6a9a3c Mon Sep 17 00:00:00 2001 From: Travis CI User <8039454+alfresco-build@users.noreply.github.com> Date: Wed, 21 Sep 2022 09:32:28 +0000 Subject: [PATCH 1/7] [maven-release-plugin][skip ci] prepare release 17.126 --- amps/ags/pom.xml | 2 +- amps/ags/rm-automation/pom.xml | 2 +- .../rm-automation/rm-automation-community-rest-api/pom.xml | 2 +- amps/ags/rm-community/pom.xml | 2 +- amps/ags/rm-community/rm-community-repo/pom.xml | 2 +- amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml | 2 +- amps/pom.xml | 2 +- amps/share-services/pom.xml | 2 +- core/pom.xml | 2 +- data-model/pom.xml | 2 +- mmt/pom.xml | 2 +- packaging/distribution/pom.xml | 2 +- packaging/docker-alfresco/pom.xml | 2 +- packaging/pom.xml | 2 +- packaging/tests/pom.xml | 2 +- packaging/tests/tas-cmis/pom.xml | 2 +- packaging/tests/tas-email/pom.xml | 2 +- packaging/tests/tas-integration/pom.xml | 2 +- packaging/tests/tas-restapi/pom.xml | 2 +- packaging/tests/tas-webdav/pom.xml | 2 +- packaging/war/pom.xml | 2 +- pom.xml | 4 ++-- remote-api/pom.xml | 2 +- repository/pom.xml | 2 +- 24 files changed, 25 insertions(+), 25 deletions(-) diff --git a/amps/ags/pom.xml b/amps/ags/pom.xml index 5168c28c3f..8b7767fb9a 100644 --- a/amps/ags/pom.xml +++ b/amps/ags/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-amps - 17.126-SNAPSHOT + 17.126 diff --git a/amps/ags/rm-automation/pom.xml b/amps/ags/rm-automation/pom.xml index 323b1bee17..3ad8c01890 100644 --- a/amps/ags/rm-automation/pom.xml +++ b/amps/ags/rm-automation/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community-parent - 17.126-SNAPSHOT + 17.126 diff --git a/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml b/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml index 4f55228fae..06f787a0e7 100644 --- a/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-automation-community-repo - 17.126-SNAPSHOT + 17.126 diff --git a/amps/ags/rm-community/pom.xml b/amps/ags/rm-community/pom.xml index 5ff4ae7aeb..b44e362805 100644 --- a/amps/ags/rm-community/pom.xml +++ b/amps/ags/rm-community/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community-parent - 17.126-SNAPSHOT + 17.126 diff --git a/amps/ags/rm-community/rm-community-repo/pom.xml b/amps/ags/rm-community/rm-community-repo/pom.xml index 184413c5d6..47bffbc767 100644 --- a/amps/ags/rm-community/rm-community-repo/pom.xml +++ b/amps/ags/rm-community/rm-community-repo/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services-community-repo-parent - 17.126-SNAPSHOT + 17.126 diff --git a/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml b/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml index a848222f51..c403fa8d61 100644 --- a/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml +++ b/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community-repo-parent - 17.126-SNAPSHOT + 17.126 diff --git a/amps/pom.xml b/amps/pom.xml index 87cc763432..aa61bd699f 100644 --- a/amps/pom.xml +++ b/amps/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.126-SNAPSHOT + 17.126 diff --git a/amps/share-services/pom.xml b/amps/share-services/pom.xml index 6aeac13f69..b8eecc8722 100644 --- a/amps/share-services/pom.xml +++ b/amps/share-services/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-community-repo-amps - 17.126-SNAPSHOT + 17.126 diff --git a/core/pom.xml b/core/pom.xml index 6b874d5d52..e4e7a780a0 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.126-SNAPSHOT + 17.126 diff --git a/data-model/pom.xml b/data-model/pom.xml index 213ca9f379..a90bec6062 100644 --- a/data-model/pom.xml +++ b/data-model/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.126-SNAPSHOT + 17.126 diff --git a/mmt/pom.xml b/mmt/pom.xml index 47333dbf93..552e0bf2f4 100644 --- a/mmt/pom.xml +++ b/mmt/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.126-SNAPSHOT + 17.126 diff --git a/packaging/distribution/pom.xml b/packaging/distribution/pom.xml index 07d492a8aa..a2e9bb537a 100644 --- a/packaging/distribution/pom.xml +++ b/packaging/distribution/pom.xml @@ -9,6 +9,6 @@ org.alfresco alfresco-community-repo-packaging - 17.126-SNAPSHOT + 17.126 diff --git a/packaging/docker-alfresco/pom.xml b/packaging/docker-alfresco/pom.xml index 420d34f757..3dfcbff069 100644 --- a/packaging/docker-alfresco/pom.xml +++ b/packaging/docker-alfresco/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-packaging - 17.126-SNAPSHOT + 17.126 diff --git a/packaging/pom.xml b/packaging/pom.xml index 282659ec1c..4c17cbedb3 100644 --- a/packaging/pom.xml +++ b/packaging/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.126-SNAPSHOT + 17.126 diff --git a/packaging/tests/pom.xml b/packaging/tests/pom.xml index 80e229c2e6..01bfe4fadc 100644 --- a/packaging/tests/pom.xml +++ b/packaging/tests/pom.xml @@ -6,7 +6,7 @@ org.alfresco alfresco-community-repo-packaging - 17.126-SNAPSHOT + 17.126 diff --git a/packaging/tests/tas-cmis/pom.xml b/packaging/tests/tas-cmis/pom.xml index 3ca199682a..eda307721a 100644 --- a/packaging/tests/tas-cmis/pom.xml +++ b/packaging/tests/tas-cmis/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.126-SNAPSHOT + 17.126 diff --git a/packaging/tests/tas-email/pom.xml b/packaging/tests/tas-email/pom.xml index c7ec6b0514..3110dcd0f6 100644 --- a/packaging/tests/tas-email/pom.xml +++ b/packaging/tests/tas-email/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.126-SNAPSHOT + 17.126 diff --git a/packaging/tests/tas-integration/pom.xml b/packaging/tests/tas-integration/pom.xml index 06776a24be..f316f14c88 100644 --- a/packaging/tests/tas-integration/pom.xml +++ b/packaging/tests/tas-integration/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.126-SNAPSHOT + 17.126 diff --git a/packaging/tests/tas-restapi/pom.xml b/packaging/tests/tas-restapi/pom.xml index 7a176aa344..8d7b736891 100644 --- a/packaging/tests/tas-restapi/pom.xml +++ b/packaging/tests/tas-restapi/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.126-SNAPSHOT + 17.126 diff --git a/packaging/tests/tas-webdav/pom.xml b/packaging/tests/tas-webdav/pom.xml index 7897fe32ad..9a87fc115b 100644 --- a/packaging/tests/tas-webdav/pom.xml +++ b/packaging/tests/tas-webdav/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.126-SNAPSHOT + 17.126 diff --git a/packaging/war/pom.xml b/packaging/war/pom.xml index 15e1799a7e..35b5a70a5b 100644 --- a/packaging/war/pom.xml +++ b/packaging/war/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-packaging - 17.126-SNAPSHOT + 17.126 diff --git a/pom.xml b/pom.xml index 298e2b8714..aa1bbc0d58 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 alfresco-community-repo - 17.126-SNAPSHOT + 17.126 pom Alfresco Community Repo Parent @@ -151,7 +151,7 @@ scm:git:https://github.com/Alfresco/alfresco-community-repo.git scm:git:https://github.com/Alfresco/alfresco-community-repo.git https://github.com/Alfresco/alfresco-community-repo - HEAD + 17.126 diff --git a/remote-api/pom.xml b/remote-api/pom.xml index 05647bd606..afc9d821ad 100644 --- a/remote-api/pom.xml +++ b/remote-api/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.126-SNAPSHOT + 17.126 diff --git a/repository/pom.xml b/repository/pom.xml index 681875e1e2..7cd5d57ae7 100644 --- a/repository/pom.xml +++ b/repository/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.126-SNAPSHOT + 17.126 From d7d50d0a6760051a396af1b7e22acf1b8df8e81f Mon Sep 17 00:00:00 2001 From: Travis CI User <8039454+alfresco-build@users.noreply.github.com> Date: Wed, 21 Sep 2022 09:32:31 +0000 Subject: [PATCH 2/7] [maven-release-plugin][skip ci] prepare for next development iteration --- amps/ags/pom.xml | 2 +- amps/ags/rm-automation/pom.xml | 2 +- .../rm-automation/rm-automation-community-rest-api/pom.xml | 2 +- amps/ags/rm-community/pom.xml | 2 +- amps/ags/rm-community/rm-community-repo/pom.xml | 2 +- amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml | 2 +- amps/pom.xml | 2 +- amps/share-services/pom.xml | 2 +- core/pom.xml | 2 +- data-model/pom.xml | 2 +- mmt/pom.xml | 2 +- packaging/distribution/pom.xml | 2 +- packaging/docker-alfresco/pom.xml | 2 +- packaging/pom.xml | 2 +- packaging/tests/pom.xml | 2 +- packaging/tests/tas-cmis/pom.xml | 2 +- packaging/tests/tas-email/pom.xml | 2 +- packaging/tests/tas-integration/pom.xml | 2 +- packaging/tests/tas-restapi/pom.xml | 2 +- packaging/tests/tas-webdav/pom.xml | 2 +- packaging/war/pom.xml | 2 +- pom.xml | 4 ++-- remote-api/pom.xml | 2 +- repository/pom.xml | 2 +- 24 files changed, 25 insertions(+), 25 deletions(-) diff --git a/amps/ags/pom.xml b/amps/ags/pom.xml index 8b7767fb9a..9118efb95e 100644 --- a/amps/ags/pom.xml +++ b/amps/ags/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-amps - 17.126 + 17.127-SNAPSHOT diff --git a/amps/ags/rm-automation/pom.xml b/amps/ags/rm-automation/pom.xml index 3ad8c01890..dd1b781ab4 100644 --- a/amps/ags/rm-automation/pom.xml +++ b/amps/ags/rm-automation/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community-parent - 17.126 + 17.127-SNAPSHOT diff --git a/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml b/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml index 06f787a0e7..737ee4edd0 100644 --- a/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-automation-community-repo - 17.126 + 17.127-SNAPSHOT diff --git a/amps/ags/rm-community/pom.xml b/amps/ags/rm-community/pom.xml index b44e362805..1040c7ee0e 100644 --- a/amps/ags/rm-community/pom.xml +++ b/amps/ags/rm-community/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community-parent - 17.126 + 17.127-SNAPSHOT diff --git a/amps/ags/rm-community/rm-community-repo/pom.xml b/amps/ags/rm-community/rm-community-repo/pom.xml index 47bffbc767..6ee2ba7429 100644 --- a/amps/ags/rm-community/rm-community-repo/pom.xml +++ b/amps/ags/rm-community/rm-community-repo/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services-community-repo-parent - 17.126 + 17.127-SNAPSHOT diff --git a/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml b/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml index c403fa8d61..d310b29f52 100644 --- a/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml +++ b/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community-repo-parent - 17.126 + 17.127-SNAPSHOT diff --git a/amps/pom.xml b/amps/pom.xml index aa61bd699f..bc0afc4ab1 100644 --- a/amps/pom.xml +++ b/amps/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.126 + 17.127-SNAPSHOT diff --git a/amps/share-services/pom.xml b/amps/share-services/pom.xml index b8eecc8722..8f381be3da 100644 --- a/amps/share-services/pom.xml +++ b/amps/share-services/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-community-repo-amps - 17.126 + 17.127-SNAPSHOT diff --git a/core/pom.xml b/core/pom.xml index e4e7a780a0..b54f95f689 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.126 + 17.127-SNAPSHOT diff --git a/data-model/pom.xml b/data-model/pom.xml index a90bec6062..2a408d209c 100644 --- a/data-model/pom.xml +++ b/data-model/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.126 + 17.127-SNAPSHOT diff --git a/mmt/pom.xml b/mmt/pom.xml index 552e0bf2f4..4740f482bd 100644 --- a/mmt/pom.xml +++ b/mmt/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.126 + 17.127-SNAPSHOT diff --git a/packaging/distribution/pom.xml b/packaging/distribution/pom.xml index a2e9bb537a..9b5bc4cb96 100644 --- a/packaging/distribution/pom.xml +++ b/packaging/distribution/pom.xml @@ -9,6 +9,6 @@ org.alfresco alfresco-community-repo-packaging - 17.126 + 17.127-SNAPSHOT diff --git a/packaging/docker-alfresco/pom.xml b/packaging/docker-alfresco/pom.xml index 3dfcbff069..e6e79a3acf 100644 --- a/packaging/docker-alfresco/pom.xml +++ b/packaging/docker-alfresco/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-packaging - 17.126 + 17.127-SNAPSHOT diff --git a/packaging/pom.xml b/packaging/pom.xml index 4c17cbedb3..05808687be 100644 --- a/packaging/pom.xml +++ b/packaging/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.126 + 17.127-SNAPSHOT diff --git a/packaging/tests/pom.xml b/packaging/tests/pom.xml index 01bfe4fadc..872b5ab717 100644 --- a/packaging/tests/pom.xml +++ b/packaging/tests/pom.xml @@ -6,7 +6,7 @@ org.alfresco alfresco-community-repo-packaging - 17.126 + 17.127-SNAPSHOT diff --git a/packaging/tests/tas-cmis/pom.xml b/packaging/tests/tas-cmis/pom.xml index eda307721a..918969f0b7 100644 --- a/packaging/tests/tas-cmis/pom.xml +++ b/packaging/tests/tas-cmis/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.126 + 17.127-SNAPSHOT diff --git a/packaging/tests/tas-email/pom.xml b/packaging/tests/tas-email/pom.xml index 3110dcd0f6..2ab91ae2f5 100644 --- a/packaging/tests/tas-email/pom.xml +++ b/packaging/tests/tas-email/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.126 + 17.127-SNAPSHOT diff --git a/packaging/tests/tas-integration/pom.xml b/packaging/tests/tas-integration/pom.xml index f316f14c88..66660f0490 100644 --- a/packaging/tests/tas-integration/pom.xml +++ b/packaging/tests/tas-integration/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.126 + 17.127-SNAPSHOT diff --git a/packaging/tests/tas-restapi/pom.xml b/packaging/tests/tas-restapi/pom.xml index 8d7b736891..a89e3d5a46 100644 --- a/packaging/tests/tas-restapi/pom.xml +++ b/packaging/tests/tas-restapi/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.126 + 17.127-SNAPSHOT diff --git a/packaging/tests/tas-webdav/pom.xml b/packaging/tests/tas-webdav/pom.xml index 9a87fc115b..62181e25db 100644 --- a/packaging/tests/tas-webdav/pom.xml +++ b/packaging/tests/tas-webdav/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.126 + 17.127-SNAPSHOT diff --git a/packaging/war/pom.xml b/packaging/war/pom.xml index 35b5a70a5b..c07e172478 100644 --- a/packaging/war/pom.xml +++ b/packaging/war/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-packaging - 17.126 + 17.127-SNAPSHOT diff --git a/pom.xml b/pom.xml index aa1bbc0d58..032a742e34 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 alfresco-community-repo - 17.126 + 17.127-SNAPSHOT pom Alfresco Community Repo Parent @@ -151,7 +151,7 @@ scm:git:https://github.com/Alfresco/alfresco-community-repo.git scm:git:https://github.com/Alfresco/alfresco-community-repo.git https://github.com/Alfresco/alfresco-community-repo - 17.126 + HEAD diff --git a/remote-api/pom.xml b/remote-api/pom.xml index afc9d821ad..1538e914ec 100644 --- a/remote-api/pom.xml +++ b/remote-api/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.126 + 17.127-SNAPSHOT diff --git a/repository/pom.xml b/repository/pom.xml index 7cd5d57ae7..500944ed86 100644 --- a/repository/pom.xml +++ b/repository/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.126 + 17.127-SNAPSHOT From a80ac51b5d40007228bdda9314394a90903d491f Mon Sep 17 00:00:00 2001 From: Maciej Pichura <41297682+mpichura@users.noreply.github.com> Date: Wed, 21 Sep 2022 11:56:10 +0200 Subject: [PATCH 3/7] ACS-3509: Adding E2E TAS REST tests for update rule conditions. (#1411) * ACS-3509: Adding E2E TAS REST tests for update rule conditions. * ACS-3509: Clean up after review. * ACS-3509: Fixes after review, adding some more E2E tests. --- .../alfresco/rest/rules/UpdateRulesTests.java | 169 +++++++++++++++++- 1 file changed, 167 insertions(+), 2 deletions(-) diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/rules/UpdateRulesTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/rules/UpdateRulesTests.java index be4ea977db..c841ca0966 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/rules/UpdateRulesTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/rules/UpdateRulesTests.java @@ -27,17 +27,22 @@ package org.alfresco.rest.rules; import static org.alfresco.rest.rules.RulesTestsUtils.ID; import static org.alfresco.rest.rules.RulesTestsUtils.INBOUND; +import static org.alfresco.rest.rules.RulesTestsUtils.INVERTED; import static org.alfresco.rest.rules.RulesTestsUtils.IS_SHARED; import static org.alfresco.rest.rules.RulesTestsUtils.RULE_ASYNC_DEFAULT; import static org.alfresco.rest.rules.RulesTestsUtils.RULE_CASCADE_DEFAULT; import static org.alfresco.rest.rules.RulesTestsUtils.RULE_ENABLED_DEFAULT; +import static org.alfresco.rest.rules.RulesTestsUtils.createCompositeCondition; import static org.alfresco.rest.rules.RulesTestsUtils.createDefaultActionModel; import static org.alfresco.rest.rules.RulesTestsUtils.createRuleModel; import static org.alfresco.rest.rules.RulesTestsUtils.createRuleModelWithModifiedValues; +import static org.alfresco.rest.rules.RulesTestsUtils.createSimpleCondition; +import static org.alfresco.rest.rules.RulesTestsUtils.createVariousConditions; import static org.alfresco.utility.constants.UserRole.SiteCollaborator; import static org.alfresco.utility.report.log.Step.STEP; import static org.springframework.http.HttpStatus.BAD_REQUEST; import static org.springframework.http.HttpStatus.FORBIDDEN; +import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR; import static org.springframework.http.HttpStatus.NOT_FOUND; import static org.springframework.http.HttpStatus.OK; @@ -47,6 +52,7 @@ import java.util.Map; import com.google.common.collect.ImmutableMap; import org.alfresco.rest.RestTest; import org.alfresco.rest.model.RestActionBodyExecTemplateModel; +import org.alfresco.rest.model.RestCompositeConditionDefinitionModel; import org.alfresco.rest.model.RestRuleModel; import org.alfresco.utility.model.FolderModel; import org.alfresco.utility.model.SiteModel; @@ -287,14 +293,173 @@ public class UpdateRulesTests extends RestTest final String updatedErrorScript = "updated-error-script"; rule.setErrorScript(updatedErrorScript); final RestRuleModel updatedRule = restClient.authenticateUser(user).withCoreAPI().usingNode(ruleFolder).usingDefaultRuleSet() - .include(IS_SHARED) .updateRule(rule.getId(), rule); restClient.assertStatusCodeIs(OK); - updatedRule.assertThat().isEqualTo(rule, ID, IS_SHARED) + updatedRule.assertThat().isEqualTo(rule, ID) .assertThat().field(ID).isNotNull(); } + /** Check we can use the POST response and update rule by adding conditions. */ + @Test (groups = { TestGroup.REST_API, TestGroup.RULES, TestGroup.SANITY }) + public void updateRuleAddConditions() + { + final RestRuleModel rule = createAndSaveRule(createRuleModelWithModifiedValues()); + + STEP("Try to update the rule and add conditions."); + rule.setConditions(createVariousConditions()); + + final RestRuleModel updatedRule = restClient.authenticateUser(user).withCoreAPI().usingNode(ruleFolder).usingDefaultRuleSet() + .updateRule(rule.getId(), rule); + + restClient.assertStatusCodeIs(OK); + updatedRule.assertThat().isEqualTo(rule, ID) + .assertThat().field(ID).isNotNull(); + } + + /** Check we can use the POST response and update a rule rule without any conditions by adding null conditions. */ + @Test (groups = { TestGroup.REST_API, TestGroup.RULES, TestGroup.SANITY }) + public void updateRuleAddNullConditions() + { + final RestRuleModel rule = createAndSaveRule(createRuleModelWithModifiedValues()); + + STEP("Try to update the rule and add null conditions."); + rule.setConditions(createCompositeCondition(null)); + + final RestRuleModel updatedRule = restClient.authenticateUser(user).withCoreAPI().usingNode(ruleFolder).usingDefaultRuleSet() + .updateRule(rule.getId(), rule); + + restClient.assertStatusCodeIs(OK); + updatedRule.assertThat().isEqualTo(rule, ID) + .assertThat().field(ID).isNotNull(); + } + + /** Check we can use the POST response and update rule by modifying conditions. */ + @Test (groups = { TestGroup.REST_API, TestGroup.RULES, TestGroup.SANITY }) + public void updateRuleModifyConditions() + { + final RestRuleModel ruleModelWithInitialValues = createRuleModelWithModifiedValues(); + ruleModelWithInitialValues.setConditions(createVariousConditions()); + final RestRuleModel rule = createAndSaveRule(ruleModelWithInitialValues); + + STEP("Try to update the rule and modify conditions."); + final RestCompositeConditionDefinitionModel compositeCondition = createCompositeCondition( + List.of(createCompositeCondition(false, List.of(createSimpleCondition("tag", "equals", "sample_tag"))))); + rule.setConditions(compositeCondition); + + final RestRuleModel updatedRule = restClient.authenticateUser(user).withCoreAPI().usingNode(ruleFolder).usingDefaultRuleSet() + .updateRule(rule.getId(), rule); + + restClient.assertStatusCodeIs(OK); + updatedRule.assertThat().isEqualTo(rule, ID) + .assertThat().field(ID).isNotNull(); + } + + /** Check we can use the POST response and update rule by removing all conditions. */ + @Test (groups = { TestGroup.REST_API, TestGroup.RULES, TestGroup.SANITY }) + public void updateRuleRemoveAllConditions() + { + final RestRuleModel ruleModelWithInitialValues = createRuleModelWithModifiedValues(); + ruleModelWithInitialValues.setConditions(createVariousConditions()); + final RestRuleModel rule = createAndSaveRule(ruleModelWithInitialValues); + + STEP("Try to update the rule and remove all conditions."); + rule.setConditions(null); + + final RestRuleModel updatedRule = restClient.authenticateUser(user).withCoreAPI().usingNode(ruleFolder).usingDefaultRuleSet() + .updateRule(rule.getId(), rule); + + //set expected object + rule.setConditions(createCompositeCondition(null)); + restClient.assertStatusCodeIs(OK); + updatedRule.assertThat().isEqualTo(rule, ID) + .assertThat().field(ID).isNotNull(); + } + + /** Check we get a 400 error when using the POST response and update rule by adding condition with invalid category. */ + @Test (groups = { TestGroup.REST_API, TestGroup.RULES, TestGroup.SANITY }) + public void updateRuleWithInvalidCategoryInConditionAndFail() + { + final RestRuleModel ruleModelWithInitialValues = createRuleModelWithModifiedValues(); + ruleModelWithInitialValues.setConditions(createVariousConditions()); + final RestRuleModel rule = createAndSaveRule(ruleModelWithInitialValues); + + STEP("Try to update the rule with invalid condition."); + final RestCompositeConditionDefinitionModel conditions = createCompositeCondition( + List.of(createCompositeCondition(!INVERTED, List.of(createSimpleCondition("category", "equals", "fake-category-id"))))); + rule.setConditions(conditions); + + restClient.authenticateUser(user).withCoreAPI().usingNode(ruleFolder).usingDefaultRuleSet() + .include(IS_SHARED) + .updateRule(rule.getId(), rule); + + restClient.assertStatusCodeIs(BAD_REQUEST); + restClient.assertLastError().containsSummary("Category in condition is invalid"); + } + + /** Check we get a 500 error when using the POST response and update rule by adding condition without comparator. */ + @Test (groups = { TestGroup.REST_API, TestGroup.RULES, TestGroup.SANITY }) + public void updateRuleWithConditionWithoutComparatorAndFail() + { + final RestRuleModel ruleModelWithInitialValues = createRuleModelWithModifiedValues(); + ruleModelWithInitialValues.setConditions(createVariousConditions()); + final RestRuleModel rule = createAndSaveRule(ruleModelWithInitialValues); + + STEP("Try to update the rule with invalid condition."); + final RestCompositeConditionDefinitionModel conditions = createCompositeCondition( + List.of(createCompositeCondition(!INVERTED, List.of(createSimpleCondition("size", null, "65500"))))); + rule.setConditions(conditions); + + restClient.authenticateUser(user).withCoreAPI().usingNode(ruleFolder).usingDefaultRuleSet() + .include(IS_SHARED) + .updateRule(rule.getId(), rule); + + //TODO: in next iteration of mapper refactoring this error code will change to 400 + restClient.assertStatusCodeIs(INTERNAL_SERVER_ERROR); + } + + /** Check we get a 500 error when using the POST response and update rule by adding condition without field. */ + @Test (groups = { TestGroup.REST_API, TestGroup.RULES, TestGroup.SANITY }) + public void updateRuleWithConditionWithoutFieldAndFail() + { + final RestRuleModel ruleModelWithInitialValues = createRuleModelWithModifiedValues(); + ruleModelWithInitialValues.setConditions(createVariousConditions()); + final RestRuleModel rule = createAndSaveRule(ruleModelWithInitialValues); + + STEP("Try to update the rule with invalid condition."); + final RestCompositeConditionDefinitionModel conditions = createCompositeCondition( + List.of(createCompositeCondition(!INVERTED, List.of(createSimpleCondition(null, "greater_than", "65500"))))); + rule.setConditions(conditions); + + restClient.authenticateUser(user).withCoreAPI().usingNode(ruleFolder).usingDefaultRuleSet() + .include(IS_SHARED) + .updateRule(rule.getId(), rule); + + //TODO: in next iteration of mapper refactoring this error code will change to 400 + restClient.assertStatusCodeIs(INTERNAL_SERVER_ERROR); + } + + /** Check we get a 500 error when using the POST response and update rule by adding condition without parameter value. */ + @Test (groups = { TestGroup.REST_API, TestGroup.RULES, TestGroup.SANITY }) + public void updateRuleWithConditionWithoutParamValueAndFail() + { + final RestRuleModel ruleModelWithInitialValues = createRuleModelWithModifiedValues(); + ruleModelWithInitialValues.setConditions(createVariousConditions()); + final RestRuleModel rule = createAndSaveRule(ruleModelWithInitialValues); + + STEP("Try to update the rule with invalid condition."); + final RestCompositeConditionDefinitionModel conditions = createCompositeCondition( + List.of(createCompositeCondition(!INVERTED, List.of(createSimpleCondition("size", "greater_than", null))))); + rule.setConditions(conditions); + + restClient.authenticateUser(user).withCoreAPI().usingNode(ruleFolder).usingDefaultRuleSet() + .include(IS_SHARED) + .updateRule(rule.getId(), rule); + + //TODO: in next iteration of mapper refactoring this error code will change to 400 + restClient.assertStatusCodeIs(INTERNAL_SERVER_ERROR); + } + private RestRuleModel createAndSaveRule(String name) { return createAndSaveRule(name, List.of(createDefaultActionModel())); From 857771593b916d1a4f2cf7eb696c53942b81f86e Mon Sep 17 00:00:00 2001 From: Travis CI User <8039454+alfresco-build@users.noreply.github.com> Date: Wed, 21 Sep 2022 10:32:35 +0000 Subject: [PATCH 4/7] [maven-release-plugin][skip ci] prepare release 17.127 --- amps/ags/pom.xml | 2 +- amps/ags/rm-automation/pom.xml | 2 +- .../rm-automation/rm-automation-community-rest-api/pom.xml | 2 +- amps/ags/rm-community/pom.xml | 2 +- amps/ags/rm-community/rm-community-repo/pom.xml | 2 +- amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml | 2 +- amps/pom.xml | 2 +- amps/share-services/pom.xml | 2 +- core/pom.xml | 2 +- data-model/pom.xml | 2 +- mmt/pom.xml | 2 +- packaging/distribution/pom.xml | 2 +- packaging/docker-alfresco/pom.xml | 2 +- packaging/pom.xml | 2 +- packaging/tests/pom.xml | 2 +- packaging/tests/tas-cmis/pom.xml | 2 +- packaging/tests/tas-email/pom.xml | 2 +- packaging/tests/tas-integration/pom.xml | 2 +- packaging/tests/tas-restapi/pom.xml | 2 +- packaging/tests/tas-webdav/pom.xml | 2 +- packaging/war/pom.xml | 2 +- pom.xml | 4 ++-- remote-api/pom.xml | 2 +- repository/pom.xml | 2 +- 24 files changed, 25 insertions(+), 25 deletions(-) diff --git a/amps/ags/pom.xml b/amps/ags/pom.xml index 9118efb95e..077e1fc28b 100644 --- a/amps/ags/pom.xml +++ b/amps/ags/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-amps - 17.127-SNAPSHOT + 17.127 diff --git a/amps/ags/rm-automation/pom.xml b/amps/ags/rm-automation/pom.xml index dd1b781ab4..2e09c49506 100644 --- a/amps/ags/rm-automation/pom.xml +++ b/amps/ags/rm-automation/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community-parent - 17.127-SNAPSHOT + 17.127 diff --git a/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml b/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml index 737ee4edd0..c05426d280 100644 --- a/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-automation-community-repo - 17.127-SNAPSHOT + 17.127 diff --git a/amps/ags/rm-community/pom.xml b/amps/ags/rm-community/pom.xml index 1040c7ee0e..a8e6074774 100644 --- a/amps/ags/rm-community/pom.xml +++ b/amps/ags/rm-community/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community-parent - 17.127-SNAPSHOT + 17.127 diff --git a/amps/ags/rm-community/rm-community-repo/pom.xml b/amps/ags/rm-community/rm-community-repo/pom.xml index 6ee2ba7429..e26397428e 100644 --- a/amps/ags/rm-community/rm-community-repo/pom.xml +++ b/amps/ags/rm-community/rm-community-repo/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services-community-repo-parent - 17.127-SNAPSHOT + 17.127 diff --git a/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml b/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml index d310b29f52..b8b2aeb3f4 100644 --- a/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml +++ b/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community-repo-parent - 17.127-SNAPSHOT + 17.127 diff --git a/amps/pom.xml b/amps/pom.xml index bc0afc4ab1..8656d8c2c8 100644 --- a/amps/pom.xml +++ b/amps/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.127-SNAPSHOT + 17.127 diff --git a/amps/share-services/pom.xml b/amps/share-services/pom.xml index 8f381be3da..1c8ea83d33 100644 --- a/amps/share-services/pom.xml +++ b/amps/share-services/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-community-repo-amps - 17.127-SNAPSHOT + 17.127 diff --git a/core/pom.xml b/core/pom.xml index b54f95f689..3e623f3722 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.127-SNAPSHOT + 17.127 diff --git a/data-model/pom.xml b/data-model/pom.xml index 2a408d209c..573dfc7352 100644 --- a/data-model/pom.xml +++ b/data-model/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.127-SNAPSHOT + 17.127 diff --git a/mmt/pom.xml b/mmt/pom.xml index 4740f482bd..079bc58eb7 100644 --- a/mmt/pom.xml +++ b/mmt/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.127-SNAPSHOT + 17.127 diff --git a/packaging/distribution/pom.xml b/packaging/distribution/pom.xml index 9b5bc4cb96..275da17f85 100644 --- a/packaging/distribution/pom.xml +++ b/packaging/distribution/pom.xml @@ -9,6 +9,6 @@ org.alfresco alfresco-community-repo-packaging - 17.127-SNAPSHOT + 17.127 diff --git a/packaging/docker-alfresco/pom.xml b/packaging/docker-alfresco/pom.xml index e6e79a3acf..e5c108db66 100644 --- a/packaging/docker-alfresco/pom.xml +++ b/packaging/docker-alfresco/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-packaging - 17.127-SNAPSHOT + 17.127 diff --git a/packaging/pom.xml b/packaging/pom.xml index 05808687be..9c62ec7e0f 100644 --- a/packaging/pom.xml +++ b/packaging/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.127-SNAPSHOT + 17.127 diff --git a/packaging/tests/pom.xml b/packaging/tests/pom.xml index 872b5ab717..1e5719bbf3 100644 --- a/packaging/tests/pom.xml +++ b/packaging/tests/pom.xml @@ -6,7 +6,7 @@ org.alfresco alfresco-community-repo-packaging - 17.127-SNAPSHOT + 17.127 diff --git a/packaging/tests/tas-cmis/pom.xml b/packaging/tests/tas-cmis/pom.xml index 918969f0b7..d54c56022a 100644 --- a/packaging/tests/tas-cmis/pom.xml +++ b/packaging/tests/tas-cmis/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.127-SNAPSHOT + 17.127 diff --git a/packaging/tests/tas-email/pom.xml b/packaging/tests/tas-email/pom.xml index 2ab91ae2f5..4840217a28 100644 --- a/packaging/tests/tas-email/pom.xml +++ b/packaging/tests/tas-email/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.127-SNAPSHOT + 17.127 diff --git a/packaging/tests/tas-integration/pom.xml b/packaging/tests/tas-integration/pom.xml index 66660f0490..b77ca517be 100644 --- a/packaging/tests/tas-integration/pom.xml +++ b/packaging/tests/tas-integration/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.127-SNAPSHOT + 17.127 diff --git a/packaging/tests/tas-restapi/pom.xml b/packaging/tests/tas-restapi/pom.xml index a89e3d5a46..2dbeec58a7 100644 --- a/packaging/tests/tas-restapi/pom.xml +++ b/packaging/tests/tas-restapi/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.127-SNAPSHOT + 17.127 diff --git a/packaging/tests/tas-webdav/pom.xml b/packaging/tests/tas-webdav/pom.xml index 62181e25db..9927bdba9e 100644 --- a/packaging/tests/tas-webdav/pom.xml +++ b/packaging/tests/tas-webdav/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.127-SNAPSHOT + 17.127 diff --git a/packaging/war/pom.xml b/packaging/war/pom.xml index c07e172478..128a2106fe 100644 --- a/packaging/war/pom.xml +++ b/packaging/war/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-packaging - 17.127-SNAPSHOT + 17.127 diff --git a/pom.xml b/pom.xml index 032a742e34..f369b7593f 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 alfresco-community-repo - 17.127-SNAPSHOT + 17.127 pom Alfresco Community Repo Parent @@ -151,7 +151,7 @@ scm:git:https://github.com/Alfresco/alfresco-community-repo.git scm:git:https://github.com/Alfresco/alfresco-community-repo.git https://github.com/Alfresco/alfresco-community-repo - HEAD + 17.127 diff --git a/remote-api/pom.xml b/remote-api/pom.xml index 1538e914ec..5ad4276531 100644 --- a/remote-api/pom.xml +++ b/remote-api/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.127-SNAPSHOT + 17.127 diff --git a/repository/pom.xml b/repository/pom.xml index 500944ed86..ec45f54640 100644 --- a/repository/pom.xml +++ b/repository/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.127-SNAPSHOT + 17.127 From e0844d72e1716336eff87abcc3ce24331fa477e6 Mon Sep 17 00:00:00 2001 From: Travis CI User <8039454+alfresco-build@users.noreply.github.com> Date: Wed, 21 Sep 2022 10:32:38 +0000 Subject: [PATCH 5/7] [maven-release-plugin][skip ci] prepare for next development iteration --- amps/ags/pom.xml | 2 +- amps/ags/rm-automation/pom.xml | 2 +- .../rm-automation/rm-automation-community-rest-api/pom.xml | 2 +- amps/ags/rm-community/pom.xml | 2 +- amps/ags/rm-community/rm-community-repo/pom.xml | 2 +- amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml | 2 +- amps/pom.xml | 2 +- amps/share-services/pom.xml | 2 +- core/pom.xml | 2 +- data-model/pom.xml | 2 +- mmt/pom.xml | 2 +- packaging/distribution/pom.xml | 2 +- packaging/docker-alfresco/pom.xml | 2 +- packaging/pom.xml | 2 +- packaging/tests/pom.xml | 2 +- packaging/tests/tas-cmis/pom.xml | 2 +- packaging/tests/tas-email/pom.xml | 2 +- packaging/tests/tas-integration/pom.xml | 2 +- packaging/tests/tas-restapi/pom.xml | 2 +- packaging/tests/tas-webdav/pom.xml | 2 +- packaging/war/pom.xml | 2 +- pom.xml | 4 ++-- remote-api/pom.xml | 2 +- repository/pom.xml | 2 +- 24 files changed, 25 insertions(+), 25 deletions(-) diff --git a/amps/ags/pom.xml b/amps/ags/pom.xml index 077e1fc28b..b784b0d898 100644 --- a/amps/ags/pom.xml +++ b/amps/ags/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-amps - 17.127 + 17.128-SNAPSHOT diff --git a/amps/ags/rm-automation/pom.xml b/amps/ags/rm-automation/pom.xml index 2e09c49506..b4a9688e68 100644 --- a/amps/ags/rm-automation/pom.xml +++ b/amps/ags/rm-automation/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community-parent - 17.127 + 17.128-SNAPSHOT diff --git a/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml b/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml index c05426d280..24b2a195a3 100644 --- a/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-automation-community-repo - 17.127 + 17.128-SNAPSHOT diff --git a/amps/ags/rm-community/pom.xml b/amps/ags/rm-community/pom.xml index a8e6074774..02b483c857 100644 --- a/amps/ags/rm-community/pom.xml +++ b/amps/ags/rm-community/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community-parent - 17.127 + 17.128-SNAPSHOT diff --git a/amps/ags/rm-community/rm-community-repo/pom.xml b/amps/ags/rm-community/rm-community-repo/pom.xml index e26397428e..1de1207000 100644 --- a/amps/ags/rm-community/rm-community-repo/pom.xml +++ b/amps/ags/rm-community/rm-community-repo/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services-community-repo-parent - 17.127 + 17.128-SNAPSHOT diff --git a/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml b/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml index b8b2aeb3f4..76b0e16822 100644 --- a/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml +++ b/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community-repo-parent - 17.127 + 17.128-SNAPSHOT diff --git a/amps/pom.xml b/amps/pom.xml index 8656d8c2c8..d304fc383e 100644 --- a/amps/pom.xml +++ b/amps/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.127 + 17.128-SNAPSHOT diff --git a/amps/share-services/pom.xml b/amps/share-services/pom.xml index 1c8ea83d33..12017f8b7d 100644 --- a/amps/share-services/pom.xml +++ b/amps/share-services/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-community-repo-amps - 17.127 + 17.128-SNAPSHOT diff --git a/core/pom.xml b/core/pom.xml index 3e623f3722..2c9490a4e4 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.127 + 17.128-SNAPSHOT diff --git a/data-model/pom.xml b/data-model/pom.xml index 573dfc7352..87f6a7b3d9 100644 --- a/data-model/pom.xml +++ b/data-model/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.127 + 17.128-SNAPSHOT diff --git a/mmt/pom.xml b/mmt/pom.xml index 079bc58eb7..a3507d15ed 100644 --- a/mmt/pom.xml +++ b/mmt/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.127 + 17.128-SNAPSHOT diff --git a/packaging/distribution/pom.xml b/packaging/distribution/pom.xml index 275da17f85..3e489cf39c 100644 --- a/packaging/distribution/pom.xml +++ b/packaging/distribution/pom.xml @@ -9,6 +9,6 @@ org.alfresco alfresco-community-repo-packaging - 17.127 + 17.128-SNAPSHOT diff --git a/packaging/docker-alfresco/pom.xml b/packaging/docker-alfresco/pom.xml index e5c108db66..689803136b 100644 --- a/packaging/docker-alfresco/pom.xml +++ b/packaging/docker-alfresco/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-packaging - 17.127 + 17.128-SNAPSHOT diff --git a/packaging/pom.xml b/packaging/pom.xml index 9c62ec7e0f..1a0c640449 100644 --- a/packaging/pom.xml +++ b/packaging/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.127 + 17.128-SNAPSHOT diff --git a/packaging/tests/pom.xml b/packaging/tests/pom.xml index 1e5719bbf3..5d618b7685 100644 --- a/packaging/tests/pom.xml +++ b/packaging/tests/pom.xml @@ -6,7 +6,7 @@ org.alfresco alfresco-community-repo-packaging - 17.127 + 17.128-SNAPSHOT diff --git a/packaging/tests/tas-cmis/pom.xml b/packaging/tests/tas-cmis/pom.xml index d54c56022a..a9bf9007ff 100644 --- a/packaging/tests/tas-cmis/pom.xml +++ b/packaging/tests/tas-cmis/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.127 + 17.128-SNAPSHOT diff --git a/packaging/tests/tas-email/pom.xml b/packaging/tests/tas-email/pom.xml index 4840217a28..2d352ffab6 100644 --- a/packaging/tests/tas-email/pom.xml +++ b/packaging/tests/tas-email/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.127 + 17.128-SNAPSHOT diff --git a/packaging/tests/tas-integration/pom.xml b/packaging/tests/tas-integration/pom.xml index b77ca517be..a977f5ea37 100644 --- a/packaging/tests/tas-integration/pom.xml +++ b/packaging/tests/tas-integration/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.127 + 17.128-SNAPSHOT diff --git a/packaging/tests/tas-restapi/pom.xml b/packaging/tests/tas-restapi/pom.xml index 2dbeec58a7..31e9ae8e1e 100644 --- a/packaging/tests/tas-restapi/pom.xml +++ b/packaging/tests/tas-restapi/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.127 + 17.128-SNAPSHOT diff --git a/packaging/tests/tas-webdav/pom.xml b/packaging/tests/tas-webdav/pom.xml index 9927bdba9e..c920edf41b 100644 --- a/packaging/tests/tas-webdav/pom.xml +++ b/packaging/tests/tas-webdav/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 17.127 + 17.128-SNAPSHOT diff --git a/packaging/war/pom.xml b/packaging/war/pom.xml index 128a2106fe..48c2ed0ff2 100644 --- a/packaging/war/pom.xml +++ b/packaging/war/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-packaging - 17.127 + 17.128-SNAPSHOT diff --git a/pom.xml b/pom.xml index f369b7593f..384ee23024 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 alfresco-community-repo - 17.127 + 17.128-SNAPSHOT pom Alfresco Community Repo Parent @@ -151,7 +151,7 @@ scm:git:https://github.com/Alfresco/alfresco-community-repo.git scm:git:https://github.com/Alfresco/alfresco-community-repo.git https://github.com/Alfresco/alfresco-community-repo - 17.127 + HEAD diff --git a/remote-api/pom.xml b/remote-api/pom.xml index 5ad4276531..6d5bd36615 100644 --- a/remote-api/pom.xml +++ b/remote-api/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.127 + 17.128-SNAPSHOT diff --git a/repository/pom.xml b/repository/pom.xml index ec45f54640..d585b088ae 100644 --- a/repository/pom.xml +++ b/repository/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 17.127 + 17.128-SNAPSHOT From c4d432b136f445ea92fa7984fc79b4a4234c79b0 Mon Sep 17 00:00:00 2001 From: Tom Page Date: Wed, 21 Sep 2022 15:18:30 +0100 Subject: [PATCH 6/7] ACS-3364 Add permission handling to linkedToBy. (#1425) --- .../alfresco/rest/rules/GetRuleSetsTests.java | 2 +- .../rest/api/impl/rules/RuleSetLoader.java | 13 +++--- .../alfresco/repo/rule/RuleServiceImpl.java | 14 +++++++ .../service/cmr/rule/RuleService.java | 14 ++++++- .../repo/rule/RuleServiceImplUnitTest.java | 42 +++++++++++++++++++ 5 files changed, 75 insertions(+), 10 deletions(-) diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/rules/GetRuleSetsTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/rules/GetRuleSetsTests.java index 020951f8db..963ef1d060 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/rules/GetRuleSetsTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/rules/GetRuleSetsTests.java @@ -354,7 +354,7 @@ public class GetRuleSetsTests extends RestTest RestRuleSetLinkModel ruleSetLink = new RestRuleSetLinkModel(); ruleSetLink.setId(ruleFolder.getNodeRef()); coreAPIForUser().usingNode(publicFolder).createRuleLink(ruleSetLink); - coreAPIForUser().usingNode(privateFolder).createRuleLink(ruleSetLink); + coreAPIForAdmin().usingNode(privateFolder).createRuleLink(ruleSetLink); STEP("Get the rule set and linkedToBy field"); RestRuleSetModel ruleSet = coreAPIForUser().usingNode(ruleFolder) diff --git a/remote-api/src/main/java/org/alfresco/rest/api/impl/rules/RuleSetLoader.java b/remote-api/src/main/java/org/alfresco/rest/api/impl/rules/RuleSetLoader.java index 6fd9e8f338..58d983ecc2 100644 --- a/remote-api/src/main/java/org/alfresco/rest/api/impl/rules/RuleSetLoader.java +++ b/remote-api/src/main/java/org/alfresco/rest/api/impl/rules/RuleSetLoader.java @@ -30,7 +30,6 @@ import static org.alfresco.rest.api.model.rules.InclusionType.LINKED; import static org.alfresco.rest.api.model.rules.InclusionType.OWNED; import java.util.List; -import java.util.stream.Collectors; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.rest.api.model.rules.RuleSet; @@ -93,12 +92,7 @@ public class RuleSetLoader } if (includes.contains(LINKED_TO_BY)) { - List linkedToBy = nodeService.getParentAssocs(ruleSetNodeRef) - .stream() - .map(ChildAssociationRef::getParentRef) - .filter(folder -> !folder.equals(parentRef)) - .collect(Collectors.toList()); - ruleSet.setLinkedToBy(linkedToBy); + ruleSet.setLinkedToBy(loadLinkedToBy(ruleSetNodeRef)); } if (includes.contains(IS_INHERITED)) { @@ -113,6 +107,11 @@ public class RuleSetLoader return ruleService.getFoldersInheritingRuleSet(ruleSetNodeRef, MAX_INHERITED_BY_SIZE); } + private List loadLinkedToBy(NodeRef ruleSetNodeRef) + { + return ruleService.getFoldersLinkingToRuleSet(ruleSetNodeRef); + } + private boolean loadIsInherited(NodeRef ruleSetNodeRef) { return AuthenticationUtil.runAsSystem(() -> !ruleService.getFoldersInheritingRuleSet(ruleSetNodeRef, 1).isEmpty()); diff --git a/repository/src/main/java/org/alfresco/repo/rule/RuleServiceImpl.java b/repository/src/main/java/org/alfresco/repo/rule/RuleServiceImpl.java index db591fbbf7..b833e426c8 100644 --- a/repository/src/main/java/org/alfresco/repo/rule/RuleServiceImpl.java +++ b/repository/src/main/java/org/alfresco/repo/rule/RuleServiceImpl.java @@ -689,6 +689,20 @@ public class RuleServiceImpl return inheritors; } + /** {@inheritDoc} */ + @Override + @Experimental + public List getFoldersLinkingToRuleSet(NodeRef ruleSet) + { + NodeRef parentRef = nodeService.getPrimaryParent(ruleSet).getParentRef(); + return nodeService.getParentAssocs(ruleSet) + .stream() + .map(ChildAssociationRef::getParentRef) + .filter(folder -> !folder.equals(parentRef)) + .filter(folder -> permissionService.hasReadPermission(folder) == ALLOWED) + .collect(Collectors.toList()); + } + /** * Gets the inherited rules for a given node reference * diff --git a/repository/src/main/java/org/alfresco/service/cmr/rule/RuleService.java b/repository/src/main/java/org/alfresco/service/cmr/rule/RuleService.java index 3b03eb329b..330e731f03 100644 --- a/repository/src/main/java/org/alfresco/service/cmr/rule/RuleService.java +++ b/repository/src/main/java/org/alfresco/service/cmr/rule/RuleService.java @@ -232,13 +232,23 @@ public interface RuleService * * @param ruleSet The rule set node. * @param maxFoldersToReturn A limit on the number of folders to return (since otherwise this could traverse a very large proportion of - * the repository. - * @return The list of the specified + * the repository). + * @return The list of the inheriting folders. */ @Auditable (parameters = { "ruleSet", "maxFoldersToReturn" }) @Experimental List getFoldersInheritingRuleSet(NodeRef ruleSet, int maxFoldersToReturn); + /** + * Get a list of folders linking to the specified rule set. + * + * @param ruleSet The rule set node. + * @return The list linking folders. + */ + @Auditable (parameters = { "ruleSet" }) + @Experimental + List getFoldersLinkingToRuleSet(NodeRef ruleSet); + /** * Get the rule given its node reference * diff --git a/repository/src/test/java/org/alfresco/repo/rule/RuleServiceImplUnitTest.java b/repository/src/test/java/org/alfresco/repo/rule/RuleServiceImplUnitTest.java index 8c085abaea..939743efc1 100644 --- a/repository/src/test/java/org/alfresco/repo/rule/RuleServiceImplUnitTest.java +++ b/repository/src/test/java/org/alfresco/repo/rule/RuleServiceImplUnitTest.java @@ -714,4 +714,46 @@ public class RuleServiceImplUnitTest assertEquals("Unexpected list of inheriting folders.", List.of(child), actual); } + + /** Check that a linked folder can be retrieved from a rule set node. */ + @Test + public void testGetFoldersLinkingToRuleSet() + { + NodeRef ruleSetNode = new NodeRef("rule://set/"); + NodeRef owningFolder = new NodeRef("owning://folder/"); + ChildAssociationRef owningAssocMock = mock(ChildAssociationRef.class); + given(owningAssocMock.getParentRef()).willReturn(owningFolder); + given(nodeService.getPrimaryParent(ruleSetNode)).willReturn(owningAssocMock); + // Simulate a folder linking to the rule set. + NodeRef linkingFolder = new NodeRef("linking://folder/"); + ChildAssociationRef linkingAssocMock = mock(ChildAssociationRef.class); + given(linkingAssocMock.getParentRef()).willReturn(linkingFolder); + given(nodeService.getParentAssocs(ruleSetNode)).willReturn(List.of(owningAssocMock, linkingAssocMock)); + + List linkingFolders = ruleService.getFoldersLinkingToRuleSet(ruleSetNode); + + assertEquals("Unexpected list of linking folders.", List.of(linkingFolder), linkingFolders); + } + + /** Check that permissions affect which linked folders are returned to the user. */ + @Test + public void testGetFoldersLinkingToRuleSet_respectsPermissions() + { + NodeRef ruleSetNode = new NodeRef("rule://set/"); + NodeRef owningFolder = new NodeRef("owning://folder/"); + ChildAssociationRef owningAssocMock = mock(ChildAssociationRef.class); + given(owningAssocMock.getParentRef()).willReturn(owningFolder); + given(nodeService.getPrimaryParent(ruleSetNode)).willReturn(owningAssocMock); + // Simulate a folder linking to the rule set. + NodeRef linkingFolder = new NodeRef("linking://folder/"); + ChildAssociationRef linkingAssocMock = mock(ChildAssociationRef.class); + given(linkingAssocMock.getParentRef()).willReturn(linkingFolder); + given(nodeService.getParentAssocs(ruleSetNode)).willReturn(List.of(owningAssocMock, linkingAssocMock)); + // The currect user does not have permission to view the folder. + given(permissionService.hasReadPermission(linkingFolder)).willReturn(DENIED); + + List linkingFolders = ruleService.getFoldersLinkingToRuleSet(ruleSetNode); + + assertEquals("Unexpected list of linking folders.", emptyList(), linkingFolders); + } } From e0d52f98ae132ab609e0926360de2b485e3230a2 Mon Sep 17 00:00:00 2001 From: Tom Page Date: Wed, 21 Sep 2022 15:18:41 +0100 Subject: [PATCH 7/7] ACS-3366 Add support for isLinkedTo to GET rule sets. (#1427) * ACS-3364 Add permission handling to linkedToBy. * ACS-3366 Add support for isLinkedTo to GET rule sets. --- .../alfresco/rest/rules/GetRuleSetsTests.java | 56 +++++++++++++++++++ .../rest/api/impl/rules/RuleSetLoader.java | 22 ++++++++ .../rest/api/model/rules/RuleSet.java | 35 +++++++++++- .../api/impl/rules/RuleSetLoaderTest.java | 11 ++++ 4 files changed, 122 insertions(+), 2 deletions(-) diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/rules/GetRuleSetsTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/rules/GetRuleSetsTests.java index 963ef1d060..4feaa7586e 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/rules/GetRuleSetsTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/rules/GetRuleSetsTests.java @@ -447,6 +447,62 @@ public class GetRuleSetsTests extends RestTest ruleSet.assertThat().field("isInherited").is(false); } + + /** Check that a user can see that a rule set is linked to even if they don't have permission to view the linking folder. */ + @Test + public void getRuleSetAndIsLinkedToWithoutPermission() + { + STEP("Create a site owned by admin and add user as a contributor"); + SiteModel siteModel = dataSite.usingAdmin().createPrivateRandomSite(); + dataUser.addUserToSite(user, siteModel, UserRole.SiteContributor); + + STEP("Create a folder with a rule set"); + FolderModel ruleFolder = dataContent.usingUser(user).usingSite(siteModel).createFolder(); + RestRuleModel ruleModel = createRuleModelWithDefaultValues(); + coreAPIForUser().usingNode(ruleFolder).usingDefaultRuleSet().createSingleRule(ruleModel); + + STEP("Create a private folder linking to the rule set"); + FolderModel linkingFolder = dataContent.usingAdmin().usingSite(siteModel).createFolder(); + RestRuleSetLinkModel linkModel = new RestRuleSetLinkModel(); + linkModel.setId(ruleFolder.getNodeRef()); + coreAPIForAdmin().usingNode(linkingFolder).createRuleLink(linkModel); + + STEP("Remove the user from the site"); + dataUser.removeUserFromSite(user, siteModel); + + STEP("Get the rule set and isLinkedTo field"); + RestRuleSetModel ruleSet = coreAPIForUser().usingNode(ruleFolder) + .include("isLinkedTo", "linkedToBy", "owningFolder") + .getDefaultRuleSet(); + + restClient.assertStatusCodeIs(OK); + ruleSet.assertThat().field("isLinkedTo").is(true) + .assertThat().field("linkedToBy").isEmpty(); + + } + + /** + * Check that if a rule set is owned and inherited but not linked to then isLinkedTo returns false. + */ + @Test + public void getRuleSetAndIsLinkedToCanBeFalse() + { + STEP("Create a site, a folder with a rule and a child folder that inherits it"); + SiteModel siteModel = dataSite.usingUser(user).createPublicRandomSite(); + FolderModel ruleFolder = dataContent.usingUser(user).usingSite(siteModel).createFolder(); + RestRuleModel ruleModel = createRuleModelWithDefaultValues(); + coreAPIForUser().usingNode(ruleFolder).usingDefaultRuleSet().createSingleRule(ruleModel); + dataContent.usingUser(user).usingResource(ruleFolder).createFolder(); + + STEP("Get the rule set and isLinkedTo field"); + RestRuleSetModel ruleSet = coreAPIForUser().usingNode(ruleFolder) + .include("isLinkedTo") + .getDefaultRuleSet(); + + restClient.assertStatusCodeIs(OK); + ruleSet.assertThat().field("isLinkedTo").is(false); + } + private RestCoreAPI coreAPIForUser() { return restClient.authenticateUser(user).withCoreAPI(); diff --git a/remote-api/src/main/java/org/alfresco/rest/api/impl/rules/RuleSetLoader.java b/remote-api/src/main/java/org/alfresco/rest/api/impl/rules/RuleSetLoader.java index 58d983ecc2..bda45c9c15 100644 --- a/remote-api/src/main/java/org/alfresco/rest/api/impl/rules/RuleSetLoader.java +++ b/remote-api/src/main/java/org/alfresco/rest/api/impl/rules/RuleSetLoader.java @@ -48,6 +48,7 @@ public class RuleSetLoader protected static final String INHERITED_BY = "inheritedBy"; protected static final String LINKED_TO_BY = "linkedToBy"; protected static final String IS_INHERITED = "isInherited"; + protected static final String IS_LINKED_TO = "isLinkedTo"; private static final int MAX_INHERITED_BY_SIZE = 100; private NodeService nodeService; private RuleService ruleService; @@ -98,6 +99,10 @@ public class RuleSetLoader { ruleSet.setIsInherited(loadIsInherited(ruleSetNodeRef)); } + if (includes.contains(IS_LINKED_TO)) + { + ruleSet.setIsLinkedTo(loadIsLinkedTo(ruleSetNodeRef, parentRef)); + } } return ruleSet; } @@ -117,6 +122,23 @@ public class RuleSetLoader return AuthenticationUtil.runAsSystem(() -> !ruleService.getFoldersInheritingRuleSet(ruleSetNodeRef, 1).isEmpty()); } + /** + * Check if any parents of the rule set node are not the owning folder. + * + * @param ruleSetNodeRef The rule set node. + * @param parentRef The owning folder. + * @return True if another folder links to the rule set. + */ + private Boolean loadIsLinkedTo(NodeRef ruleSetNodeRef, NodeRef parentRef) + { + return AuthenticationUtil.runAsSystem(() -> + nodeService.getParentAssocs(ruleSetNodeRef) + .stream() + .map(ChildAssociationRef::getParentRef) + .anyMatch(folder -> !folder.equals(parentRef)) + ); + } + public void setNodeService(NodeService nodeService) { this.nodeService = nodeService; diff --git a/remote-api/src/main/java/org/alfresco/rest/api/model/rules/RuleSet.java b/remote-api/src/main/java/org/alfresco/rest/api/model/rules/RuleSet.java index 379228ce66..4a3713936d 100644 --- a/remote-api/src/main/java/org/alfresco/rest/api/model/rules/RuleSet.java +++ b/remote-api/src/main/java/org/alfresco/rest/api/model/rules/RuleSet.java @@ -44,6 +44,7 @@ public class RuleSet private List inheritedBy; private List linkedToBy; private Boolean isInherited; + private Boolean isLinkedTo; public static RuleSet of(String id) { @@ -130,6 +131,26 @@ public class RuleSet return isInherited; } + /** + * Set a flag indicating that the rule set is linked to by a folder. + * + * @param isLinkedTo The flag. + */ + public void setIsLinkedTo(Boolean isLinkedTo) + { + this.isLinkedTo = isLinkedTo; + } + + /** + * Find if the rule set is linked to by a folder. + * + * @return The value of the flag. + */ + public Boolean getIsLinkedTo() + { + return isLinkedTo; + } + @Override public String toString() { @@ -141,6 +162,7 @@ public class RuleSet .add("inheritedBy='" + inheritedBy + "'") .add("linkedToBy='" + linkedToBy + "'") .add("isInherited='" + isInherited + "'") + .add("isLinkedTo='" + isLinkedTo + "'") .toString() + '}'; } @@ -158,13 +180,14 @@ public class RuleSet && inclusionType == ruleSet.inclusionType && Objects.equals(inheritedBy, ruleSet.inheritedBy) && Objects.equals(linkedToBy, ruleSet.linkedToBy) - && Objects.equals(isInherited, ruleSet.isInherited); + && Objects.equals(isInherited, ruleSet.isInherited) + && Objects.equals(isLinkedTo, ruleSet.isLinkedTo); } @Override public int hashCode() { - return Objects.hash(id, owningFolder, inclusionType, inheritedBy, linkedToBy, isInherited); + return Objects.hash(id, owningFolder, inclusionType, inheritedBy, linkedToBy, isInherited, isLinkedTo); } public static Builder builder() @@ -180,6 +203,7 @@ public class RuleSet private List inheritedBy; private List linkedToBy; private Boolean isInherited; + private Boolean isLinkedTo; public Builder id(String id) { @@ -217,6 +241,12 @@ public class RuleSet return this; } + public Builder isLinkedTo(Boolean isLinkedTo) + { + this.isLinkedTo = isLinkedTo; + return this; + } + public RuleSet create() { final RuleSet ruleSet = new RuleSet(); @@ -226,6 +256,7 @@ public class RuleSet ruleSet.setInheritedBy(inheritedBy); ruleSet.setLinkedToBy(linkedToBy); ruleSet.setIsInherited(isInherited); + ruleSet.setIsLinkedTo(isLinkedTo); return ruleSet; } } diff --git a/remote-api/src/test/java/org/alfresco/rest/api/impl/rules/RuleSetLoaderTest.java b/remote-api/src/test/java/org/alfresco/rest/api/impl/rules/RuleSetLoaderTest.java index afa3a710e1..bf4f001e99 100644 --- a/remote-api/src/test/java/org/alfresco/rest/api/impl/rules/RuleSetLoaderTest.java +++ b/remote-api/src/test/java/org/alfresco/rest/api/impl/rules/RuleSetLoaderTest.java @@ -28,6 +28,7 @@ package org.alfresco.rest.api.impl.rules; import static org.alfresco.rest.api.impl.rules.RuleSetLoader.INCLUSION_TYPE; import static org.alfresco.rest.api.impl.rules.RuleSetLoader.INHERITED_BY; import static org.alfresco.rest.api.impl.rules.RuleSetLoader.IS_INHERITED; +import static org.alfresco.rest.api.impl.rules.RuleSetLoader.IS_LINKED_TO; import static org.alfresco.rest.api.impl.rules.RuleSetLoader.LINKED_TO_BY; import static org.alfresco.rest.api.impl.rules.RuleSetLoader.OWNING_FOLDER; import static org.alfresco.rest.api.model.rules.InclusionType.INHERITED; @@ -170,4 +171,14 @@ public class RuleSetLoaderTest extends TestCase RuleSet expected = RuleSet.builder().id(RULE_SET_ID).isInherited(true).create(); assertEquals(expected, actual); } + + @Test + public void testLoadRuleSet_isLinkedTo() + { + // Call the method under test. + RuleSet actual = ruleSetLoader.loadRuleSet(RULE_SET_NODE, FOLDER_NODE, List.of(IS_LINKED_TO)); + + RuleSet expected = RuleSet.builder().id(RULE_SET_ID).isLinkedTo(true).create(); + assertEquals(expected, actual); + } }