mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-11-05 15:32:21 +00:00
Compare commits
2 Commits
23.1.0.185
...
APPS-2000_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ffe06391b | ||
|
|
92ff7151d8 |
34
.github/workflows/ci.yml
vendored
34
.github/workflows/ci.yml
vendored
@@ -33,7 +33,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: >
|
if: >
|
||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
||||||
@@ -52,7 +52,7 @@ jobs:
|
|||||||
if: >
|
if: >
|
||||||
((github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) && github.event_name != 'pull_request') &&
|
((github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) && github.event_name != 'pull_request') &&
|
||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
||||||
@@ -76,7 +76,7 @@ jobs:
|
|||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force]')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
steps:
|
steps:
|
||||||
- uses: Alfresco/ya-pmd-scan@v2.0.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/pmd@v2.5.0
|
||||||
with:
|
with:
|
||||||
fail-on-new-issues: "false"
|
fail-on-new-issues: "false"
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ jobs:
|
|||||||
if: >
|
if: >
|
||||||
!contains(github.event.head_commit.message, '[skip repo]') &&
|
!contains(github.event.head_commit.message, '[skip repo]') &&
|
||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
||||||
@@ -108,7 +108,7 @@ jobs:
|
|||||||
if: >
|
if: >
|
||||||
!contains(github.event.head_commit.message, '[skip repo]') &&
|
!contains(github.event.head_commit.message, '[skip repo]') &&
|
||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -153,7 +153,7 @@ jobs:
|
|||||||
!contains(github.event.head_commit.message, '[skip db]')) ||
|
!contains(github.event.head_commit.message, '[skip db]')) ||
|
||||||
contains(github.event.head_commit.message, '[db]')) &&
|
contains(github.event.head_commit.message, '[db]')) &&
|
||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -183,7 +183,7 @@ jobs:
|
|||||||
contains(github.event.head_commit.message, '[latest db]') ||
|
contains(github.event.head_commit.message, '[latest db]') ||
|
||||||
contains(github.event.head_commit.message, '[db]')) &&
|
contains(github.event.head_commit.message, '[db]')) &&
|
||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
||||||
@@ -209,7 +209,7 @@ jobs:
|
|||||||
contains(github.event.head_commit.message, '[latest db]') ||
|
contains(github.event.head_commit.message, '[latest db]') ||
|
||||||
contains(github.event.head_commit.message, '[db]')) &&
|
contains(github.event.head_commit.message, '[db]')) &&
|
||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
||||||
@@ -234,7 +234,7 @@ jobs:
|
|||||||
!contains(github.event.head_commit.message, '[skip db]')) ||
|
!contains(github.event.head_commit.message, '[skip db]')) ||
|
||||||
contains(github.event.head_commit.message, '[db]')) &&
|
contains(github.event.head_commit.message, '[db]')) &&
|
||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
||||||
@@ -259,7 +259,7 @@ jobs:
|
|||||||
contains(github.event.head_commit.message, '[latest db]') ||
|
contains(github.event.head_commit.message, '[latest db]') ||
|
||||||
contains(github.event.head_commit.message, '[db]')) &&
|
contains(github.event.head_commit.message, '[db]')) &&
|
||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
||||||
@@ -282,7 +282,7 @@ jobs:
|
|||||||
if: >
|
if: >
|
||||||
!contains(github.event.head_commit.message, '[skip repo]') &&
|
!contains(github.event.head_commit.message, '[skip repo]') &&
|
||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
||||||
@@ -303,7 +303,7 @@ jobs:
|
|||||||
if: >
|
if: >
|
||||||
!contains(github.event.head_commit.message, '[skip repo]') &&
|
!contains(github.event.head_commit.message, '[skip repo]') &&
|
||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -372,7 +372,7 @@ jobs:
|
|||||||
!contains(github.event.head_commit.message, '[skip tas]')) ||
|
!contains(github.event.head_commit.message, '[skip tas]')) ||
|
||||||
contains(github.event.head_commit.message, '[tas]')) &&
|
contains(github.event.head_commit.message, '[tas]')) &&
|
||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -439,7 +439,7 @@ jobs:
|
|||||||
if: >
|
if: >
|
||||||
!contains(github.event.head_commit.message, '[skip repo]') &&
|
!contains(github.event.head_commit.message, '[skip repo]') &&
|
||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
||||||
@@ -462,7 +462,7 @@ jobs:
|
|||||||
!contains(github.event.head_commit.message, '[skip ags]')) ||
|
!contains(github.event.head_commit.message, '[skip ags]')) ||
|
||||||
contains(github.event.head_commit.message, '[ags]')) &&
|
contains(github.event.head_commit.message, '[ags]')) &&
|
||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -493,7 +493,7 @@ jobs:
|
|||||||
!contains(github.event.head_commit.message, '[skip ags]')) ||
|
!contains(github.event.head_commit.message, '[skip ags]')) ||
|
||||||
contains(github.event.head_commit.message, '[ags on MySQL]')) &&
|
contains(github.event.head_commit.message, '[ags on MySQL]')) &&
|
||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -524,7 +524,7 @@ jobs:
|
|||||||
!contains(github.event.head_commit.message, '[skip ags]') && !contains(github.event.head_commit.message, '[skip tas]')) ||
|
!contains(github.event.head_commit.message, '[skip ags]') && !contains(github.event.head_commit.message, '[skip tas]')) ||
|
||||||
(contains(github.event.head_commit.message, '[ags]') && contains(github.event.head_commit.message, '[tas]'))) &&
|
(contains(github.event.head_commit.message, '[ags]') && contains(github.event.head_commit.message, '[tas]'))) &&
|
||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
env:
|
env:
|
||||||
REQUIRES_LOCAL_IMAGES: true
|
REQUIRES_LOCAL_IMAGES: true
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -3,12 +3,14 @@ Thanks for your interest in contributing to this project!
|
|||||||
|
|
||||||
The following is a set of guidelines for contributing to this library. Most of them will make the life of the reviewer easier and therefore decrease the time required for the patch be included in the next version.
|
The following is a set of guidelines for contributing to this library. Most of them will make the life of the reviewer easier and therefore decrease the time required for the patch be included in the next version.
|
||||||
|
|
||||||
Because this project forms a part of Alfresco Content Services, the guidelines are hosted in the [Alfresco Social Community](https://hub.alfresco.com/t5/alfresco-content-services-ecm/ct-p/ECM-software) where they can be referenced from multiple projects.
|
Because this project forms a part of Alfresco Content Services, the guidelines are hosted in the [Alfresco Social Community](http://community.alfresco.com/community/ecm) where they can be referenced from multiple projects.
|
||||||
|
|
||||||
|
Read an [overview on how this project is goverened](https://community.alfresco.com/docs/DOC-6385-project-overview-repository).
|
||||||
|
|
||||||
You can report an issue in the ALF project of the [Alfresco issue tracker](http://issues.alfresco.com).
|
You can report an issue in the ALF project of the [Alfresco issue tracker](http://issues.alfresco.com).
|
||||||
|
|
||||||
Read [instructions for a good issue report](https://hub.alfresco.com/t5/alfresco-content-services-hub/reporting-an-issue/ba-p/289727).
|
Read [instructions for a good issue report](https://community.alfresco.com/docs/DOC-6263-reporting-an-issue).
|
||||||
|
|
||||||
Read [instructions for making a contribution](https://hub.alfresco.com/t5/alfresco-content-services-hub/alfresco-contribution-agreement/ba-p/293276).
|
Read [instructions for making a contribution](https://community.alfresco.com/docs/DOC-6269-submitting-contributions).
|
||||||
|
|
||||||
Please follow [the coding standards](https://hub.alfresco.com/t5/alfresco-content-services-hub/coding-standards-for-alfresco-content-services/ba-p/290457).
|
Please follow [the coding standards](https://community.alfresco.com/docs/DOC-4658-coding-standards).
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ Repository is a library packaged as a jar file which contains the following:
|
|||||||
|
|
||||||
Remote API is a library packaged as a jar file which contains the following:
|
Remote API is a library packaged as a jar file which contains the following:
|
||||||
* REST API framework
|
* REST API framework
|
||||||
* WebScript implementations including [V1 REST APIs](https://hub.alfresco.com/t5/alfresco-content-services-blog/v1-rest-api-10-things-you-should-know/ba-p/287692)
|
* WebScript implementations including [V1 REST APIs](https://community.alfresco.com/community/ecm/blog/2017/05/02/v1-rest-api-10-things-you-should-know)
|
||||||
* [OpenCMIS](https://chemistry.apache.org/java/opencmis.html) implementations
|
* [OpenCMIS](https://chemistry.apache.org/java/opencmis.html) implementations
|
||||||
|
|
||||||
#### Artifacts
|
#### Artifacts
|
||||||
@@ -94,4 +94,4 @@ The enterprise projects which extend the `alfresco-community-repo` use the same
|
|||||||
artifact version number.
|
artifact version number.
|
||||||
|
|
||||||
### Contributing guide
|
### Contributing guide
|
||||||
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.
|
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
|
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ import org.apache.http.HttpResponse;
|
|||||||
import org.apache.http.HttpStatus;
|
import org.apache.http.HttpStatus;
|
||||||
import org.apache.http.util.EntityUtils;
|
import org.apache.http.util.EntityUtils;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.testng.AssertJUnit;
|
import org.testng.AssertJUnit;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
@@ -64,9 +65,7 @@ import java.util.List;
|
|||||||
import static org.alfresco.rest.core.v0.BaseAPI.NODE_REF_WORKSPACE_SPACES_STORE;
|
import static org.alfresco.rest.core.v0.BaseAPI.NODE_REF_WORKSPACE_SPACES_STORE;
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS;
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS;
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAspects.CUT_OFF_ASPECT;
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAspects.CUT_OFF_ASPECT;
|
||||||
import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPeriodProperty.CREATED_DATE;
|
import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPeriodProperty.*;
|
||||||
import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPeriodProperty.DATE_FILED;
|
|
||||||
import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPeriodProperty.CUT_OFF_DATE;
|
|
||||||
import static org.alfresco.rest.rm.community.util.CommonTestUtils.generateTestPrefix;
|
import static org.alfresco.rest.rm.community.util.CommonTestUtils.generateTestPrefix;
|
||||||
import static org.alfresco.utility.report.log.Step.STEP;
|
import static org.alfresco.utility.report.log.Step.STEP;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
@@ -85,25 +84,28 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RecordFoldersAPI recordFoldersAPI;
|
private RecordFoldersAPI recordFoldersAPI;
|
||||||
private final static String TEST_PREFIX = generateTestPrefix(DispositionScheduleLinkedRecordsTest.class);
|
private final static String TEST_PREFIX = generateTestPrefix(DispositionScheduleLinkedRecordsTest.class);
|
||||||
private static final String CATEGORY_RM_3077 = TEST_PREFIX + "RM-3077_manager_sees_me";
|
private RecordCategory Category1;
|
||||||
private static final String COPY_CATEGORY_RM_3077 = "Copy_of_" + CATEGORY_RM_3077;
|
private RecordCategoryChild CopyCatFolder,folder1,CatFolder,folder2;
|
||||||
private static final String FOLDER_RM_3077 = "RM-3077_folder_"+ CATEGORY_RM_3077;
|
private static final String categoryRM3077 = TEST_PREFIX + "RM-3077_manager_sees_me";
|
||||||
private static final String COPY_FOLDER_RM_3077 = "Copy_of_" + FOLDER_RM_3077;
|
private static final String copyCategoryRM3077 = "Copy_of_" + categoryRM3077;
|
||||||
private static final String FIRST_CATEGORY_RM_3060 = TEST_PREFIX + "RM-3060_category_record";
|
private static final String folderRM3077 = "RM-3077_folder_"+ categoryRM3077;
|
||||||
private static final String SECOND_CATEGORY_RM_3060 = "Copy_of_" + FIRST_CATEGORY_RM_3060;
|
private static final String copyFolderRM3077 = "Copy_of_" + folderRM3077;
|
||||||
private static final String FIRST_FOLDER_RM_3060 = TEST_PREFIX + "RM-3060_folder";
|
private final String folder = TEST_PREFIX + "RM-2937 folder ghosting";
|
||||||
private static final String SECOND_FOLDER_RM_3060 = TEST_PREFIX + "RM-3060_disposition_on_Record_Level";
|
private static final String firstCategoryRM3060 = TEST_PREFIX + "RM-3060_category_record";
|
||||||
private static final String ELECTRONIC_RECORD_RM_3060 = TEST_PREFIX + "RM-3060_electronic_1_record";
|
private static final String secondCategoryRM3060 = "Copy_of_" + firstCategoryRM3060;
|
||||||
private static final String NON_ELECTRONIC_RECORD_RM_3060 = TEST_PREFIX + "RM-3060_non-electronic_record";
|
private static final String firstFolderRM3060 = TEST_PREFIX + "RM-3060_folder";
|
||||||
private static final String FIRST_CATEGORY_RM_1622 = TEST_PREFIX + "RM-1622_category_record";
|
private static final String secondFolderRM3060 = TEST_PREFIX + "RM-3060_disposition_on_Record_Level";
|
||||||
private static final String SECOND_CATEGORY_RM_1622 = "Copy_of_" + FIRST_CATEGORY_RM_1622;
|
private static final String electronicRecordRM3060 = TEST_PREFIX + "RM-3060_electronic_1_record";
|
||||||
private static final String FIRST_FOLDER_RM_1622 = TEST_PREFIX + "RM-1622_folder";
|
private static final String nonElectronicRecordRM3060 = TEST_PREFIX + "RM-3060_non-electronic_record";
|
||||||
private static final String ELECTRONIC_RECORD_RM_1622 = TEST_PREFIX + "RM-1622_electronic_1_record";
|
private static final String firstCategoryRM1622 = TEST_PREFIX + "RM-1622_category_record";
|
||||||
private static final String SECOND_FOLDER_RM_1622 = TEST_PREFIX + "RM-1622_disposition_on_Record_Level";
|
private static final String secondCategoryRM1622 = "Copy_of_" + firstCategoryRM1622;;
|
||||||
|
private static final String firstFolderRM1622 = TEST_PREFIX + "RM-1622_folder";
|
||||||
|
private static final String electronicRecordRM1622 = TEST_PREFIX + "RM-1622_electronic_1_record";
|
||||||
|
private static final String secondFolderRM1622 = TEST_PREFIX + "RM-1622_disposition_on_Record_Level";
|
||||||
private static final String TRANSFER_LOCATION = TEST_PREFIX + "RM-3060_transferred_records";
|
private static final String TRANSFER_LOCATION = TEST_PREFIX + "RM-3060_transferred_records";
|
||||||
public static final String TRANSFER_TYPE = "rma:transferred";
|
public static final String TRANSFER_TYPE = "rma:transferred";
|
||||||
private FilePlan filePlanModel;
|
private FilePlan filePlanModel;
|
||||||
private UserModel rmAdmin;
|
private UserModel rmAdmin, rmManager;
|
||||||
|
|
||||||
@BeforeClass(alwaysRun = true)
|
@BeforeClass(alwaysRun = true)
|
||||||
public void setupDispositionScheduleLinkedRecordsTest() {
|
public void setupDispositionScheduleLinkedRecordsTest() {
|
||||||
@@ -118,12 +120,11 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
|
|||||||
UserRoles.ROLE_RM_ADMIN.roleId);
|
UserRoles.ROLE_RM_ADMIN.roleId);
|
||||||
|
|
||||||
// create "rm Manager" user if it does not exist and assign it to RM Administrator role
|
// create "rm Manager" user if it does not exist and assign it to RM Administrator role
|
||||||
UserModel rmManager = getDataUser().createRandomTestUser();
|
rmManager = getDataUser().createRandomTestUser();
|
||||||
rmRolesAndActionsAPI.assignRoleToUser(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
rmRolesAndActionsAPI.assignRoleToUser(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(), rmManager.getUsername(),
|
getDataUser().usingAdmin().getAdminUser().getPassword(),rmManager.getUsername(),
|
||||||
UserRoles.ROLE_RM_MANAGER.roleId);
|
UserRoles.ROLE_RM_MANAGER.roleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disposition Schedule on Record Folder with linked records test
|
* Disposition Schedule on Record Folder with linked records test
|
||||||
* <p>
|
* <p>
|
||||||
@@ -135,202 +136,194 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
|
|||||||
* <p>
|
* <p>
|
||||||
* <p/> TestRail Test C775<p/>
|
* <p/> TestRail Test C775<p/>
|
||||||
**/
|
**/
|
||||||
@Test
|
// @Ignore("ACS-5020")
|
||||||
@AlfrescoTest(jira = "RM-1622")
|
// @Test
|
||||||
public void dispositionScheduleLinkedRecords() throws UnsupportedEncodingException {
|
// @AlfrescoTest(jira = "RM-1622")
|
||||||
STEP("Create record category");
|
// public void dispositionScheduleLinkedRecords() throws UnsupportedEncodingException {
|
||||||
RecordCategory category1 = createRootCategory(CATEGORY_RM_3077);
|
// STEP("Create record category");
|
||||||
|
// Category1 = createRootCategory(categoryRM3077);
|
||||||
//create retention schedule
|
//
|
||||||
dispositionScheduleService.createCategoryRetentionSchedule(category1.getName(), false);
|
// //create retention schedule
|
||||||
|
// dispositionScheduleService.createCategoryRetentionSchedule(Category1.getName(), false);
|
||||||
// add cut off step
|
//
|
||||||
dispositionScheduleService.addCutOffAfterPeriodStep(category1.getName(), "day|2", CREATED_DATE);
|
// // add cut off step
|
||||||
|
// dispositionScheduleService.addCutOffAfterPeriodStep(Category1.getName(), "day|2", CREATED_DATE);
|
||||||
//create a copy of the category recordsCategory
|
//
|
||||||
String copyCategoryId = copyCategory(getAdminUser(), category1.getId(), COPY_CATEGORY_RM_3077);
|
// //create a copy of the category recordsCategory
|
||||||
|
// String CopyCategoryId = copyCategory(getAdminUser(),Category1.getId(), copyCategoryRM3077);
|
||||||
// create folders in both categories
|
//
|
||||||
RecordCategoryChild catFolder = createRecordFolder(category1.getId(), FOLDER_RM_3077);
|
// // create folders in both categories
|
||||||
createRecordFolder(copyCategoryId, COPY_FOLDER_RM_3077);
|
// CatFolder = createRecordFolder(Category1.getId(), folderRM3077);
|
||||||
|
// CopyCatFolder = createRecordFolder(CopyCategoryId, copyFolderRM3077);
|
||||||
// create record files
|
//
|
||||||
String electronicRecord = "RM-2801 electronic record";
|
// // create record files
|
||||||
Record elRecord = createElectronicRecord(catFolder.getId(), electronicRecord);
|
// String electronicRecord = "RM-2801 electronic record";
|
||||||
String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
// Record elRecord = createElectronicRecord(CatFolder.getId(), electronicRecord);
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(), catFolder.getName(), electronicRecord);
|
// String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
|
// getDataUser().usingAdmin().getAdminUser().getPassword(), CatFolder.getName(), electronicRecord);
|
||||||
String nonElectronicRecord = "RM-2801 non-electronic record";
|
//
|
||||||
Record nonElRecord = createNonElectronicRecord(catFolder.getId(), nonElectronicRecord);
|
// String nonElectronicRecord = "RM-2801 non-electronic record";
|
||||||
String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
// Record nonElRecord = createNonElectronicRecord(CatFolder.getId(), nonElectronicRecord);
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(), catFolder.getName(), nonElectronicRecord);
|
// String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
|
// getDataUser().usingAdmin().getAdminUser().getPassword(), CatFolder.getName(), nonElectronicRecord);
|
||||||
// link the records to copy folder, then complete them
|
//
|
||||||
List<String> recordLists = new ArrayList<>();
|
// // link the records to copy folder, then complete them
|
||||||
recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + elRecord.getId());
|
// List<String> recordLists = new ArrayList<>();
|
||||||
recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + nonElRecord.getId());
|
// recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + elRecord.getId());
|
||||||
|
// recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + nonElRecord.getId());
|
||||||
linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
//
|
||||||
getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK, COPY_CATEGORY_RM_3077 + "/" +
|
// linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
||||||
COPY_FOLDER_RM_3077, recordLists);
|
// getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,copyCategoryRM3077 + "/" +
|
||||||
recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), elRecordFullName);
|
// copyFolderRM3077, recordLists);
|
||||||
recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), nonElRecordFullName);
|
// recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), elRecordFullName);
|
||||||
|
// recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), nonElRecordFullName);
|
||||||
// edit disposition date
|
//
|
||||||
recordFoldersAPI.postFolderAction(getAdminUser().getUsername(),
|
// // edit disposition date
|
||||||
getAdminUser().getPassword(),editDispositionDateJson(), catFolder.getName());
|
// recordFoldersAPI.postFolderAction(getAdminUser().getUsername(),
|
||||||
|
// getAdminUser().getPassword(),editDispositionDateJson(),CatFolder.getName());
|
||||||
// cut off the Folder
|
//
|
||||||
recordFoldersAPI.postFolderAction(getAdminUser().getUsername(),
|
// // cut off the Folder
|
||||||
getAdminUser().getPassword(),new JSONObject().put("name","cutoff"), catFolder.getName());
|
// recordFoldersAPI.postFolderAction(getAdminUser().getUsername(),
|
||||||
|
// getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),CatFolder.getName());
|
||||||
// Verify the Content
|
//
|
||||||
Node electronicNode = getNode(elRecord.getId());
|
// // Verify the Content
|
||||||
assertTrue("The content of " + electronicRecord + " is available",
|
// Node electronicNode = getNode(elRecord.getId());
|
||||||
StringUtils.isEmpty(electronicNode.getNodeContent().getResponse().getBody().asString()));
|
// assertTrue("The content of " + electronicRecord + " is available",
|
||||||
|
// StringUtils.isEmpty(electronicNode.getNodeContent().getResponse().getBody().asString()));
|
||||||
// verify the Properties
|
//
|
||||||
AssertJUnit.assertNull("The properties are present even after cutting off the record.", elRecord.getProperties().getTitle());
|
// // verify the Properties
|
||||||
|
// AssertJUnit.assertNull("The properties are present even after cutting off the record.", elRecord.getProperties().getTitle());
|
||||||
// delete precondition
|
//
|
||||||
deleteRecordCategory(category1.getId());
|
// // delete precondition
|
||||||
deleteRecordCategory(copyCategoryId);
|
// deleteRecordCategory(Category1.getId());
|
||||||
}
|
// deleteRecordCategory(CopyCategoryId);
|
||||||
|
// }
|
||||||
/**
|
// /**
|
||||||
* Test covering RM-3060
|
// * Test covering RM-3060
|
||||||
* Check the disposition steps for a record can be executed
|
// * Check the disposition steps for a record can be executed
|
||||||
* When the record is linked to a folder with the same disposition schedule
|
// * When the record is linked to a folder with the same disposition schedule
|
||||||
* */
|
// * */
|
||||||
@Test
|
// @Ignore("ACS-5020")
|
||||||
@AlfrescoTest (jira = "RM-3060")
|
//// @Test
|
||||||
public void sameDispositionScheduleLinkedRecords() throws UnsupportedEncodingException {
|
// @AlfrescoTest (jira = "RM-3060")
|
||||||
|
// public void sameDispositionScheduleLinkedRecords() throws UnsupportedEncodingException {
|
||||||
// create a category with retention applied on records level
|
//
|
||||||
RecordCategory recordCategory = getRestAPIFactory().getFilePlansAPI(rmAdmin)
|
// // create a category with retention applied on records level
|
||||||
.createRootRecordCategory(RecordCategory.builder().name(FIRST_CATEGORY_RM_3060).build(),
|
// RecordCategory recordCategory = getRestAPIFactory().getFilePlansAPI(rmAdmin)
|
||||||
RecordCategory.DEFAULT_FILE_PLAN_ALIAS);
|
// .createRootRecordCategory(RecordCategory.builder().name(firstCategoryRM3060).build(),
|
||||||
dispositionScheduleService.createCategoryRetentionSchedule(FIRST_CATEGORY_RM_3060, true);
|
// RecordCategory.DEFAULT_FILE_PLAN_ALIAS);
|
||||||
dispositionScheduleService.addCutOffAfterPeriodStep(FIRST_CATEGORY_RM_3060, "week|1", DATE_FILED);
|
// dispositionScheduleService.createCategoryRetentionSchedule(firstCategoryRM3060, true);
|
||||||
dispositionScheduleService.addTransferAfterEventStep(
|
// dispositionScheduleService.addCutOffAfterPeriodStep(firstCategoryRM3060, "week|1", DATE_FILED);
|
||||||
FIRST_CATEGORY_RM_3060, TRANSFER_LOCATION, RMEvents.CASE_CLOSED.getEventName());
|
// dispositionScheduleService.addTransferAfterEventStep(firstCategoryRM3060, TRANSFER_LOCATION, RMEvents.CASE_CLOSED.getEventName());
|
||||||
dispositionScheduleService.addDestroyWithoutGhostingAfterPeriodStep(FIRST_CATEGORY_RM_3060, "week|1", CUT_OFF_DATE);
|
// dispositionScheduleService.addDestroyWithoutGhostingAfterPeriodStep(firstCategoryRM3060, "week|1", CUT_OFF_DATE);
|
||||||
|
//
|
||||||
// make a copy of the category created
|
// // make a copy of the category created
|
||||||
String categorySecondId = copyCategory(getAdminUser(), recordCategory.getId(), SECOND_CATEGORY_RM_3060);
|
// String categorySecondId = copyCategory(getAdminUser(), recordCategory.getId(), secondCategoryRM3060);
|
||||||
|
//
|
||||||
// create a folder on the category firstCategoryRM3060 with a complete electronic record
|
// // create a folder on the category firstCategoryRM3060 with a complete electronic record
|
||||||
RecordCategoryChild firstFolderRecordCategoryChild = createRecordFolder(recordCategory.getId(),
|
// RecordCategoryChild firstFolderRecordCategoryChild = createRecordFolder(recordCategory.getId(),firstFolderRM3060);
|
||||||
FIRST_FOLDER_RM_3060);
|
// Record firstElectronicRecord = createElectronicRecord(firstFolderRecordCategoryChild.getId(),electronicRecordRM3060);
|
||||||
Record firstElectronicRecord = createElectronicRecord(firstFolderRecordCategoryChild.getId(),
|
//
|
||||||
ELECTRONIC_RECORD_RM_3060);
|
// String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().getAdminUser().getUsername(),
|
||||||
|
// getDataUser().getAdminUser().getPassword(),firstFolderRM3060, electronicRecordRM3060);
|
||||||
String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().getAdminUser().getUsername(),
|
// String elRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
getDataUser().getAdminUser().getPassword(), FIRST_FOLDER_RM_3060, ELECTRONIC_RECORD_RM_3060);
|
// getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM3060 + "/" + firstFolderRM3060);
|
||||||
String elRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
//
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + FIRST_CATEGORY_RM_3060 + "/" + FIRST_FOLDER_RM_3060);
|
// recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(),
|
||||||
|
// getDataUser().getAdminUser().getPassword(), elRecordFullName);
|
||||||
recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(),
|
//
|
||||||
getDataUser().getAdminUser().getPassword(), elRecordFullName);
|
// // create a folder on the category secondCategoryRM3060 with a non electronic record
|
||||||
|
// RecordCategoryChild secondFolderRecordCategoryChild = createRecordFolder(categorySecondId,secondFolderRM3060);
|
||||||
// create a folder on the category secondCategoryRM3060 with a non electronic record
|
// Record secondNonElectronicRecord = createNonElectronicRecord(secondFolderRecordCategoryChild.getId(),nonElectronicRecordRM3060);
|
||||||
RecordCategoryChild secondFolderRecordCategoryChild = createRecordFolder(categorySecondId,
|
//
|
||||||
SECOND_FOLDER_RM_3060);
|
// // link the nonElectronicRecordRM3060 to firstFolderRM3060
|
||||||
Record secondNonElectronicRecord = createNonElectronicRecord(secondFolderRecordCategoryChild.getId(),
|
// List<String> recordLists = new ArrayList<>();
|
||||||
NON_ELECTRONIC_RECORD_RM_3060);
|
// recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId());
|
||||||
|
//
|
||||||
// link the nonElectronicRecordRM3060 to firstFolderRM3060
|
// linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
||||||
List<String> recordLists = new ArrayList<>();
|
// getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,secondCategoryRM3060 + "/" +
|
||||||
recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId());
|
// secondFolderRM3060, recordLists);
|
||||||
|
// String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
// getDataUser().usingAdmin().getAdminUser().getPassword(), secondFolderRM3060, secondNonElectronicRecord.getName());
|
||||||
getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK, SECOND_CATEGORY_RM_3060 + "/" +
|
// String nonElRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
SECOND_FOLDER_RM_3060, recordLists);
|
// getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + secondCategoryRM3060 + "/" + secondFolderRM3060);
|
||||||
String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
//
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(),
|
// // complete records and cut them off
|
||||||
SECOND_FOLDER_RM_3060, secondNonElectronicRecord.getName());
|
// recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(),
|
||||||
String nonElRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
// getDataUser().getAdminUser().getPassword(), nonElRecordFullName);
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + SECOND_CATEGORY_RM_3060
|
//
|
||||||
+ "/" + SECOND_FOLDER_RM_3060);
|
// // edit the disposition date
|
||||||
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
// complete records and cut them off
|
// getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef);
|
||||||
recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(),
|
//
|
||||||
getDataUser().getAdminUser().getPassword(), nonElRecordFullName);
|
// // cut off the record
|
||||||
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
// edit the disposition date
|
// getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),nonElRecordNameNodeRef);
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
//
|
||||||
getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef);
|
// //check the record is cut off
|
||||||
|
// AssertJUnit.assertTrue("The file " + nonElectronicRecordRM3060 + " has not been successfully cut off.", getRestAPIFactory().getRecordsAPI().getRecord(secondNonElectronicRecord.getId()).getAspectNames().contains(CUT_OFF_ASPECT));
|
||||||
// cut off the record
|
//
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
// // link the electronic record to secondFolderRM3060
|
||||||
getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),nonElRecordNameNodeRef);
|
// recordLists.clear();
|
||||||
|
// recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId());
|
||||||
//check the record is cut off
|
// linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
||||||
AssertJUnit.assertTrue("The file " + NON_ELECTRONIC_RECORD_RM_3060 + " has not been successfully cut off.", getRestAPIFactory().getRecordsAPI().getRecord(secondNonElectronicRecord.getId()).getAspectNames().contains(CUT_OFF_ASPECT));
|
// getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,secondCategoryRM3060 + "/" +
|
||||||
|
// secondFolderRM3060, recordLists);
|
||||||
// link the electronic record to secondFolderRM3060
|
//
|
||||||
recordLists.clear();
|
// // edit the disposition date and cut off the record
|
||||||
recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId());
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
// getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef);
|
||||||
getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK, SECOND_CATEGORY_RM_3060 + "/" +
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
SECOND_FOLDER_RM_3060, recordLists);
|
// getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),elRecordNameNodeRef);
|
||||||
|
//
|
||||||
// edit the disposition date and cut off the record
|
// AssertJUnit.assertTrue("The file " + electronicRecordRM3060 + " has not been successfully cut off.", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(CUT_OFF_ASPECT));
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
//
|
||||||
getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef);
|
// // open the record and complete the disposition schedule event
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
// rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(),
|
||||||
getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),elRecordNameNodeRef);
|
// getAdminUser().getPassword(), elRecordFullName, RMEvents.CASE_CLOSED, Instant.now());
|
||||||
|
// rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(),
|
||||||
AssertJUnit.assertTrue("The file " + ELECTRONIC_RECORD_RM_3060 + " has not been successfully cut off.", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(CUT_OFF_ASPECT));
|
// getAdminUser().getPassword(), nonElRecordFullName, RMEvents.CASE_CLOSED, Instant.now());
|
||||||
|
//
|
||||||
// open the record and complete the disposition schedule event
|
// // transfer the files & complete transfers
|
||||||
rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(),
|
// HttpResponse nonElRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
getAdminUser().getPassword(), elRecordFullName, RMEvents.CASE_CLOSED, Instant.now());
|
// getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(),
|
// getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + secondCategoryRM3060 + "/" + secondFolderRM3060));
|
||||||
getAdminUser().getPassword(), nonElRecordFullName, RMEvents.CASE_CLOSED, Instant.now());
|
//
|
||||||
|
// String nonElRecordNameTransferId = getTransferId(nonElRecordNameHttpResponse,nonElRecordNameNodeRef);
|
||||||
// transfer the files & complete transfers
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
HttpResponse nonElRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
// getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),nonElRecordNameTransferId);
|
||||||
getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
//
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + SECOND_CATEGORY_RM_3060
|
// HttpResponse elRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
+ "/" + SECOND_FOLDER_RM_3060));
|
// getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
|
// getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM3060 + "/" + firstFolderRM3060));
|
||||||
String nonElRecordNameTransferId = getTransferId(nonElRecordNameHttpResponse,nonElRecordNameNodeRef);
|
//
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
// String elRecordNameTransferId = getTransferId(elRecordNameHttpResponse,elRecordNameNodeRef);
|
||||||
getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),nonElRecordNameTransferId);
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
|
// getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),elRecordNameTransferId);
|
||||||
HttpResponse elRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
//
|
||||||
getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
// AssertJUnit.assertTrue("The file " + electronicRecordRM3060 + " has not been successfully transferred", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE));
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + FIRST_CATEGORY_RM_3060
|
// AssertJUnit.assertTrue("The file " + nonElectronicRecordRM3060 + " has not been successfully transferred.", getRestAPIFactory().getRecordsAPI().getRecord(secondNonElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE));
|
||||||
+ "/" + FIRST_FOLDER_RM_3060));
|
//
|
||||||
|
// // edit the disposition date for nonElectronicRecordRM3060 & electronicRecordRM3060
|
||||||
String elRecordNameTransferId = getTransferId(elRecordNameHttpResponse,elRecordNameNodeRef);
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
// getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef);
|
||||||
getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),elRecordNameTransferId);
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
|
// getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef);
|
||||||
AssertJUnit.assertTrue("The file " + ELECTRONIC_RECORD_RM_3060 + " has not been successfully transferred", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE));
|
//
|
||||||
AssertJUnit.assertTrue("The file " + NON_ELECTRONIC_RECORD_RM_3060 + " has not been successfully transferred.", getRestAPIFactory().getRecordsAPI().getRecord(secondNonElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE));
|
// // destroy nonElectronicRecordRM3060 & electronicRecordRM3060 records
|
||||||
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
// edit the disposition date for nonElectronicRecordRM3060 & electronicRecordRM3060
|
// getAdminUser().getPassword(),new JSONObject().put("name","destroy"),nonElRecordNameNodeRef);
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef);
|
// getAdminUser().getPassword(),new JSONObject().put("name","destroy"),elRecordNameNodeRef);
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
//
|
||||||
getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef);
|
// // check the file is not displayed
|
||||||
|
// assertNull("The file " + nonElectronicRecordRM3060 + " has not been successfully destroyed.", secondNonElectronicRecord.getContent());
|
||||||
// destroy nonElectronicRecordRM3060 & electronicRecordRM3060 records
|
// assertNull("The file " + electronicRecordRM3060 + " has not been successfully destroyed.", firstElectronicRecord.getContent());
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
//
|
||||||
getAdminUser().getPassword(),new JSONObject().put("name","destroy"),nonElRecordNameNodeRef);
|
// // delete precondition
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
// deleteRecordCategory(recordCategory.getId());
|
||||||
getAdminUser().getPassword(),new JSONObject().put("name","destroy"),elRecordNameNodeRef);
|
// deleteRecordCategory(categorySecondId);
|
||||||
|
// }
|
||||||
// check the file is not displayed
|
|
||||||
assertNull("The file " + NON_ELECTRONIC_RECORD_RM_3060 + " has not been successfully destroyed.", secondNonElectronicRecord.getContent());
|
|
||||||
assertNull("The file " + ELECTRONIC_RECORD_RM_3060 + " has not been successfully destroyed.", firstElectronicRecord.getContent());
|
|
||||||
|
|
||||||
// delete precondition
|
|
||||||
deleteRecordCategory(recordCategory.getId());
|
|
||||||
deleteRecordCategory(categorySecondId);
|
|
||||||
}
|
|
||||||
|
|
||||||
private String copyCategory(UserModel user, String categoryId, String copyName) {
|
private String copyCategory(UserModel user, String categoryId, String copyName) {
|
||||||
RepoTestModel repoTestModel = new RepoTestModel() {};
|
RepoTestModel repoTestModel = new RepoTestModel() {};
|
||||||
@@ -361,7 +354,7 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
|
|||||||
|
|
||||||
private String getTransferId(HttpResponse httpResponse,String nodeRef) {
|
private String getTransferId(HttpResponse httpResponse,String nodeRef) {
|
||||||
HttpEntity entity = httpResponse.getEntity();
|
HttpEntity entity = httpResponse.getEntity();
|
||||||
String responseString;
|
String responseString = null;
|
||||||
try {
|
try {
|
||||||
responseString = EntityUtils.toString(entity, "UTF-8");
|
responseString = EntityUtils.toString(entity, "UTF-8");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -372,6 +365,7 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
|
|||||||
.getJSONObject("results")
|
.getJSONObject("results")
|
||||||
.get(nodeRef)
|
.get(nodeRef)
|
||||||
.toString();
|
.toString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -380,39 +374,35 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
|
|||||||
|
|
||||||
// create a category with retention applied on records level
|
// create a category with retention applied on records level
|
||||||
RecordCategory catsameLevel1 = getRestAPIFactory().getFilePlansAPI(rmAdmin)
|
RecordCategory catsameLevel1 = getRestAPIFactory().getFilePlansAPI(rmAdmin)
|
||||||
.createRootRecordCategory(RecordCategory.builder().name(
|
.createRootRecordCategory(RecordCategory.builder().name(firstCategoryRM1622).build(),
|
||||||
FIRST_CATEGORY_RM_1622).build(),
|
|
||||||
RecordCategory.DEFAULT_FILE_PLAN_ALIAS);
|
RecordCategory.DEFAULT_FILE_PLAN_ALIAS);
|
||||||
RecordCategory catsameLevel2 = getRestAPIFactory().getFilePlansAPI(rmAdmin)
|
RecordCategory catsameLevel2 = getRestAPIFactory().getFilePlansAPI(rmAdmin)
|
||||||
.createRootRecordCategory(RecordCategory.builder().name(
|
.createRootRecordCategory(RecordCategory.builder().name(secondCategoryRM1622).build(),
|
||||||
SECOND_CATEGORY_RM_1622).build(),
|
|
||||||
RecordCategory.DEFAULT_FILE_PLAN_ALIAS);
|
RecordCategory.DEFAULT_FILE_PLAN_ALIAS);
|
||||||
|
|
||||||
// create retention schedule applied on records for category 1
|
// create retention schedule applied on records for category 1
|
||||||
dispositionScheduleService.createCategoryRetentionSchedule(FIRST_CATEGORY_RM_1622, true);
|
dispositionScheduleService.createCategoryRetentionSchedule(firstCategoryRM1622, true);
|
||||||
|
|
||||||
// with retain immediately after record creation date and cut 1 day after record creation date
|
// with retain immediately after record creation date and cut 1 day after record creation date
|
||||||
dispositionScheduleService.addCutOffAfterPeriodStep(FIRST_CATEGORY_RM_1622, "day|1", DATE_FILED);
|
dispositionScheduleService.addCutOffAfterPeriodStep(firstCategoryRM1622, "day|1", DATE_FILED);
|
||||||
|
|
||||||
|
|
||||||
// create a folder on the category firstCategoryRM1622 with a complete electronic record
|
// create a folder on the category firstCategoryRM1622 with a complete electronic record
|
||||||
RecordCategoryChild firstFolderRecordCategoryChild = createRecordFolder(catsameLevel1.getId(),
|
RecordCategoryChild firstFolderRecordCategoryChild = createRecordFolder(catsameLevel1.getId(),firstFolderRM1622);
|
||||||
FIRST_FOLDER_RM_1622);
|
Record firstElectronicRecord = createElectronicRecord(firstFolderRecordCategoryChild.getId(),electronicRecordRM1622);
|
||||||
Record firstElectronicRecord = createElectronicRecord(firstFolderRecordCategoryChild.getId(),
|
|
||||||
ELECTRONIC_RECORD_RM_1622);
|
|
||||||
|
|
||||||
String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().getAdminUser().getUsername(),
|
String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().getAdminUser().getUsername(),
|
||||||
getDataUser().getAdminUser().getPassword(), FIRST_FOLDER_RM_1622, ELECTRONIC_RECORD_RM_1622);
|
getDataUser().getAdminUser().getPassword(),firstFolderRM1622, electronicRecordRM1622);
|
||||||
recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
String elRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + FIRST_CATEGORY_RM_1622 + "/" + FIRST_FOLDER_RM_1622);
|
getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM1622 + "/" + firstFolderRM1622);
|
||||||
|
|
||||||
recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(),
|
recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(),
|
||||||
getDataUser().getAdminUser().getPassword(), elRecordFullName);
|
getDataUser().getAdminUser().getPassword(), elRecordFullName);
|
||||||
|
|
||||||
// create a folder on the category secondCategoryRM1622 with a non electronic record
|
// create a folder on the category secondCategoryRM1622 with a non electronic record
|
||||||
createRecordFolder(catsameLevel2.getId(), SECOND_FOLDER_RM_1622);
|
RecordCategoryChild secondFolderRecordCategoryChild = createRecordFolder(catsameLevel2.getId(),secondFolderRM1622);
|
||||||
String elRecordNameNodeRefs = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
String elRecordNameNodeRefs = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + FIRST_CATEGORY_RM_1622 + "/" + FIRST_FOLDER_RM_1622);
|
getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM1622 + "/" + firstFolderRM1622);
|
||||||
|
|
||||||
|
|
||||||
// link it to the folder in second category through the details page
|
// link it to the folder in second category through the details page
|
||||||
@@ -420,12 +410,14 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
|
|||||||
recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + firstElectronicRecord.getId());
|
recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + firstElectronicRecord.getId());
|
||||||
|
|
||||||
linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
||||||
getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK, SECOND_CATEGORY_RM_1622 + "/" +
|
getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,secondCategoryRM1622 + "/" +
|
||||||
SECOND_FOLDER_RM_1622, recordLists);
|
secondFolderRM1622, recordLists);
|
||||||
|
|
||||||
// edit disposition date
|
// edit disposition date
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRefs);
|
getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRefs);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test (dependsOnMethods = {"sameLevelDispositionScheduleStepsPeriodsCalculation" })
|
@Test (dependsOnMethods = {"sameLevelDispositionScheduleStepsPeriodsCalculation" })
|
||||||
@@ -436,4 +428,4 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
|
|||||||
// Verify the status code
|
// Verify the status code
|
||||||
assertStatusCode(NO_CONTENT);
|
assertStatusCode(NO_CONTENT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
Binary file not shown.
@@ -48,7 +48,7 @@ function tagQuery()
|
|||||||
}
|
}
|
||||||
query += "ASPECT:\"{http://www.alfresco.org/model/content/1.0}taggable\"";
|
query += "ASPECT:\"{http://www.alfresco.org/model/content/1.0}taggable\"";
|
||||||
//MNT-2118 Share inconsistencies when displaying locked files with tags
|
//MNT-2118 Share inconsistencies when displaying locked files with tags
|
||||||
query += " AND -ASPECT:\"{http://www.alfresco.org/model/content/1.0}workingcopy\"";
|
query += " -ASPECT:\"{http://www.alfresco.org/model/content/1.0}workingcopy\"";
|
||||||
|
|
||||||
// MNT-20091 check to prevent cm:taggable with NULL
|
// MNT-20091 check to prevent cm:taggable with NULL
|
||||||
query += " AND ISNOTNULL:\"{http://www.alfresco.org/model/content/1.0}taggable\"";
|
query += " AND ISNOTNULL:\"{http://www.alfresco.org/model/content/1.0}taggable\"";
|
||||||
@@ -60,7 +60,7 @@ function tagQuery()
|
|||||||
query: query,
|
query: query,
|
||||||
language: "lucene",
|
language: "lucene",
|
||||||
page: {
|
page: {
|
||||||
// query minimum rows because all useful info will come with facets
|
// query minimum rows because all usefull info will come with facets
|
||||||
maxItems: 1,
|
maxItems: 1,
|
||||||
skipCount: 0
|
skipCount: 0
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ function getCategoryNode()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var queryPath = "/" + catAspect + "/" + encodePath(path);
|
var queryPath = "/" + catAspect + "/" + encodePath(path);
|
||||||
categoryResults = search.luceneSearch("+PATH:\"" + queryPath + "/*\" AND -PATH:\"" + queryPath + "/member\"");
|
categoryResults = search.luceneSearch("+PATH:\"" + queryPath + "/*\" -PATH:\"" + queryPath + "/member\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
// make each result an object and indicate it is selectable in the UI
|
// make each result an object and indicate it is selectable in the UI
|
||||||
@@ -71,4 +71,4 @@ function encodePath(path)
|
|||||||
function sortByName(a, b)
|
function sortByName(a, b)
|
||||||
{
|
{
|
||||||
return (b.node.name.toLowerCase() > a.node.name.toLowerCase() ? -1 : 1);
|
return (b.node.name.toLowerCase() > a.node.name.toLowerCase() ? -1 : 1);
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ function main()
|
|||||||
{
|
{
|
||||||
query = "+PATH:\"" + parsedArgs.pathNode.qnamePath + "//*\" ";
|
query = "+PATH:\"" + parsedArgs.pathNode.qnamePath + "//*\" ";
|
||||||
}
|
}
|
||||||
query += "AND +TYPE:\"cm:content\" AND +@cm\\:content.mimetype:\"image/*\"";
|
query += "+TYPE:\"cm:content\" +@cm\\:content.mimetype:image/*";
|
||||||
|
|
||||||
// Sort the list before trimming to page chunks
|
// Sort the list before trimming to page chunks
|
||||||
assets = search.query(
|
assets = search.query(
|
||||||
@@ -52,4 +52,4 @@ function main()
|
|||||||
/**
|
/**
|
||||||
* Images List Component: images
|
* Images List Component: images
|
||||||
*/
|
*/
|
||||||
model.images = main();
|
model.images = main();
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
@@ -92,16 +92,15 @@ public class HttpClient4Factory
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Setting a connectionManager overrides these properties
|
//Setting a connectionManager overrides these properties
|
||||||
config.getMaxTotalConnections().ifPresent(v -> clientBuilder.setMaxConnTotal(v));
|
clientBuilder.setMaxConnTotal(config.getMaxTotalConnections());
|
||||||
config.getMaxHostConnections().ifPresent(v -> clientBuilder.setMaxConnPerRoute(v));
|
clientBuilder.setMaxConnPerRoute(config.getMaxHostConnections());
|
||||||
}
|
}
|
||||||
|
|
||||||
RequestConfig.Builder requestConfigBuilder = RequestConfig.custom();
|
RequestConfig requestConfig = RequestConfig.custom()
|
||||||
config.getConnectionTimeout().ifPresent(v -> requestConfigBuilder.setConnectTimeout(v));
|
.setConnectTimeout(config.getConnectionTimeout())
|
||||||
config.getConnectionRequestTimeout().ifPresent(v -> requestConfigBuilder.setConnectionRequestTimeout(v));
|
.setSocketTimeout(config.getSocketTimeout())
|
||||||
config.getSocketTimeout().ifPresent(v -> requestConfigBuilder.setSocketTimeout(v));
|
.setConnectionRequestTimeout(config.getConnectionRequestTimeout())
|
||||||
|
.build();
|
||||||
RequestConfig requestConfig = requestConfigBuilder.build();
|
|
||||||
|
|
||||||
clientBuilder.setDefaultRequestConfig(requestConfig);
|
clientBuilder.setDefaultRequestConfig(requestConfig);
|
||||||
|
|
||||||
@@ -136,8 +135,8 @@ public class HttpClient4Factory
|
|||||||
.register("http", PlainConnectionSocketFactory.getSocketFactory())
|
.register("http", PlainConnectionSocketFactory.getSocketFactory())
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
config.getMaxTotalConnections().ifPresent(v -> poolingHttpClientConnectionManager.setMaxTotal(v));
|
poolingHttpClientConnectionManager.setMaxTotal(config.getMaxTotalConnections());
|
||||||
config.getMaxHostConnections().ifPresent(v -> poolingHttpClientConnectionManager.setDefaultMaxPerRoute(v));
|
poolingHttpClientConnectionManager.setDefaultMaxPerRoute(config.getMaxHostConnections());
|
||||||
|
|
||||||
return poolingHttpClientConnectionManager;
|
return poolingHttpClientConnectionManager;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,27 +85,17 @@ public class HttpClientConfig
|
|||||||
this.keyStore = new AlfrescoKeyStoreImpl(sslEncryptionParameters.getKeyStoreParameters(), keyResourceLoader);
|
this.keyStore = new AlfrescoKeyStoreImpl(sslEncryptionParameters.getKeyStoreParameters(), keyResourceLoader);
|
||||||
this.trustStore = new AlfrescoKeyStoreImpl(sslEncryptionParameters.getTrustStoreParameters(), keyResourceLoader);
|
this.trustStore = new AlfrescoKeyStoreImpl(sslEncryptionParameters.getTrustStoreParameters(), keyResourceLoader);
|
||||||
|
|
||||||
config = retrieveConfig();
|
config = retrieveConfig(serviceName);
|
||||||
checkUnsupportedProperties(config);
|
checkUnsupportedProperties(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method used for retrieving HttpClient config from Global Properties
|
* Method used for retrieving HttpClient config from Global Properties
|
||||||
* that can also have values provided/overridden through System Properties
|
* @param serviceName name of used service
|
||||||
*
|
|
||||||
* @return map of properties
|
* @return map of properties
|
||||||
*/
|
*/
|
||||||
private Map<String, String> retrieveConfig()
|
private Map<String, String> retrieveConfig(String serviceName)
|
||||||
{
|
{
|
||||||
Map<String, String> resultProperties = getHttpClientPropertiesForService(properties);
|
|
||||||
Map<String, String> systemProperties = getHttpClientPropertiesForService(System.getProperties());
|
|
||||||
|
|
||||||
systemProperties.forEach((k, v) -> resultProperties.put(k, v)); //Override/Add to Global Properties results with values from System Properties
|
|
||||||
|
|
||||||
return resultProperties;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Map<String, String> getHttpClientPropertiesForService(Properties properties) {
|
|
||||||
return properties.keySet().stream()
|
return properties.keySet().stream()
|
||||||
.filter(key -> key instanceof String)
|
.filter(key -> key instanceof String)
|
||||||
.map(Object::toString)
|
.map(Object::toString)
|
||||||
@@ -122,75 +112,79 @@ public class HttpClientConfig
|
|||||||
.forEach(propertyName -> LOGGER.warn(String.format("For service [%s], an unsupported property [%s] is set", serviceName, propertyName)));
|
.forEach(propertyName -> LOGGER.warn(String.format("For service [%s], an unsupported property [%s] is set", serviceName, propertyName)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Optional<Integer> getIntegerProperty(HttpClientPropertiesEnum property)
|
private Integer getIntegerProperty(HttpClientPropertiesEnum property)
|
||||||
{
|
{
|
||||||
Optional<String> optionalProperty = extractValueFromConfig(property);
|
return Integer.parseInt(extractValueFromConfig(property).orElse("0"));
|
||||||
|
|
||||||
return optionalProperty.isPresent() ? Optional.of(Integer.parseInt(optionalProperty.get())) : Optional.empty();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Optional<Boolean> getBooleanProperty(HttpClientPropertiesEnum property)
|
private Boolean getBooleanProperty(HttpClientPropertiesEnum property)
|
||||||
{
|
{
|
||||||
Optional<String> optionalProperty = extractValueFromConfig(property);
|
return Boolean.parseBoolean(extractValueFromConfig(property).orElse("false"));
|
||||||
|
|
||||||
return optionalProperty.isPresent() ? Optional.of(Boolean.parseBoolean(optionalProperty.get())) : Optional.empty();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Optional<String> extractValueFromConfig(HttpClientPropertiesEnum property)
|
private Optional<String> extractValueFromConfig(HttpClientPropertiesEnum property)
|
||||||
{
|
{
|
||||||
return Optional.ofNullable(config.get(property.name));
|
Optional<String> optionalProperty = Optional.ofNullable(config.get(property.name));
|
||||||
|
if(property.isRequired && optionalProperty.isEmpty())
|
||||||
|
{
|
||||||
|
String msg = String.format("Required property: '%s' is empty.", property.name);
|
||||||
|
throw new HttpClientException(msg);
|
||||||
|
}
|
||||||
|
return optionalProperty;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<Integer> getConnectionTimeout()
|
public Integer getConnectionTimeout()
|
||||||
{
|
{
|
||||||
return getIntegerProperty(HttpClientPropertiesEnum.CONNECTION_REQUEST_TIMEOUT);
|
return getIntegerProperty(HttpClientPropertiesEnum.CONNECTION_REQUEST_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<Integer> getSocketTimeout()
|
public Integer getSocketTimeout()
|
||||||
{
|
{
|
||||||
return getIntegerProperty(HttpClientPropertiesEnum.SOCKET_TIMEOUT);
|
return getIntegerProperty(HttpClientPropertiesEnum.SOCKET_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<Integer> getConnectionRequestTimeout()
|
public Integer getConnectionRequestTimeout()
|
||||||
{
|
{
|
||||||
return getIntegerProperty(HttpClientPropertiesEnum.CONNECTION_REQUEST_TIMEOUT);
|
return getIntegerProperty(HttpClientPropertiesEnum.CONNECTION_REQUEST_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<Integer> getMaxTotalConnections()
|
public Integer getMaxTotalConnections()
|
||||||
{
|
{
|
||||||
return getIntegerProperty(HttpClientPropertiesEnum.MAX_TOTAL_CONNECTIONS);
|
return getIntegerProperty(HttpClientPropertiesEnum.MAX_TOTAL_CONNECTIONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<Integer> getMaxHostConnections()
|
public Integer getMaxHostConnections()
|
||||||
{
|
{
|
||||||
return getIntegerProperty(HttpClientPropertiesEnum.MAX_HOST_CONNECTIONS);
|
return getIntegerProperty(HttpClientPropertiesEnum.MAX_HOST_CONNECTIONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isMTLSEnabled()
|
public Boolean isMTLSEnabled()
|
||||||
{
|
{
|
||||||
return getBooleanProperty(HttpClientPropertiesEnum.MTLS_ENABLED).orElse(Boolean.FALSE);
|
return getBooleanProperty(HttpClientPropertiesEnum.MTLS_ENABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isHostnameVerificationDisabled()
|
public boolean isHostnameVerificationDisabled()
|
||||||
{
|
{
|
||||||
return getBooleanProperty(HttpClientPropertiesEnum.HOSTNAME_VERIFICATION_DISABLED).orElse(Boolean.FALSE);
|
return getBooleanProperty(HttpClientPropertiesEnum.HOSTNAME_VERIFICATION_DISABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum HttpClientPropertiesEnum
|
private enum HttpClientPropertiesEnum
|
||||||
{
|
{
|
||||||
CONNECTION_TIMEOUT("connectionTimeout"),
|
CONNECTION_TIMEOUT("connectionTimeout", true),
|
||||||
SOCKET_TIMEOUT("socketTimeout"),
|
SOCKET_TIMEOUT("socketTimeout", true),
|
||||||
CONNECTION_REQUEST_TIMEOUT("connectionRequestTimeout"),
|
CONNECTION_REQUEST_TIMEOUT("connectionRequestTimeout", true),
|
||||||
MAX_TOTAL_CONNECTIONS("maxTotalConnections"),
|
MAX_TOTAL_CONNECTIONS("maxTotalConnections", true),
|
||||||
MAX_HOST_CONNECTIONS("maxHostConnections"),
|
MAX_HOST_CONNECTIONS("maxHostConnections", true),
|
||||||
HOSTNAME_VERIFICATION_DISABLED("hostnameVerificationDisabled"),
|
HOSTNAME_VERIFICATION_DISABLED("hostnameVerificationDisabled", false),
|
||||||
MTLS_ENABLED("mTLSEnabled");
|
MTLS_ENABLED("mTLSEnabled", true);
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
private final Boolean isRequired;
|
||||||
|
|
||||||
HttpClientPropertiesEnum(String propertyName)
|
HttpClientPropertiesEnum(String propertyName, Boolean isRequired)
|
||||||
{
|
{
|
||||||
this.name = propertyName;
|
this.name = propertyName;
|
||||||
|
this.isRequired = isRequired;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final List<String> supportedProperties = new ArrayList<>();
|
private static final List<String> supportedProperties = new ArrayList<>();
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
@@ -9,6 +9,6 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<organization>
|
<organization>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -25,8 +25,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.rest.model;
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
import org.alfresco.rest.core.IRestModel;
|
import org.alfresco.rest.core.IRestModel;
|
||||||
@@ -45,7 +43,6 @@ public class RestPersonFavoritesModel extends TestModel implements IRestModel<Re
|
|||||||
|
|
||||||
private String targetGuid;
|
private String targetGuid;
|
||||||
private String createdAt;
|
private String createdAt;
|
||||||
private List<String> allowableOperations;
|
|
||||||
|
|
||||||
private RestTargetModel target;
|
private RestTargetModel target;
|
||||||
|
|
||||||
@@ -89,12 +86,4 @@ public class RestPersonFavoritesModel extends TestModel implements IRestModel<Re
|
|||||||
{
|
{
|
||||||
this.createdAt = createdAt;
|
this.createdAt = createdAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getAllowableOperations() {
|
|
||||||
return allowableOperations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAllowableOperations(List<String> allowableOperations) {
|
|
||||||
this.allowableOperations = allowableOperations;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,8 +101,6 @@ public class SearchNodeModel extends TestModel implements IRestModel<SearchNodeM
|
|||||||
|
|
||||||
private String location;
|
private String location;
|
||||||
|
|
||||||
private Boolean isFavorite;
|
|
||||||
|
|
||||||
public Map<String, Object> getAssociation()
|
public Map<String, Object> getAssociation()
|
||||||
{
|
{
|
||||||
return association;
|
return association;
|
||||||
@@ -328,12 +326,5 @@ public class SearchNodeModel extends TestModel implements IRestModel<SearchNodeM
|
|||||||
{
|
{
|
||||||
this.location = location;
|
this.location = location;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean isFavorite() {
|
|
||||||
return isFavorite;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsFavorite(Boolean favorite) {
|
|
||||||
isFavorite = favorite;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,11 @@
|
|||||||
package org.alfresco.rest.favorites;
|
package org.alfresco.rest.favorites;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||||
import org.alfresco.rest.RestTest;
|
import org.alfresco.rest.RestTest;
|
||||||
import org.alfresco.rest.model.RestErrorModel;
|
import org.alfresco.rest.model.RestErrorModel;
|
||||||
import org.alfresco.rest.model.RestPersonFavoritesModel;
|
import org.alfresco.rest.model.RestPersonFavoritesModel;
|
||||||
import org.alfresco.rest.model.RestPersonFavoritesModelsCollection;
|
import org.alfresco.rest.model.RestPersonFavoritesModelsCollection;
|
||||||
import org.alfresco.rest.model.RestSiteModel;
|
import org.alfresco.rest.model.RestSiteModel;
|
||||||
import org.alfresco.rest.search.RestRequestQueryModel;
|
|
||||||
import org.alfresco.rest.search.SearchRequest;
|
|
||||||
import org.alfresco.utility.Utility;
|
|
||||||
import org.alfresco.utility.constants.UserRole;
|
import org.alfresco.utility.constants.UserRole;
|
||||||
import org.alfresco.utility.data.DataUser.ListUserWithRoles;
|
import org.alfresco.utility.data.DataUser.ListUserWithRoles;
|
||||||
import org.alfresco.utility.model.FileModel;
|
import org.alfresco.utility.model.FileModel;
|
||||||
@@ -20,14 +15,12 @@ import org.alfresco.utility.model.TestGroup;
|
|||||||
import org.alfresco.utility.model.UserModel;
|
import org.alfresco.utility.model.UserModel;
|
||||||
import org.alfresco.utility.testrail.ExecutionType;
|
import org.alfresco.utility.testrail.ExecutionType;
|
||||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||||
import org.hamcrest.Matchers;
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
public class GetFavoritesTests extends RestTest
|
public class GetFavoritesTests extends RestTest
|
||||||
{
|
{
|
||||||
private static final String ALLOWABLE_OPERATIONS = "allowableOperations";
|
|
||||||
private UserModel adminUserModel, userModel;
|
private UserModel adminUserModel, userModel;
|
||||||
private SiteModel firstSiteModel;
|
private SiteModel firstSiteModel;
|
||||||
private SiteModel secondSiteModel;
|
private SiteModel secondSiteModel;
|
||||||
@@ -67,7 +60,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||||
description = "Verify Manager user gets favorites with Rest API and status code is 200")
|
description = "Verify Manager user gets favorites with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||||
public void managerIsAbleToRetrieveFavorites()
|
public void managerIsAbleToRetrieveFavorites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -83,7 +76,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
description = "Verify user gets status code 401 if authentication call fails")
|
description = "Verify user gets status code 401 if authentication call fails")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||||
// @Bug(id = "MNT-16904", description = "It fails only on environment with tenants")
|
// @Bug(id = "MNT-16904", description = "It fails only on environment with tenants")
|
||||||
public void userIsNotAbleToRetrieveFavoritesIfAuthenticationFails()
|
public void userIsNotAbleToRetrieveFavoritesIfAuthenticationFails() throws Exception
|
||||||
{
|
{
|
||||||
UserModel siteManager = firstSiteUsers.getOneUserWithRole(UserRole.SiteManager);
|
UserModel siteManager = firstSiteUsers.getOneUserWithRole(UserRole.SiteManager);
|
||||||
siteManager.setPassword("wrongPassword");
|
siteManager.setPassword("wrongPassword");
|
||||||
@@ -94,7 +87,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify Admin user gets favorites sites with Rest API and status code is 200")
|
description = "Verify Admin user gets favorites sites with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void adminIsAbleToRetrieveFavoritesSites()
|
public void adminIsAbleToRetrieveFavoritesSites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(adminUserModel).addSiteToFavorites(firstSiteModel);
|
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(adminUserModel).addSiteToFavorites(firstSiteModel);
|
||||||
restClient.withCoreAPI().usingUser(adminUserModel).addSiteToFavorites(secondSiteModel);
|
restClient.withCoreAPI().usingUser(adminUserModel).addSiteToFavorites(secondSiteModel);
|
||||||
@@ -109,7 +102,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify Admin user gets favorites folders with Rest API and status code is 200")
|
description = "Verify Admin user gets favorites folders with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void adminIsAbleToRetrieveFavoritesFolders()
|
public void adminIsAbleToRetrieveFavoritesFolders() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(adminUserModel).addFolderToFavorites(firstFolderModel);
|
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(adminUserModel).addFolderToFavorites(firstFolderModel);
|
||||||
restClient.withCoreAPI().usingUser(adminUserModel).addFolderToFavorites(secondFolderModel);
|
restClient.withCoreAPI().usingUser(adminUserModel).addFolderToFavorites(secondFolderModel);
|
||||||
@@ -124,7 +117,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify Admin user gets favorites files with Rest API and status code is 200")
|
description = "Verify Admin user gets favorites files with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void adminIsAbleToRetrieveFavoritesFiles()
|
public void adminIsAbleToRetrieveFavoritesFiles() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(adminUserModel).addFileToFavorites(firstFileModel);
|
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(adminUserModel).addFileToFavorites(firstFileModel);
|
||||||
restClient.withCoreAPI().usingUser(adminUserModel).addFileToFavorites(secondFileModel);
|
restClient.withCoreAPI().usingUser(adminUserModel).addFileToFavorites(secondFileModel);
|
||||||
@@ -139,7 +132,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify Collaborator user gets favorites with Rest API and status code is 200")
|
description = "Verify Collaborator user gets favorites with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void collaboratorIsAbleToRetrieveFavorites()
|
public void collaboratorIsAbleToRetrieveFavorites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator))
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator))
|
||||||
.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -154,7 +147,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify Contributor user gets favorites with Rest API and status code is 200")
|
description = "Verify Contributor user gets favorites with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void contributorIsAbleToRetrieveFavorites()
|
public void contributorIsAbleToRetrieveFavorites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteContributor))
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteContributor))
|
||||||
.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -169,7 +162,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify Consumer user gets favorites with Rest API and status code is 200")
|
description = "Verify Consumer user gets favorites with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void consumerIsAbleToRetrieveFavorites()
|
public void consumerIsAbleToRetrieveFavorites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer))
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer))
|
||||||
.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -184,7 +177,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify user doesn't have permission to get favorites of another user with Rest API and status code is 404")
|
description = "Verify user doesn't have permission to get favorites of another user with Rest API and status code is 404")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsNotAbleToRetrieveFavoritesOfAnotherUser()
|
public void userIsNotAbleToRetrieveFavoritesOfAnotherUser() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer))
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer))
|
||||||
.withCoreAPI().usingUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator)).getFavorites();
|
.withCoreAPI().usingUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator)).getFavorites();
|
||||||
@@ -195,7 +188,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify user doesn't have permission to get favorites of admin user with Rest API and status code is 200")
|
description = "Verify user doesn't have permission to get favorites of admin user with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsNotAbleToRetrieveFavoritesOfAdminUser()
|
public void userIsNotAbleToRetrieveFavoritesOfAdminUser() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer)).withCoreAPI()
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer)).withCoreAPI()
|
||||||
.usingUser(adminUserModel).getFavorites();
|
.usingUser(adminUserModel).getFavorites();
|
||||||
@@ -206,7 +199,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify admin user doesn't have permission to get favorites of another user with Rest API and status code is 200")
|
description = "Verify admin user doesn't have permission to get favorites of another user with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void adminIsNotAbleToRetrieveFavoritesOfAnotherUser()
|
public void adminIsNotAbleToRetrieveFavoritesOfAnotherUser() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator))
|
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator))
|
||||||
.getFavorites();
|
.getFavorites();
|
||||||
@@ -217,7 +210,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify User gets only favorites sites with Rest API and status code is 200")
|
description = "Verify User gets only favorites sites with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToRetrieveOnlyFavoritesSites()
|
public void userIsAbleToRetrieveOnlyFavoritesSites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -235,7 +228,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify User gets only favorites files with Rest API and status code is 200")
|
description = "Verify User gets only favorites files with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToRetrieveOnlyFavoritesFiles()
|
public void userIsAbleToRetrieveOnlyFavoritesFiles() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator));
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -253,7 +246,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify User gets only favorites folders with Rest API and status code is 200")
|
description = "Verify User gets only favorites folders with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToRetrieveOnlyFavoritesFolders()
|
public void userIsAbleToRetrieveOnlyFavoritesFolders() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator));
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -271,7 +264,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify User gets only favorites files or folders with Rest API and status code is 200")
|
description = "Verify User gets only favorites files or folders with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToRetrieveFavoritesFilesOrFolders()
|
public void userIsAbleToRetrieveFavoritesFilesOrFolders() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer));
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -292,7 +285,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify User gets only favorites files or sites with Rest API and status code is 200")
|
description = "Verify User gets only favorites files or sites with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToRetrieveFavoritesFilesOrSites()
|
public void userIsAbleToRetrieveFavoritesFilesOrSites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -313,7 +306,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify User gets only favorites folders or sites with Rest API and status code is 200")
|
description = "Verify User gets only favorites folders or sites with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToRetrieveFavoritesFoldersOrSites()
|
public void userIsAbleToRetrieveFavoritesFoldersOrSites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -334,7 +327,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify User gets all favorites with Rest API and status code is 200")
|
description = "Verify User gets all favorites with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToRetrieveAllFavorites()
|
public void userIsAbleToRetrieveAllFavorites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator));
|
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -365,7 +358,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify request for a user with no favorites returns status 200")
|
description = "Verify request for a user with no favorites returns status 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userHasNoFavorites()
|
public void userHasNoFavorites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteContributor));
|
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteContributor));
|
||||||
|
|
||||||
@@ -377,7 +370,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify request using invalid where parameter returns status 400")
|
description = "Verify request using invalid where parameter returns status 400")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void getFavoritesUsingInvalidWhereParameter()
|
public void getFavoritesUsingInvalidWhereParameter() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer));
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -393,7 +386,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify User gets correct favorites after deleting a favorite")
|
description = "Verify User gets correct favorites after deleting a favorite")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void checkFavoriteFolderIsRemoved()
|
public void checkFavoriteFolderIsRemoved() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -411,7 +404,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify get favorites specifying -me- string in place of <personid> for request")
|
description = "Verify get favorites specifying -me- string in place of <personid> for request")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToGetFavoritesWhenUsingMeAsUsername()
|
public void userIsAbleToGetFavoritesWhenUsingMeAsUsername() throws Exception
|
||||||
{
|
{
|
||||||
userFavorites = restClient.authenticateUser(userModel).withCoreAPI().usingMe().getFavorites();
|
userFavorites = restClient.authenticateUser(userModel).withCoreAPI().usingMe().getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
@@ -421,7 +414,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify get favorites using empty for where parameter for request")
|
description = "Verify get favorites using empty for where parameter for request")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToGetFavoritesWhenUsingEmptyWhereParameter()
|
public void userIsAbleToGetFavoritesWhenUsingEmptyWhereParameter() throws Exception
|
||||||
{
|
{
|
||||||
userFavorites = restClient.authenticateUser(adminUserModel).withCoreAPI().usingAuthUser().where().getFavorites();
|
userFavorites = restClient.authenticateUser(adminUserModel).withCoreAPI().usingAuthUser().where().getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
||||||
@@ -431,7 +424,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify that for invalid maxItems parameter status code returned is 400.")
|
description = "Verify that for invalid maxItems parameter status code returned is 400.")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void checkInvalidMaxItemsStatusCode()
|
public void checkInvalidMaxItemsStatusCode() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(adminUserModel).withParams("maxItems=AB").withCoreAPI().usingUser(adminUserModel).getFavorites();
|
restClient.authenticateUser(adminUserModel).withParams("maxItems=AB").withCoreAPI().usingUser(adminUserModel).getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError().containsSummary("Invalid paging parameter");
|
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError().containsSummary("Invalid paging parameter");
|
||||||
@@ -440,7 +433,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify that for invalid skipCount parameter status code returned is 400.")
|
description = "Verify that for invalid skipCount parameter status code returned is 400.")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void checkInvalidSkipCountStatusCode()
|
public void checkInvalidSkipCountStatusCode() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(adminUserModel).withParams("skipCount=AB").withCoreAPI().usingUser(adminUserModel).getFavorites();
|
restClient.authenticateUser(adminUserModel).withParams("skipCount=AB").withCoreAPI().usingUser(adminUserModel).getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError().containsSummary("Invalid paging parameter");
|
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError().containsSummary("Invalid paging parameter");
|
||||||
@@ -449,7 +442,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify get favorites when using invalid network id for non-tenant user")
|
description = "Verify get favorites when using invalid network id for non-tenant user")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void getFavoritesWhenNetworkIdIsInvalid()
|
public void getFavoritesWhenNetworkIdIsInvalid() throws Exception
|
||||||
{
|
{
|
||||||
UserModel networkUserModel = dataUser.createRandomTestUser();
|
UserModel networkUserModel = dataUser.createRandomTestUser();
|
||||||
networkUserModel.setDomain("invalidNetwork");
|
networkUserModel.setDomain("invalidNetwork");
|
||||||
@@ -460,7 +453,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify get favorites using AND instead of OR in where parameter for request")
|
description = "Verify get favorites using AND instead of OR in where parameter for request")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsNotAbleToGetFavoritesWhenUsingANDInWhereParameter()
|
public void userIsNotAbleToGetFavoritesWhenUsingANDInWhereParameter() throws Exception
|
||||||
{
|
{
|
||||||
userFavorites = restClient.withCoreAPI().usingAuthUser().where().targetFolderExist().invalidWhereParameter("AND").targetFileExist().getFavorites();
|
userFavorites = restClient.withCoreAPI().usingAuthUser().where().targetFolderExist().invalidWhereParameter("AND").targetFileExist().getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
||||||
@@ -470,7 +463,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify get favorites using wrong name instead of EXISTS in where parameter for request")
|
description = "Verify get favorites using wrong name instead of EXISTS in where parameter for request")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsNotAbleToGetFavoritesWhenUsingWrongWhereParameter()
|
public void userIsNotAbleToGetFavoritesWhenUsingWrongWhereParameter() throws Exception
|
||||||
{
|
{
|
||||||
userFavorites = restClient.withCoreAPI().usingAuthUser().where().invalidWhereParameter("EXIST((target/site))").targetFileExist().getFavorites();
|
userFavorites = restClient.withCoreAPI().usingAuthUser().where().invalidWhereParameter("EXIST((target/site))").targetFileExist().getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
||||||
@@ -480,7 +473,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify get favorites except the first one for request")
|
description = "Verify get favorites except the first one for request")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToGetFavoritesExceptTheFirstOne()
|
public void userIsAbleToGetFavoritesExceptTheFirstOne() throws Exception
|
||||||
{
|
{
|
||||||
userFavorites = restClient.authenticateUser(userModel).withParams("skipCount=1").withCoreAPI().usingUser(userModel).getFavorites();
|
userFavorites = restClient.authenticateUser(userModel).withParams("skipCount=1").withCoreAPI().usingUser(userModel).getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
@@ -493,7 +486,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify get first two favorites sites")
|
description = "Verify get first two favorites sites")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToGetFirstTwoFavorites()
|
public void userIsAbleToGetFirstTwoFavorites() throws Exception
|
||||||
{
|
{
|
||||||
userFavorites = restClient.authenticateUser(userModel).withParams("maxItems=2").withCoreAPI().usingUser(userModel).getFavorites();
|
userFavorites = restClient.authenticateUser(userModel).withParams("maxItems=2").withCoreAPI().usingUser(userModel).getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
@@ -509,7 +502,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify get favorites sites when using empty values for skipCount and maxItems")
|
description = "Verify get favorites sites when using empty values for skipCount and maxItems")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToGetFavoritesWhenSkipCountAndMaxItemsAreEmpty()
|
public void userIsAbleToGetFavoritesWhenSkipCountAndMaxItemsAreEmpty() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(userModel).withParams("skipCount= ").withCoreAPI().usingUser(userModel).getFavorites();
|
restClient.authenticateUser(userModel).withParams("skipCount= ").withCoreAPI().usingUser(userModel).getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError().containsSummary(String.format(RestErrorModel.INVALID_SKIPCOUNT, " "));
|
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError().containsSummary(String.format(RestErrorModel.INVALID_SKIPCOUNT, " "));
|
||||||
@@ -521,7 +514,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify the get favorites request for a high value for skipCount parameter")
|
description = "Verify the get favorites request for a high value for skipCount parameter")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToGetFavoritesWithHighSkipCount()
|
public void userIsAbleToGetFavoritesWithHighSkipCount() throws Exception
|
||||||
{
|
{
|
||||||
userFavorites = restClient.authenticateUser(userModel).withParams("skipCount=999999999").withCoreAPI().usingUser(userModel).getFavorites();
|
userFavorites = restClient.authenticateUser(userModel).withParams("skipCount=999999999").withCoreAPI().usingUser(userModel).getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
@@ -532,7 +525,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify the get favorites request with properties parameter applied")
|
description = "Verify the get favorites request with properties parameter applied")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToGetFavoritesWithPropertiesParamApplied()
|
public void userIsAbleToGetFavoritesWithPropertiesParamApplied() throws Exception
|
||||||
{
|
{
|
||||||
userFavorites = restClient.authenticateUser(userModel).withParams("properties=targetGuid").withCoreAPI().usingUser(userModel).getFavorites();
|
userFavorites = restClient.authenticateUser(userModel).withParams("properties=targetGuid").withCoreAPI().usingUser(userModel).getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
@@ -543,7 +536,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
|
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify entry details for get favorites response with Rest API")
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify entry details for get favorites response with Rest API")
|
||||||
public void checkResponseSchemaForGetFavorites()
|
public void checkResponseSchemaForGetFavorites() throws Exception
|
||||||
{
|
{
|
||||||
userFavorites = restClient.authenticateUser(userModel).withCoreAPI().usingAuthUser().getFavorites();
|
userFavorites = restClient.authenticateUser(userModel).withCoreAPI().usingAuthUser().getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
@@ -558,36 +551,4 @@ public class GetFavoritesTests extends RestTest
|
|||||||
.field("id").is(thirdSiteModel.getId()).and()
|
.field("id").is(thirdSiteModel.getId()).and()
|
||||||
.field("title").is(thirdSiteModel.getTitle());
|
.field("title").is(thirdSiteModel.getTitle());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(groups = {TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION})
|
|
||||||
@TestRail(section = {TestGroup.REST_API, TestGroup.FAVORITES}, executionType = ExecutionType.REGRESSION,
|
|
||||||
description = "Verify if get favorites response returns allowableOperations object when requested")
|
|
||||||
public void checkResponsesForGetFavoritesWithAllowableOperations()
|
|
||||||
{
|
|
||||||
final RestPersonFavoritesModelsCollection adminFavorites =
|
|
||||||
restClient.authenticateUser(adminUserModel).withCoreAPI().usingAuthUser().include(ALLOWABLE_OPERATIONS).getFavorites();
|
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
|
||||||
|
|
||||||
adminFavorites.getEntries().stream()
|
|
||||||
.map(RestPersonFavoritesModel::onModel)
|
|
||||||
.forEach(m -> m.assertThat().field(ALLOWABLE_OPERATIONS).isNotEmpty());
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestRail(section = {TestGroup.REST_API, TestGroup.FAVORITES}, executionType = ExecutionType.REGRESSION,
|
|
||||||
description = "Verify the get favorites request with properties parameter applied")
|
|
||||||
@Test(groups = {TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION})
|
|
||||||
public void checkSearchResponseContainsIsFavoriteWhenRequested() throws InterruptedException {
|
|
||||||
final SearchRequest query = new SearchRequest();
|
|
||||||
final RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
|
||||||
queryReq.setQuery(firstFileModel.getName());
|
|
||||||
query.setQuery(queryReq);
|
|
||||||
query.setInclude(List.of("isFavorite"));
|
|
||||||
|
|
||||||
Utility.sleep(500, 60000, () ->
|
|
||||||
{
|
|
||||||
restClient.authenticateUser(adminUserModel).withSearchAPI().search(query);
|
|
||||||
restClient.onResponse().assertThat().body("list.entries.entry[0].isFavorite", Matchers.notNullValue());
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>buildnumber-maven-plugin</artifactId>
|
<artifactId>buildnumber-maven-plugin</artifactId>
|
||||||
<version>3.2.0</version>
|
<version>3.1.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>validate</phase>
|
<phase>validate</phase>
|
||||||
|
|||||||
@@ -388,6 +388,12 @@
|
|||||||
<load-on-startup>8</load-on-startup>
|
<load-on-startup>8</load-on-startup>
|
||||||
</servlet>
|
</servlet>
|
||||||
|
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>cmistck</servlet-name>
|
||||||
|
<servlet-class>org.apache.chemistry.opencmis.tck.runner.WebRunnerServlet</servlet-class>
|
||||||
|
<load-on-startup>8</load-on-startup>
|
||||||
|
</servlet>
|
||||||
|
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>publicapiServlet</servlet-name>
|
<servlet-name>publicapiServlet</servlet-name>
|
||||||
<servlet-class>org.alfresco.rest.api.PublicApiWebScriptServlet</servlet-class>
|
<servlet-class>org.alfresco.rest.api.PublicApiWebScriptServlet</servlet-class>
|
||||||
@@ -463,6 +469,14 @@
|
|||||||
<servlet-name>publicapiServlet</servlet-name>
|
<servlet-name>publicapiServlet</servlet-name>
|
||||||
<url-pattern>/api/*</url-pattern>
|
<url-pattern>/api/*</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
|
<!-- The CMIS TCK is deactivated by default. -->
|
||||||
|
<!-- CMISTCK
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>cmistck</servlet-name>
|
||||||
|
<url-pattern>/cmistck</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
CMISTCK -->
|
||||||
|
|
||||||
<!-- Enterprise servlet-mapping placeholder -->
|
<!-- Enterprise servlet-mapping placeholder -->
|
||||||
|
|
||||||
|
|||||||
60
pom.xml
60
pom.xml
@@ -2,7 +2,7 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>Alfresco Community Repo Parent</name>
|
<name>Alfresco Community Repo Parent</name>
|
||||||
|
|
||||||
@@ -51,23 +51,23 @@
|
|||||||
<dependency.alfresco-server-root.version>6.0.1</dependency.alfresco-server-root.version>
|
<dependency.alfresco-server-root.version>6.0.1</dependency.alfresco-server-root.version>
|
||||||
<dependency.activiti-engine.version>5.23.0</dependency.activiti-engine.version>
|
<dependency.activiti-engine.version>5.23.0</dependency.activiti-engine.version>
|
||||||
<dependency.activiti.version>5.23.0</dependency.activiti.version>
|
<dependency.activiti.version>5.23.0</dependency.activiti.version>
|
||||||
<dependency.alfresco-transform-service.version>3.0.1-A2</dependency.alfresco-transform-service.version>
|
<dependency.alfresco-transform-service.version>3.0.0</dependency.alfresco-transform-service.version>
|
||||||
<dependency.alfresco-transform-core.version>4.0.1-A2</dependency.alfresco-transform-core.version>
|
<dependency.alfresco-transform-core.version>4.0.0</dependency.alfresco-transform-core.version>
|
||||||
<dependency.alfresco-greenmail.version>6.9</dependency.alfresco-greenmail.version>
|
<dependency.alfresco-greenmail.version>6.9</dependency.alfresco-greenmail.version>
|
||||||
<dependency.acs-event-model.version>0.0.23</dependency.acs-event-model.version>
|
<dependency.acs-event-model.version>0.0.23</dependency.acs-event-model.version>
|
||||||
|
|
||||||
<dependency.spring.version>5.3.27</dependency.spring.version>
|
<dependency.spring.version>5.3.27</dependency.spring.version>
|
||||||
<dependency.antlr.version>3.5.3</dependency.antlr.version>
|
<dependency.antlr.version>3.5.3</dependency.antlr.version>
|
||||||
<dependency.jackson.version>2.15.2</dependency.jackson.version>
|
<dependency.jackson.version>2.15.1</dependency.jackson.version>
|
||||||
<dependency.cxf.version>3.5.5</dependency.cxf.version>
|
<dependency.cxf.version>3.5.5</dependency.cxf.version>
|
||||||
<dependency.opencmis.version>1.0.0</dependency.opencmis.version>
|
<dependency.opencmis.version>1.0.0</dependency.opencmis.version>
|
||||||
<dependency.webscripts.version>8.45</dependency.webscripts.version>
|
<dependency.webscripts.version>8.45</dependency.webscripts.version>
|
||||||
<dependency.bouncycastle.version>1.70</dependency.bouncycastle.version>
|
<dependency.bouncycastle.version>1.70</dependency.bouncycastle.version>
|
||||||
<dependency.mockito-core.version>5.4.0</dependency.mockito-core.version>
|
<dependency.mockito-core.version>4.9.0</dependency.mockito-core.version>
|
||||||
<dependency.assertj.version>3.24.2</dependency.assertj.version>
|
<dependency.assertj.version>3.24.2</dependency.assertj.version>
|
||||||
<dependency.org-json.version>20230618</dependency.org-json.version>
|
<dependency.org-json.version>20230618</dependency.org-json.version>
|
||||||
<dependency.commons-dbcp.version>2.9.0</dependency.commons-dbcp.version>
|
<dependency.commons-dbcp.version>2.9.0</dependency.commons-dbcp.version>
|
||||||
<dependency.commons-io.version>2.13.0</dependency.commons-io.version>
|
<dependency.commons-io.version>2.11.0</dependency.commons-io.version>
|
||||||
<dependency.gson.version>2.8.9</dependency.gson.version>
|
<dependency.gson.version>2.8.9</dependency.gson.version>
|
||||||
<dependency.guava.version>32.1.1-jre</dependency.guava.version>
|
<dependency.guava.version>32.1.1-jre</dependency.guava.version>
|
||||||
<dependency.httpclient.version>4.5.13</dependency.httpclient.version>
|
<dependency.httpclient.version>4.5.13</dependency.httpclient.version>
|
||||||
@@ -84,8 +84,10 @@
|
|||||||
<dependency.poi.version>5.2.2</dependency.poi.version>
|
<dependency.poi.version>5.2.2</dependency.poi.version>
|
||||||
<dependency.poi-ooxml-lite.version>5.2.3</dependency.poi-ooxml-lite.version>
|
<dependency.poi-ooxml-lite.version>5.2.3</dependency.poi-ooxml-lite.version>
|
||||||
<dependency.jboss.logging.version>3.5.0.Final</dependency.jboss.logging.version>
|
<dependency.jboss.logging.version>3.5.0.Final</dependency.jboss.logging.version>
|
||||||
<dependency.camel.version>3.21.0</dependency.camel.version> <!-- when bumping this version, please keep track/sync with included netty.io dependencies -->
|
<dependency.camel.version>3.20.2</dependency.camel.version> <!-- when bumping this version, please keep track/sync with included netty.io dependencies -->
|
||||||
<dependency.netty.version>4.1.95.Final</dependency.netty.version> <!-- must be in sync with camels transitive dependencies, e.g.: netty-common -->
|
<dependency.netty.version>4.1.87.Final</dependency.netty.version> <!-- must be in sync with camels transitive dependencies, e.g.: netty-common -->
|
||||||
|
<dependency.netty.qpid.version>4.1.82.Final</dependency.netty.qpid.version> <!-- must be in sync with camels transitive dependencies: native-unix-common/native-epoll/native-kqueue -->
|
||||||
|
<dependency.netty-tcnative.version>2.0.56.Final</dependency.netty-tcnative.version> <!-- must be in sync with camels transitive dependencies -->
|
||||||
<dependency.activemq.version>5.17.4</dependency.activemq.version>
|
<dependency.activemq.version>5.17.4</dependency.activemq.version>
|
||||||
<dependency.apache-compress.version>1.23.0</dependency.apache-compress.version>
|
<dependency.apache-compress.version>1.23.0</dependency.apache-compress.version>
|
||||||
<dependency.apache.taglibs.version>1.2.5</dependency.apache.taglibs.version>
|
<dependency.apache.taglibs.version>1.2.5</dependency.apache.taglibs.version>
|
||||||
@@ -109,7 +111,7 @@
|
|||||||
<dependency.json-smart.version>2.5.0</dependency.json-smart.version>
|
<dependency.json-smart.version>2.5.0</dependency.json-smart.version>
|
||||||
<dependency.jakarta-rpc-api.version>1.1.4</dependency.jakarta-rpc-api.version>
|
<dependency.jakarta-rpc-api.version>1.1.4</dependency.jakarta-rpc-api.version>
|
||||||
|
|
||||||
<alfresco.googledrive.version>3.4.2-A4</alfresco.googledrive.version>
|
<alfresco.googledrive.version>3.4.2-A2</alfresco.googledrive.version>
|
||||||
<alfresco.aos-module.version>1.6.1</alfresco.aos-module.version>
|
<alfresco.aos-module.version>1.6.1</alfresco.aos-module.version>
|
||||||
<alfresco.api-explorer.version>23.1.0-A1</alfresco.api-explorer.version> <!-- Also in alfresco-enterprise-share -->
|
<alfresco.api-explorer.version>23.1.0-A1</alfresco.api-explorer.version> <!-- Also in alfresco-enterprise-share -->
|
||||||
|
|
||||||
@@ -122,8 +124,8 @@
|
|||||||
<dependency.mariadb.version>2.7.4</dependency.mariadb.version>
|
<dependency.mariadb.version>2.7.4</dependency.mariadb.version>
|
||||||
<dependency.tas-utility.version>4.0.4</dependency.tas-utility.version>
|
<dependency.tas-utility.version>4.0.4</dependency.tas-utility.version>
|
||||||
<dependency.rest-assured.version>5.3.1</dependency.rest-assured.version>
|
<dependency.rest-assured.version>5.3.1</dependency.rest-assured.version>
|
||||||
<dependency.tas-email.version>1.24</dependency.tas-email.version>
|
<dependency.tas-email.version>1.23</dependency.tas-email.version>
|
||||||
<dependency.tas-webdav.version>1.20</dependency.tas-webdav.version>
|
<dependency.tas-webdav.version>1.18</dependency.tas-webdav.version>
|
||||||
<dependency.tas-ftp.version>1.18</dependency.tas-ftp.version>
|
<dependency.tas-ftp.version>1.18</dependency.tas-ftp.version>
|
||||||
<dependency.tas-dataprep.version>2.6</dependency.tas-dataprep.version>
|
<dependency.tas-dataprep.version>2.6</dependency.tas-dataprep.version>
|
||||||
|
|
||||||
@@ -148,7 +150,7 @@
|
|||||||
<connection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</connection>
|
<connection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</connection>
|
||||||
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</developerConnection>
|
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</developerConnection>
|
||||||
<url>https://github.com/Alfresco/alfresco-community-repo</url>
|
<url>https://github.com/Alfresco/alfresco-community-repo</url>
|
||||||
<tag>23.1.0.185</tag>
|
<tag>HEAD</tag>
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
@@ -386,11 +388,7 @@
|
|||||||
<artifactId>commons-fileupload</artifactId>
|
<artifactId>commons-fileupload</artifactId>
|
||||||
<version>1.5</version>
|
<version>1.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>commons-net</groupId>
|
|
||||||
<artifactId>commons-net</artifactId>
|
|
||||||
<version>3.9.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
<artifactId>httpclient</artifactId>
|
<artifactId>httpclient</artifactId>
|
||||||
@@ -520,7 +518,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.yaml</groupId>
|
<groupId>org.yaml</groupId>
|
||||||
<artifactId>snakeyaml</artifactId>
|
<artifactId>snakeyaml</artifactId>
|
||||||
<version>2.1</version>
|
<version>2.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
@@ -637,7 +635,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.junrar</groupId>
|
<groupId>com.github.junrar</groupId>
|
||||||
<artifactId>junrar</artifactId>
|
<artifactId>junrar</artifactId>
|
||||||
<version>7.5.5</version>
|
<version>7.5.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.fge</groupId>
|
<groupId>com.github.fge</groupId>
|
||||||
@@ -853,6 +851,17 @@
|
|||||||
<artifactId>camel-mock</artifactId>
|
<artifactId>camel-mock</artifactId>
|
||||||
<version>${dependency.camel.version}</version>
|
<version>${dependency.camel.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- Netty non-transitive dependencies declared for depending projects usage in conjunction with Camel's other transitive netty dependencies -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.netty</groupId>
|
||||||
|
<artifactId>netty-handler-proxy</artifactId>
|
||||||
|
<version>${dependency.netty.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.netty</groupId>
|
||||||
|
<artifactId>netty-tcnative-classes</artifactId>
|
||||||
|
<version>${dependency.netty-tcnative.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.taglibs</groupId>
|
<groupId>org.apache.taglibs</groupId>
|
||||||
@@ -897,15 +906,6 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.netty</groupId>
|
|
||||||
<artifactId>netty-bom</artifactId>
|
|
||||||
<version>${dependency.netty.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.security</groupId>
|
<groupId>org.springframework.security</groupId>
|
||||||
<artifactId>spring-security-bom</artifactId>
|
<artifactId>spring-security-bom</artifactId>
|
||||||
@@ -961,7 +961,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
<version>3.6.0</version>
|
<version>3.5.0</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
@@ -1023,4 +1023,4 @@
|
|||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
@@ -102,30 +102,18 @@ public interface DeletedNodes
|
|||||||
CollectionWithPagingInfo<Rendition> getRenditions(String archivedId, Parameters parameters);
|
CollectionWithPagingInfo<Rendition> getRenditions(String archivedId, Parameters parameters);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a presigned URL to directly access content.
|
* Gets a presigned URL to directly access content.
|
||||||
*
|
*
|
||||||
* @param archivedId The node id for which to obtain the direct access {@code URL}
|
* @param archivedId The node id for which to obtain the direct access {@code URL}
|
||||||
* @param renditionId The rendition id for which to obtain the direct access {@code URL}
|
* @param renditionId The rendition id for which to obtain the direct access {@code URL}
|
||||||
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}, {@code true} by default.
|
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}, {@code true} by default.
|
||||||
* @return A direct access {@code URL} object for the content.
|
* @return A direct access {@code URL} object for the content.
|
||||||
*/
|
*/
|
||||||
default DirectAccessUrl requestContentDirectUrl(String archivedId, String renditionId, boolean attachment)
|
default DirectAccessUrl requestContentDirectUrl(String archivedId, String renditionId, boolean attachment)
|
||||||
{
|
{
|
||||||
return requestContentDirectUrl(archivedId, renditionId, attachment, null);
|
return requestContentDirectUrl(archivedId, renditionId, attachment, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param archivedId The node id for which to obtain the direct access {@code URL}
|
|
||||||
* @param renditionId The rendition id for which to obtain the direct access {@code URL}
|
|
||||||
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}, {@code true} by default.
|
|
||||||
* @param validFor The time at which the direct access {@code URL} will expire.
|
|
||||||
* @return A direct access {@code URL} object for the content.
|
|
||||||
*/
|
|
||||||
default DirectAccessUrl requestContentDirectUrl(String archivedId, String renditionId, boolean attachment, Long validFor)
|
|
||||||
{
|
|
||||||
return requestContentDirectUrl(archivedId, renditionId, attachment, validFor, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a presigned URL to directly access content.
|
* Gets a presigned URL to directly access content.
|
||||||
*
|
*
|
||||||
@@ -133,9 +121,8 @@ public interface DeletedNodes
|
|||||||
* @param renditionId The rendition id for which to obtain the direct access {@code URL}
|
* @param renditionId The rendition id for which to obtain the direct access {@code URL}
|
||||||
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}, {@code true} by default.
|
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}, {@code true} by default.
|
||||||
* @param validFor The time at which the direct access {@code URL} will expire.
|
* @param validFor The time at which the direct access {@code URL} will expire.
|
||||||
* @param fileName Optional overide for file name
|
|
||||||
* @return A direct access {@code URL} object for the content.
|
* @return A direct access {@code URL} object for the content.
|
||||||
*/
|
*/
|
||||||
DirectAccessUrl requestContentDirectUrl(String archivedId, String renditionId, boolean attachment, Long validFor, String fileName);
|
DirectAccessUrl requestContentDirectUrl(String archivedId, String renditionId, boolean attachment, Long validFor);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,10 +63,4 @@ public class DirectAccessUrlHelper
|
|||||||
}
|
}
|
||||||
return attachment;
|
return attachment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getFileName(DirectAccessUrlRequest directAccessUrlRequest)
|
|
||||||
{
|
|
||||||
return directAccessUrlRequest != null ? directAccessUrlRequest.getFileName() : null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -323,20 +323,7 @@ public interface Nodes
|
|||||||
* @param validFor The time at which the direct access {@code URL} will expire.
|
* @param validFor The time at which the direct access {@code URL} will expire.
|
||||||
* @return A direct access {@code URL} object for the content.
|
* @return A direct access {@code URL} object for the content.
|
||||||
*/
|
*/
|
||||||
default DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, boolean attachment, Long validFor)
|
DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, boolean attachment, Long validFor);
|
||||||
{
|
|
||||||
return requestContentDirectUrl(nodeRef, attachment, validFor, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a presigned URL to directly access content.
|
|
||||||
* @param nodeRef The node reference for which to obtain the direct access {@code URL}
|
|
||||||
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}.
|
|
||||||
* @param validFor The time at which the direct access {@code URL} will expire.
|
|
||||||
* @param fileName Optional name for the file when downloaded
|
|
||||||
* @return A direct access {@code URL} object for the content.
|
|
||||||
*/
|
|
||||||
DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, boolean attachment, Long validFor, String fileName);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert from node properties (map of QName to Serializable) retrieved from
|
* Convert from node properties (map of QName to Serializable) retrieved from
|
||||||
|
|||||||
@@ -250,19 +250,6 @@ public interface Renditions
|
|||||||
return requestContentDirectUrl(nodeRef, versionId, renditionId, attachment, null);
|
return requestContentDirectUrl(nodeRef, versionId, renditionId, attachment, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param nodeRef the node reference for which to obtain the direct access {@code URL}
|
|
||||||
* @param versionId the version id (aka version label)
|
|
||||||
* @param renditionId the rendition id
|
|
||||||
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}
|
|
||||||
* @param validFor the time at which the direct access {@code URL} will expire
|
|
||||||
* @return a direct access {@code URL} object for the content.
|
|
||||||
*/
|
|
||||||
default DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, String versionId, String renditionId, boolean attachment, Long validFor)
|
|
||||||
{
|
|
||||||
return requestContentDirectUrl(nodeRef, versionId, renditionId, attachment, validFor, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a presigned URL to directly access content.
|
* Gets a presigned URL to directly access content.
|
||||||
* @param nodeRef the node reference for which to obtain the direct access {@code URL}
|
* @param nodeRef the node reference for which to obtain the direct access {@code URL}
|
||||||
@@ -270,9 +257,8 @@ public interface Renditions
|
|||||||
* @param renditionId the rendition id
|
* @param renditionId the rendition id
|
||||||
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}
|
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}
|
||||||
* @param validFor the time at which the direct access {@code URL} will expire
|
* @param validFor the time at which the direct access {@code URL} will expire
|
||||||
* @param fileName optional name for the file when downloaded
|
|
||||||
* @return a direct access {@code URL} object for the content.
|
* @return a direct access {@code URL} object for the content.
|
||||||
*/
|
*/
|
||||||
DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, String versionId, String renditionId, boolean attachment, Long validFor, String fileName);
|
DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, String versionId, String renditionId, boolean attachment, Long validFor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -250,18 +250,18 @@ public class DeletedNodesImpl implements DeletedNodes, RecognizedParamsExtractor
|
|||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public DirectAccessUrl requestContentDirectUrl(String originalNodeId, String renditionId, boolean attachment, Long validFor, String fileName)
|
public DirectAccessUrl requestContentDirectUrl(String originalNodeId, String renditionId, boolean attachment, Long validFor)
|
||||||
{
|
{
|
||||||
//First check the node is valid and has been archived.
|
//First check the node is valid and has been archived.
|
||||||
NodeRef validatedNodeRef = nodes.validateNode(StoreRef.STORE_REF_ARCHIVE_SPACESSTORE, originalNodeId);
|
NodeRef validatedNodeRef = nodes.validateNode(StoreRef.STORE_REF_ARCHIVE_SPACESSTORE, originalNodeId);
|
||||||
|
|
||||||
if (renditionId != null)
|
if (renditionId != null)
|
||||||
{
|
{
|
||||||
return renditions.requestContentDirectUrl(validatedNodeRef, null, renditionId, attachment, validFor, fileName);
|
return renditions.requestContentDirectUrl(validatedNodeRef, null, renditionId, attachment, validFor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return nodes.requestContentDirectUrl(validatedNodeRef, attachment, validFor, fileName);
|
return nodes.requestContentDirectUrl(validatedNodeRef, attachment, validFor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,14 +25,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.rest.api.impl;
|
package org.alfresco.rest.api.impl;
|
||||||
|
|
||||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ALLOWABLEOPERATIONS;
|
|
||||||
|
|
||||||
import java.util.AbstractList;
|
import java.util.AbstractList;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -77,7 +76,6 @@ import org.alfresco.service.cmr.site.SiteService;
|
|||||||
import org.alfresco.service.namespace.NamespaceService;
|
import org.alfresco.service.namespace.NamespaceService;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.util.Pair;
|
import org.alfresco.util.Pair;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
@@ -91,9 +89,7 @@ public class FavouritesImpl implements Favourites
|
|||||||
{
|
{
|
||||||
private static final Log logger = LogFactory.getLog(FavouritesImpl.class);
|
private static final Log logger = LogFactory.getLog(FavouritesImpl.class);
|
||||||
|
|
||||||
private static final List<String> ALLOWED_INCLUDES = List.of(PARAM_INCLUDE_PROPERTIES, PARAM_INCLUDE_ALLOWABLEOPERATIONS);
|
private People people;
|
||||||
|
|
||||||
private People people;
|
|
||||||
private Sites sites;
|
private Sites sites;
|
||||||
private Nodes nodes;
|
private Nodes nodes;
|
||||||
private FavouritesService favouritesService;
|
private FavouritesService favouritesService;
|
||||||
@@ -179,23 +175,18 @@ public class FavouritesImpl implements Favourites
|
|||||||
fav.setTarget(target);
|
fav.setTarget(target);
|
||||||
|
|
||||||
// REPO-1147 allow retrieving additional properties
|
// REPO-1147 allow retrieving additional properties
|
||||||
final List<String> paramsInclude = parameters.getInclude();
|
if (parameters.getInclude().contains(PARAM_INCLUDE_PROPERTIES))
|
||||||
if (!Collections.disjoint(paramsInclude, ALLOWED_INCLUDES))
|
|
||||||
{
|
{
|
||||||
final List<String> includes = ALLOWED_INCLUDES.stream().filter(a -> paramsInclude.contains(a)).collect(Collectors.toList());
|
List<String> includeProperties = new LinkedList<>();
|
||||||
|
includeProperties.add(PARAM_INCLUDE_PROPERTIES);
|
||||||
// get node representation with only properties included
|
// get node representation with only properties included
|
||||||
Node node = nodes.getFolderOrDocument(personFavourite.getNodeRef(), null, null, includes, null);
|
Node node = nodes.getFolderOrDocument(personFavourite.getNodeRef(), null, null, includeProperties, null);
|
||||||
// Create a map from node properties excluding properties already in this Favorite
|
// Create a map from node properties excluding properties already in this Favorite
|
||||||
Map<String, Object> filteredNodeProperties = filterProps(node.getProperties(), EXCLUDED_PROPS);
|
Map<String, Object> filteredNodeProperties = filterProps(node.getProperties(), EXCLUDED_PROPS);
|
||||||
if(filteredNodeProperties.size() > 0 && paramsInclude.contains(PARAM_INCLUDE_PROPERTIES))
|
if(filteredNodeProperties.size() > 0)
|
||||||
{
|
{
|
||||||
fav.setProperties(filteredNodeProperties);
|
fav.setProperties(filteredNodeProperties);
|
||||||
}
|
}
|
||||||
final List<String> allowableOperations = node.getAllowableOperations();
|
|
||||||
if (CollectionUtils.isNotEmpty(allowableOperations) && paramsInclude.contains(PARAM_INCLUDE_ALLOWABLEOPERATIONS))
|
|
||||||
{
|
|
||||||
fav.setAllowableOperations(allowableOperations);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return fav;
|
return fav;
|
||||||
|
|||||||
@@ -3443,9 +3443,9 @@ public class NodesImpl implements Nodes
|
|||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, boolean attachment, Long validFor, String fileName)
|
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, boolean attachment, Long validFor)
|
||||||
{
|
{
|
||||||
DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(nodeRef, ContentModel.PROP_CONTENT, attachment, validFor, fileName);
|
DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(nodeRef, ContentModel.PROP_CONTENT, attachment, validFor);
|
||||||
if (directAccessUrl == null)
|
if (directAccessUrl == null)
|
||||||
{
|
{
|
||||||
throw new DisabledServiceException("Direct access url isn't available.");
|
throw new DisabledServiceException("Direct access url isn't available.");
|
||||||
|
|||||||
@@ -512,7 +512,7 @@ public class RenditionsImpl implements Renditions, ResourceLoaderAware
|
|||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, String versionId, String renditionId, boolean attachment, Long validFor, String fileName)
|
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, String versionId, String renditionId, boolean attachment, Long validFor)
|
||||||
{
|
{
|
||||||
final NodeRef validatedNodeRef = validateNode(nodeRef.getStoreRef(), nodeRef.getId(), versionId, null);
|
final NodeRef validatedNodeRef = validateNode(nodeRef.getStoreRef(), nodeRef.getId(), versionId, null);
|
||||||
NodeRef renditionNodeRef = getRenditionByName(validatedNodeRef, renditionId, null);
|
NodeRef renditionNodeRef = getRenditionByName(validatedNodeRef, renditionId, null);
|
||||||
@@ -522,7 +522,7 @@ public class RenditionsImpl implements Renditions, ResourceLoaderAware
|
|||||||
throw new NotFoundException("The rendition with id: " + renditionId + " was not found.");
|
throw new NotFoundException("The rendition with id: " + renditionId + " was not found.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return nodes.requestContentDirectUrl(renditionNodeRef, attachment, validFor, fileName);
|
return nodes.requestContentDirectUrl(renditionNodeRef, attachment, validFor);
|
||||||
}
|
}
|
||||||
|
|
||||||
private BinaryResource getContentImpl(NodeRef nodeRef, String renditionId, Parameters parameters)
|
private BinaryResource getContentImpl(NodeRef nodeRef, String renditionId, Parameters parameters)
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ package org.alfresco.rest.api.model;
|
|||||||
public class DirectAccessUrlRequest
|
public class DirectAccessUrlRequest
|
||||||
{
|
{
|
||||||
private Boolean attachment;
|
private Boolean attachment;
|
||||||
private String fileName;
|
|
||||||
|
|
||||||
public Boolean isAttachment()
|
public Boolean isAttachment()
|
||||||
{
|
{
|
||||||
@@ -44,14 +43,4 @@ public class DirectAccessUrlRequest
|
|||||||
{
|
{
|
||||||
this.attachment = attachment;
|
this.attachment = attachment;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFileName()
|
|
||||||
{
|
|
||||||
return fileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFileName(String fileName)
|
|
||||||
{
|
|
||||||
this.fileName = fileName;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
package org.alfresco.rest.api.model;
|
package org.alfresco.rest.api.model;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.alfresco.rest.framework.resource.UniqueId;
|
import org.alfresco.rest.framework.resource.UniqueId;
|
||||||
@@ -43,7 +42,6 @@ public class Favourite
|
|||||||
private Date createdAt;
|
private Date createdAt;
|
||||||
private Target target;
|
private Target target;
|
||||||
private Map<String, Object> properties;
|
private Map<String, Object> properties;
|
||||||
private List<String> allowableOperations;
|
|
||||||
|
|
||||||
public Date getCreatedAt()
|
public Date getCreatedAt()
|
||||||
{
|
{
|
||||||
@@ -86,18 +84,10 @@ public class Favourite
|
|||||||
this.properties = properties;
|
this.properties = properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getAllowableOperations() {
|
|
||||||
return allowableOperations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAllowableOperations(List<String> allowableOperations) {
|
|
||||||
this.allowableOperations = allowableOperations;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
return "Favourite [targetGuid=" + targetGuid
|
return "Favourite [targetGuid=" + targetGuid
|
||||||
+ ", createdAt=" + createdAt + ", target=" + target + ", properties=" + properties + "]";
|
+ ", createdAt=" + createdAt + ", target=" + target + ", properties=" + properties + "]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -137,13 +137,12 @@ public class NodeRenditionsRelation implements RelationshipResourceAction.Read<R
|
|||||||
{
|
{
|
||||||
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
|
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
|
||||||
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
|
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
|
||||||
String fileName = directAccessUrlHelper.getFileName(directAccessUrlRequest);
|
|
||||||
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, nodeId);
|
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, nodeId);
|
||||||
|
|
||||||
DirectAccessUrl directAccessUrl;
|
DirectAccessUrl directAccessUrl;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
directAccessUrl = renditions.requestContentDirectUrl(nodeRef, null, renditionId, attachment, validFor, fileName);
|
directAccessUrl = renditions.requestContentDirectUrl(nodeRef, null, renditionId, attachment, validFor);
|
||||||
}
|
}
|
||||||
catch (DirectAccessUrlDisabledException ex)
|
catch (DirectAccessUrlDisabledException ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -149,14 +149,13 @@ public class NodeVersionRenditionsRelation implements RelationshipResourceAction
|
|||||||
{
|
{
|
||||||
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
|
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
|
||||||
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
|
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
|
||||||
String fileName = directAccessUrlHelper.getFileName(directAccessUrlRequest);
|
|
||||||
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, nodeId);
|
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, nodeId);
|
||||||
String renditionId = parameters.getRelationship2Id();
|
String renditionId = parameters.getRelationship2Id();
|
||||||
|
|
||||||
DirectAccessUrl directAccessUrl;
|
DirectAccessUrl directAccessUrl;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
directAccessUrl = renditions.requestContentDirectUrl(nodeRef, versionId, renditionId, attachment, validFor, fileName);
|
directAccessUrl = renditions.requestContentDirectUrl(nodeRef, versionId, renditionId, attachment, validFor);
|
||||||
}
|
}
|
||||||
catch (DirectAccessUrlDisabledException ex)
|
catch (DirectAccessUrlDisabledException ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -311,7 +311,6 @@ public class NodeVersionsRelation extends AbstractNodeRelation implements
|
|||||||
{
|
{
|
||||||
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
|
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
|
||||||
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
|
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
|
||||||
String fileName = directAccessUrlHelper.getFileName(directAccessUrlRequest);
|
|
||||||
Version version = findVersion(nodeId, versionId);
|
Version version = findVersion(nodeId, versionId);
|
||||||
if (version != null)
|
if (version != null)
|
||||||
{
|
{
|
||||||
@@ -320,7 +319,7 @@ public class NodeVersionsRelation extends AbstractNodeRelation implements
|
|||||||
DirectAccessUrl directAccessUrl;
|
DirectAccessUrl directAccessUrl;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
directAccessUrl = nodes.requestContentDirectUrl(versionNodeRef, attachment, validFor, fileName);
|
directAccessUrl = nodes.requestContentDirectUrl(versionNodeRef, attachment, validFor);
|
||||||
}
|
}
|
||||||
catch (DirectAccessUrlDisabledException ex)
|
catch (DirectAccessUrlDisabledException ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -211,13 +211,12 @@ public class NodesEntityResource implements
|
|||||||
{
|
{
|
||||||
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
|
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
|
||||||
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
|
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
|
||||||
String fileName = directAccessUrlHelper.getFileName(directAccessUrlRequest);
|
|
||||||
NodeRef nodeRef = nodes.validateNode(nodeId);
|
NodeRef nodeRef = nodes.validateNode(nodeId);
|
||||||
|
|
||||||
DirectAccessUrl directAccessUrl;
|
DirectAccessUrl directAccessUrl;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
directAccessUrl = nodes.requestContentDirectUrl(nodeRef, attachment, validFor, fileName);
|
directAccessUrl = nodes.requestContentDirectUrl(nodeRef, attachment, validFor);
|
||||||
}
|
}
|
||||||
catch (DirectAccessUrlDisabledException ex)
|
catch (DirectAccessUrlDisabledException ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import static java.util.stream.Collectors.toList;
|
|||||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ALLOWABLEOPERATIONS;
|
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ALLOWABLEOPERATIONS;
|
||||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ASPECTNAMES;
|
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ASPECTNAMES;
|
||||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ASSOCIATION;
|
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ASSOCIATION;
|
||||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ISFAVORITE;
|
|
||||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ISLINK;
|
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ISLINK;
|
||||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ISLOCKED;
|
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ISLOCKED;
|
||||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_PATH;
|
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_PATH;
|
||||||
@@ -97,9 +96,10 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
public class SearchMapper
|
public class SearchMapper
|
||||||
{
|
{
|
||||||
public static final List<String> PERMITTED_INCLUDES = Arrays.asList(PARAM_INCLUDE_ALLOWABLEOPERATIONS,PARAM_INCLUDE_ASPECTNAMES,
|
public static final List<String> PERMITTED_INCLUDES
|
||||||
PARAM_INCLUDE_ISLINK, PARAM_INCLUDE_PATH, PARAM_INCLUDE_PROPERTIES, PARAM_INCLUDE_ASSOCIATION,
|
= Arrays.asList(PARAM_INCLUDE_ALLOWABLEOPERATIONS,PARAM_INCLUDE_ASPECTNAMES,
|
||||||
PARAM_INCLUDE_ISLOCKED, PARAM_INCLUDE_PERMISSIONS, PARAM_INCLUDE_ISFAVORITE);
|
PARAM_INCLUDE_ISLINK, PARAM_INCLUDE_PATH, PARAM_INCLUDE_PROPERTIES,
|
||||||
|
PARAM_INCLUDE_ASSOCIATION, PARAM_INCLUDE_ISLOCKED, PARAM_INCLUDE_PERMISSIONS);
|
||||||
|
|
||||||
public static final String CMIS = "cmis";
|
public static final String CMIS = "cmis";
|
||||||
public static final String LUCENE = "lucene";
|
public static final String LUCENE = "lucene";
|
||||||
|
|||||||
@@ -109,11 +109,10 @@ public class TrashcanEntityResource implements
|
|||||||
{
|
{
|
||||||
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
|
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
|
||||||
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
|
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
|
||||||
String fileName = directAccessUrlHelper.getFileName(directAccessUrlRequest);
|
|
||||||
DirectAccessUrl directAccessUrl;
|
DirectAccessUrl directAccessUrl;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
directAccessUrl = deletedNodes.requestContentDirectUrl(originalNodeId, null, attachment, validFor, fileName);
|
directAccessUrl = deletedNodes.requestContentDirectUrl(originalNodeId, null, attachment, validFor);
|
||||||
}
|
}
|
||||||
catch (DirectAccessUrlDisabledException ex)
|
catch (DirectAccessUrlDisabledException ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -98,11 +98,10 @@ public class TrashcanRenditionsRelation
|
|||||||
{
|
{
|
||||||
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
|
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
|
||||||
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
|
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
|
||||||
String fileName = directAccessUrlHelper.getFileName(directAccessUrlRequest);
|
|
||||||
DirectAccessUrl directAccessUrl;
|
DirectAccessUrl directAccessUrl;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
directAccessUrl = deletedNodes.requestContentDirectUrl(originalNodeId, renditionId, attachment, validFor, fileName);
|
directAccessUrl = deletedNodes.requestContentDirectUrl(originalNodeId, renditionId, attachment, validFor);
|
||||||
}
|
}
|
||||||
catch (DirectAccessUrlDisabledException ex)
|
catch (DirectAccessUrlDisabledException ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -63,11 +63,6 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import java.util.concurrent.locks.Lock;
|
|
||||||
import java.util.concurrent.locks.ReadWriteLock;
|
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
import static org.mockito.ArgumentMatchers.anyInt;
|
import static org.mockito.ArgumentMatchers.anyInt;
|
||||||
import static org.mockito.Mockito.doAnswer;
|
import static org.mockito.Mockito.doAnswer;
|
||||||
@@ -506,78 +501,40 @@ class BlockingRemoteUserMapper implements RemoteUserMapper, ActivateableBean
|
|||||||
private volatile int timePassed;
|
private volatile int timePassed;
|
||||||
|
|
||||||
private boolean isEnabled = true;
|
private boolean isEnabled = true;
|
||||||
private final ReadWriteLock lock = new ReentrantReadWriteLock();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRemoteUser(HttpServletRequest request)
|
public String getRemoteUser(HttpServletRequest request)
|
||||||
{
|
{
|
||||||
doWithLock(lock.writeLock(), () -> {
|
long t1 = System.currentTimeMillis();
|
||||||
long t1 = System.currentTimeMillis();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Thread.sleep(BLOCKING_FOR_MILLIS);
|
|
||||||
} catch (InterruptedException ie)
|
|
||||||
{
|
|
||||||
wasInterrupted = true;
|
|
||||||
} finally
|
|
||||||
{
|
|
||||||
timePassed = (int) (System.currentTimeMillis() - t1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void doWithLock(Lock lock, Runnable action)
|
|
||||||
{
|
|
||||||
getWithLock(lock, () ->
|
|
||||||
{
|
|
||||||
action.run();
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private static <T> T getWithLock(Lock lock, Supplier<T> supplier)
|
|
||||||
{
|
|
||||||
final boolean locked;
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
locked = lock.tryLock(BLOCKING_FOR_MILLIS * 2, TimeUnit.MILLISECONDS);
|
Thread.sleep(BLOCKING_FOR_MILLIS);
|
||||||
}
|
}
|
||||||
catch (InterruptedException e)
|
catch (InterruptedException ie)
|
||||||
{
|
{
|
||||||
Thread.currentThread().interrupt();
|
wasInterrupted = true;
|
||||||
throw new IllegalStateException("Unexpected InterruptedException while acquiring " + lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!locked) throw new IllegalStateException("Unexpected failure while acquiring " + lock);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return supplier.get();
|
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
lock.unlock();
|
timePassed = (int) (System.currentTimeMillis() - t1);
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isWasInterrupted()
|
public boolean isWasInterrupted()
|
||||||
{
|
{
|
||||||
return getWithLock(lock.readLock(), () -> wasInterrupted);
|
return wasInterrupted;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTimePassed()
|
public int getTimePassed()
|
||||||
{
|
{
|
||||||
return getWithLock(lock.readLock(), () -> timePassed);
|
return timePassed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reset()
|
public void reset()
|
||||||
{
|
{
|
||||||
doWithLock(lock.writeLock(), () ->
|
wasInterrupted = false;
|
||||||
{
|
timePassed = 0;
|
||||||
wasInterrupted = false;
|
|
||||||
timePassed = 0;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import static junit.framework.TestCase.fail;
|
|||||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ALLOWABLEOPERATIONS;
|
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ALLOWABLEOPERATIONS;
|
||||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ASPECTNAMES;
|
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ASPECTNAMES;
|
||||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ASSOCIATION;
|
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ASSOCIATION;
|
||||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ISFAVORITE;
|
|
||||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ISLINK;
|
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ISLINK;
|
||||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ISLOCKED;
|
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ISLOCKED;
|
||||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_PATH;
|
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_PATH;
|
||||||
@@ -301,7 +300,7 @@ public class SearchMapperTests
|
|||||||
{
|
{
|
||||||
searchMapper.validateInclude(Arrays.asList(PARAM_INCLUDE_ALLOWABLEOPERATIONS,PARAM_INCLUDE_ASPECTNAMES,
|
searchMapper.validateInclude(Arrays.asList(PARAM_INCLUDE_ALLOWABLEOPERATIONS,PARAM_INCLUDE_ASPECTNAMES,
|
||||||
PARAM_INCLUDE_ISLINK, PARAM_INCLUDE_PATH, PARAM_INCLUDE_PROPERTIES,
|
PARAM_INCLUDE_ISLINK, PARAM_INCLUDE_PATH, PARAM_INCLUDE_PROPERTIES,
|
||||||
PARAM_INCLUDE_ASSOCIATION, PARAM_INCLUDE_ISLOCKED, PARAM_INCLUDE_PERMISSIONS, PARAM_INCLUDE_ISFAVORITE));
|
PARAM_INCLUDE_ASSOCIATION, PARAM_INCLUDE_ISLOCKED, PARAM_INCLUDE_PERMISSIONS));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.1.0.185</version>
|
<version>23.1.0.163-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@@ -741,6 +741,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-net</groupId>
|
<groupId>commons-net</groupId>
|
||||||
<artifactId>commons-net</artifactId>
|
<artifactId>commons-net</artifactId>
|
||||||
|
<version>3.8.0</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ import org.alfresco.service.cmr.usage.ContentQuotaException;
|
|||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.util.EqualsHelper;
|
import org.alfresco.util.EqualsHelper;
|
||||||
import org.alfresco.util.TempFileProvider;
|
import org.alfresco.util.TempFileProvider;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.springframework.beans.BeansException;
|
import org.springframework.beans.BeansException;
|
||||||
@@ -628,7 +627,7 @@ public class ContentServiceImpl implements ContentService, ApplicationContextAwa
|
|||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, QName propertyQName, boolean attachment, Long validFor, String fileNameOverride)
|
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, QName propertyQName, boolean attachment, Long validFor)
|
||||||
{
|
{
|
||||||
if (!systemWideDirectUrlConfig.isEnabled())
|
if (!systemWideDirectUrlConfig.isEnabled())
|
||||||
{
|
{
|
||||||
@@ -644,7 +643,7 @@ public class ContentServiceImpl implements ContentService, ApplicationContextAwa
|
|||||||
|
|
||||||
String contentUrl = contentData.getContentUrl();
|
String contentUrl = contentData.getContentUrl();
|
||||||
String contentMimetype = contentData.getMimetype();
|
String contentMimetype = contentData.getMimetype();
|
||||||
String fileName = StringUtils.isEmpty(fileNameOverride) ? getFileName(nodeRef) : fileNameOverride;
|
String fileName = getFileName(nodeRef);
|
||||||
|
|
||||||
validFor = adjustValidFor(validFor);
|
validFor = adjustValidFor(validFor);
|
||||||
attachment = adjustAttachment(nodeRef, contentMimetype, attachment);
|
attachment = adjustAttachment(nodeRef, contentMimetype, attachment);
|
||||||
|
|||||||
@@ -368,10 +368,7 @@ public class DocumentLinkServiceImpl implements DocumentLinkService, NodeService
|
|||||||
public void beforeDeleteLinkNode(NodeRef linkNodeRef)
|
public void beforeDeleteLinkNode(NodeRef linkNodeRef)
|
||||||
{
|
{
|
||||||
final NodeRef nodeRef = getLinkDestination(linkNodeRef);
|
final NodeRef nodeRef = getLinkDestination(linkNodeRef);
|
||||||
if (nodeRef == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
List<Long> nodeRefLinks = getNodeLinksIds(nodeRef);
|
List<Long> nodeRefLinks = getNodeLinksIds(nodeRef);
|
||||||
|
|
||||||
long linkNodeId = (Long) nodeService.getProperty(linkNodeRef, ContentModel.PROP_NODE_DBID);
|
long linkNodeId = (Long) nodeService.getProperty(linkNodeRef, ContentModel.PROP_NODE_DBID);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Repository
|
* Alfresco Repository
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2023 Alfresco Software Limited
|
* Copyright (C) 2005 - 2022 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
@@ -26,8 +26,8 @@
|
|||||||
|
|
||||||
package org.alfresco.repo.virtual.bundle;
|
package org.alfresco.repo.virtual.bundle;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.io.UncheckedIOException;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -910,7 +910,7 @@ public class VirtualNodeServiceExtension extends VirtualSpringBeanExtension<Node
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
catch (UncheckedIOException e)
|
catch (IOException e)
|
||||||
{
|
{
|
||||||
throw new VirtualizationException(e);
|
throw new VirtualizationException(e);
|
||||||
}
|
}
|
||||||
@@ -968,7 +968,7 @@ public class VirtualNodeServiceExtension extends VirtualSpringBeanExtension<Node
|
|||||||
}
|
}
|
||||||
writer.putContent(text);
|
writer.putContent(text);
|
||||||
}
|
}
|
||||||
catch (UncheckedIOException e)
|
catch (IOException e)
|
||||||
{
|
{
|
||||||
throw new ActualEnvironmentException(e);
|
throw new ActualEnvironmentException(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -245,25 +245,7 @@ public interface ContentService
|
|||||||
* @throws UnsupportedOperationException if the store is unable to provide the information.
|
* @throws UnsupportedOperationException if the store is unable to provide the information.
|
||||||
*/
|
*/
|
||||||
@Auditable(parameters = {"nodeRef", "propertyQName", "validFor"})
|
@Auditable(parameters = {"nodeRef", "propertyQName", "validFor"})
|
||||||
default DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, QName propertyQName, boolean attachment, Long validFor)
|
DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, QName propertyQName, boolean attachment, Long validFor);
|
||||||
{
|
|
||||||
return requestContentDirectUrl(nodeRef, propertyQName, attachment, validFor, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a presigned URL to directly access the content. It is up to the actual store
|
|
||||||
* implementation if it can fulfil this request with an expiry time or not.
|
|
||||||
*
|
|
||||||
* @param nodeRef Node ref for which to obtain the direct access {@code URL}.
|
|
||||||
* @param propertyQName the name of the property, which must be of type <b>content</b>
|
|
||||||
* @param attachment {@code true} if an attachment URL is requested, {@code false} for an embedded {@code URL}.
|
|
||||||
* @param validFor The time at which the direct access {@code URL} will expire.
|
|
||||||
* @param fileName Optional name for the file when downloaded
|
|
||||||
* @return A direct access {@code URL} object for the content.
|
|
||||||
* @throws UnsupportedOperationException if the store is unable to provide the information.
|
|
||||||
*/
|
|
||||||
@Auditable(parameters = {"nodeRef", "propertyQName", "validFor"})
|
|
||||||
DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, QName propertyQName, boolean attachment, Long validFor, String fileName);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a key-value (String-String) collection of storage headers/properties with their respective values for a specific node reference.
|
* Gets a key-value (String-String) collection of storage headers/properties with their respective values for a specific node reference.
|
||||||
|
|||||||
@@ -69,22 +69,22 @@ public class AlfrescoRmiRegistryFactoryBean implements FactoryBean<Registry>, Di
|
|||||||
if (LOG.isDebugEnabled()) {
|
if (LOG.isDebugEnabled()) {
|
||||||
LOG.debug("Looking for RMI registry at port '" + this.port + "', using custom socket factory");
|
LOG.debug("Looking for RMI registry at port '" + this.port + "', using custom socket factory");
|
||||||
}
|
}
|
||||||
|
Registry registry;
|
||||||
synchronized (LocateRegistry.class) {
|
synchronized (LocateRegistry.class) {
|
||||||
try {
|
try {
|
||||||
// Retrieve existing registry.
|
// Retrieve existing registry.
|
||||||
final Registry localRegistry = LocateRegistry.getRegistry(null, this.port, socketFactory);
|
registry = LocateRegistry.getRegistry(null, this.port, socketFactory);
|
||||||
testRegistry(localRegistry);
|
testRegistry(this.registry);
|
||||||
return localRegistry;
|
|
||||||
}
|
}
|
||||||
catch (RemoteException ex) {
|
catch (RemoteException ex) {
|
||||||
LOG.trace("RMI registry access threw exception", ex);
|
LOG.trace("RMI registry access threw exception", ex);
|
||||||
LOG.debug("Could not detect RMI registry - creating new one");
|
LOG.debug("Could not detect RMI registry - creating new one");
|
||||||
// Assume no registry found -> create new one.
|
// Assume no registry found -> create new one.
|
||||||
this.created = true;
|
this.created = true;
|
||||||
return LocateRegistry.createRegistry(this.port, socketFactory, socketFactory);
|
registry = LocateRegistry.createRegistry(this.port, socketFactory, socketFactory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return registry;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEnabled()
|
public boolean isEnabled()
|
||||||
|
|||||||
@@ -754,6 +754,13 @@ encryption.ssl.truststore.keyMetaData.location=
|
|||||||
httpclient.config.transform.mTLSEnabled=false
|
httpclient.config.transform.mTLSEnabled=false
|
||||||
httpclient.config.transform.maxTotalConnections=20
|
httpclient.config.transform.maxTotalConnections=20
|
||||||
httpclient.config.transform.maxHostConnections=20
|
httpclient.config.transform.maxHostConnections=20
|
||||||
|
httpclient.config.transform.socketTimeout=5000
|
||||||
|
httpclient.config.transform.connectionRequestTimeout=5000
|
||||||
|
httpclient.config.transform.connectionTimeout=5000
|
||||||
|
|
||||||
|
# Property is disabled by default for security reasons, never enable it on for production environments.
|
||||||
|
# It will stop verification of hostnames placed in certificates returned with server responses to Repository requests towards transform services
|
||||||
|
httpclient.config.transform.hostnameVerificationDisabled=false
|
||||||
|
|
||||||
# Re-encryptor properties
|
# Re-encryptor properties
|
||||||
encryption.reencryptor.chunkSize=100
|
encryption.reencryptor.chunkSize=100
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -72,8 +72,7 @@ public class ContentServiceImplUnitTest
|
|||||||
|
|
||||||
private static final NodeRef NODE_REF = new NodeRef("content://Node/Ref");
|
private static final NodeRef NODE_REF = new NodeRef("content://Node/Ref");
|
||||||
public static final String SOME_CONTENT_URL = "someContentUrl";
|
public static final String SOME_CONTENT_URL = "someContentUrl";
|
||||||
private static final NodeRef NODE_REF_2 = new NodeRef("content://Node/Ref2");
|
private static final NodeRef NODE_REF_2 = new NodeRef("content://Node/Ref2");;
|
||||||
public static final String SOME_FILE_NAME = "someFilename";
|
|
||||||
|
|
||||||
private static final String X_AMZ_HEADER_1 = "x-amz-header1";
|
private static final String X_AMZ_HEADER_1 = "x-amz-header1";
|
||||||
private static final String VALUE_1 = "value1";
|
private static final String VALUE_1 = "value1";
|
||||||
@@ -104,7 +103,7 @@ public class ContentServiceImplUnitTest
|
|||||||
when(mockNodeService.getProperty(NODE_REF, ContentModel.PROP_CONTENT)).thenReturn(mockContentData);
|
when(mockNodeService.getProperty(NODE_REF, ContentModel.PROP_CONTENT)).thenReturn(mockContentData);
|
||||||
when(mockContentData.getContentUrl()).thenReturn(SOME_CONTENT_URL);
|
when(mockContentData.getContentUrl()).thenReturn(SOME_CONTENT_URL);
|
||||||
when(mockContentData.getMimetype()).thenReturn("someMimetype");
|
when(mockContentData.getMimetype()).thenReturn("someMimetype");
|
||||||
when(mockNodeService.getProperty(NODE_REF, ContentModel.PROP_NAME)).thenReturn(SOME_FILE_NAME);
|
when(mockNodeService.getProperty(NODE_REF, ContentModel.PROP_NAME)).thenReturn("someFilename");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -163,40 +162,6 @@ public class ContentServiceImplUnitTest
|
|||||||
verify(mockContentStore, times(1)).requestContentDirectUrl(anyString(), eq(true), anyString(), anyString(), anyLong());
|
verify(mockContentStore, times(1)).requestContentDirectUrl(anyString(), eq(true), anyString(), anyString(), anyLong());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testRequestContentDirectUrl_StoreRequestContentDirectUrlIsCalledWithFileNameOverride()
|
|
||||||
{
|
|
||||||
final String fileNameOverride = "fileNameOverride.txt";
|
|
||||||
setupSystemWideDirectAccessConfig(ENABLED);
|
|
||||||
when(mockContentStore.isContentDirectUrlEnabled()).thenReturn(ENABLED);
|
|
||||||
|
|
||||||
DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(NODE_REF, PROP_CONTENT_QNAME, true, 20L, fileNameOverride);
|
|
||||||
assertNull(directAccessUrl);
|
|
||||||
verify(mockContentStore, times(1)).requestContentDirectUrl(anyString(), eq(true), eq(fileNameOverride), anyString(), anyLong());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testRequestContentDirectUrl_StoreRequestContentDirectUrlIsCalledWithNodeNamePropertyWhenFileNameOverrideIsNull()
|
|
||||||
{
|
|
||||||
setupSystemWideDirectAccessConfig(ENABLED);
|
|
||||||
when(mockContentStore.isContentDirectUrlEnabled()).thenReturn(ENABLED);
|
|
||||||
|
|
||||||
DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(NODE_REF, PROP_CONTENT_QNAME, true, 20L, null);
|
|
||||||
assertNull(directAccessUrl);
|
|
||||||
verify(mockContentStore, times(1)).requestContentDirectUrl(anyString(), eq(true), eq(SOME_FILE_NAME), anyString(), anyLong());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testRequestContentDirectUrl_StoreRequestContentDirectUrlIsCalledWithNodeNamePropertyWhenFileNameOverrideIsEmpty()
|
|
||||||
{
|
|
||||||
setupSystemWideDirectAccessConfig(ENABLED);
|
|
||||||
when(mockContentStore.isContentDirectUrlEnabled()).thenReturn(ENABLED);
|
|
||||||
|
|
||||||
DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(NODE_REF, PROP_CONTENT_QNAME, true, 20L, "");
|
|
||||||
assertNull(directAccessUrl);
|
|
||||||
verify(mockContentStore, times(1)).requestContentDirectUrl(anyString(), eq(true), eq(SOME_FILE_NAME), anyString(), anyLong());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void shouldReturnStoragePropertiesWhenTheyExist()
|
public void shouldReturnStoragePropertiesWhenTheyExist()
|
||||||
{
|
{
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Repository
|
* Alfresco Repository
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2023 Alfresco Software Limited
|
* Copyright (C) 2005 - 2022 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
@@ -34,7 +34,6 @@ import static org.alfresco.model.ContentModel.ASSOC_MEMBER;
|
|||||||
import static org.alfresco.model.ContentModel.TYPE_CONTENT;
|
import static org.alfresco.model.ContentModel.TYPE_CONTENT;
|
||||||
import static org.alfresco.model.ContentModel.TYPE_FOLDER;
|
import static org.alfresco.model.ContentModel.TYPE_FOLDER;
|
||||||
import static org.alfresco.repo.rule.RuleModel.ASPECT_IGNORE_INHERITED_RULES;
|
import static org.alfresco.repo.rule.RuleModel.ASPECT_IGNORE_INHERITED_RULES;
|
||||||
import static org.alfresco.repo.rule.RuleModel.ASPECT_RULES;
|
|
||||||
import static org.alfresco.repo.rule.RuleModel.ASSOC_ACTION;
|
import static org.alfresco.repo.rule.RuleModel.ASSOC_ACTION;
|
||||||
import static org.alfresco.repo.rule.RuleModel.ASSOC_RULE_FOLDER;
|
import static org.alfresco.repo.rule.RuleModel.ASSOC_RULE_FOLDER;
|
||||||
import static org.alfresco.repo.rule.RuleModel.TYPE_RULE;
|
import static org.alfresco.repo.rule.RuleModel.TYPE_RULE;
|
||||||
@@ -49,7 +48,11 @@ import static org.mockito.ArgumentMatchers.eq;
|
|||||||
import static org.mockito.ArgumentMatchers.nullable;
|
import static org.mockito.ArgumentMatchers.nullable;
|
||||||
import static org.mockito.BDDMockito.given;
|
import static org.mockito.BDDMockito.given;
|
||||||
import static org.mockito.BDDMockito.then;
|
import static org.mockito.BDDMockito.then;
|
||||||
import static org.mockito.Mockito.*;
|
import static org.mockito.Mockito.atLeastOnce;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.times;
|
||||||
|
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
import static org.mockito.MockitoAnnotations.openMocks;
|
import static org.mockito.MockitoAnnotations.openMocks;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@@ -94,7 +97,7 @@ public class RuleServiceImplUnitTest
|
|||||||
@Mock
|
@Mock
|
||||||
private PermissionService permissionService;
|
private PermissionService permissionService;
|
||||||
@Mock
|
@Mock
|
||||||
private SimpleCache<NodeRef, List<Rule>> nodeRulesCache;
|
private SimpleCache nodeRulesCache;
|
||||||
@Mock
|
@Mock
|
||||||
private NodeService runtimeNodeService;
|
private NodeService runtimeNodeService;
|
||||||
@Mock
|
@Mock
|
||||||
@@ -135,12 +138,12 @@ public class RuleServiceImplUnitTest
|
|||||||
// Call the method under test.
|
// Call the method under test.
|
||||||
ruleService.saveRule(FOLDER_NODE, mockRule);
|
ruleService.saveRule(FOLDER_NODE, mockRule);
|
||||||
|
|
||||||
then(nodeService).should(times(2)).hasAspect(FOLDER_NODE, ASPECT_RULES);
|
then(nodeService).should(times(2)).hasAspect(FOLDER_NODE, RuleModel.ASPECT_RULES);
|
||||||
then(nodeService).should().exists(FOLDER_NODE);
|
then(nodeService).should().exists(FOLDER_NODE);
|
||||||
then(nodeService).should().addAspect(FOLDER_NODE, ASPECT_RULES, null);
|
then(nodeService).should().addAspect(FOLDER_NODE, RuleModel.ASPECT_RULES, null);
|
||||||
then(nodeService).should().createNode(eq(RULE_SET_NODE), eq(ASSOC_CONTAINS), any(QName.class), eq(TYPE_RULE));
|
then(nodeService).should().createNode(eq(RULE_SET_NODE), eq(ASSOC_CONTAINS), any(QName.class), eq(TYPE_RULE));
|
||||||
then(nodeService).should(atLeastOnce()).setProperty(eq(RULE_NODE), any(QName.class), nullable(Serializable.class));
|
then(nodeService).should(atLeastOnce()).setProperty(eq(RULE_NODE), any(QName.class), nullable(Serializable.class));
|
||||||
then(nodeService).should().getChildAssocs(RULE_NODE, ASSOC_ACTION, ASSOC_ACTION);
|
then(nodeService).should().getChildAssocs(RULE_NODE, RuleModel.ASSOC_ACTION, RuleModel.ASSOC_ACTION);
|
||||||
verifyNoMoreInteractions(nodeService);
|
verifyNoMoreInteractions(nodeService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -426,7 +429,7 @@ public class RuleServiceImplUnitTest
|
|||||||
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
||||||
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
||||||
|
|
||||||
assertEquals("Node names should match expected string", "A,B,C,D,E", nodeNames);
|
assertEquals("A,B,C,D,E", nodeNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check that ordered parents are returned in the correct order. */
|
/** Check that ordered parents are returned in the correct order. */
|
||||||
@@ -440,7 +443,7 @@ public class RuleServiceImplUnitTest
|
|||||||
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
||||||
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
||||||
|
|
||||||
assertEquals("Node names should match expected string", "A,B,C,D,E", nodeNames);
|
assertEquals("A,B,C,D,E", nodeNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check that the ASPECT_IGNORE_INHERITED_RULES aspect breaks the chain. */
|
/** Check that the ASPECT_IGNORE_INHERITED_RULES aspect breaks the chain. */
|
||||||
@@ -455,7 +458,7 @@ public class RuleServiceImplUnitTest
|
|||||||
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
||||||
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
||||||
|
|
||||||
assertEquals("Node names should match expected string", "C,D,E", nodeNames);
|
assertEquals("C,D,E", nodeNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check that the user group hierarchy is not traversed. */
|
/** Check that the user group hierarchy is not traversed. */
|
||||||
@@ -472,7 +475,7 @@ public class RuleServiceImplUnitTest
|
|||||||
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
||||||
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
||||||
|
|
||||||
assertEquals("Node names should match expected string", "C,D,E", nodeNames);
|
assertEquals("C,D,E", nodeNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check that a cycle doesn't cause a problem. */
|
/** Check that a cycle doesn't cause a problem. */
|
||||||
@@ -486,7 +489,7 @@ public class RuleServiceImplUnitTest
|
|||||||
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
||||||
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
||||||
|
|
||||||
assertEquals("Node names should match expected string", "A,B,C", nodeNames);
|
assertEquals("A,B,C", nodeNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check that a diamond of nodes is traversed correctly. */
|
/** Check that a diamond of nodes is traversed correctly. */
|
||||||
@@ -500,7 +503,7 @@ public class RuleServiceImplUnitTest
|
|||||||
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
||||||
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
||||||
|
|
||||||
assertEquals("Node names should match expected string", "A,B,C,D", nodeNames);
|
assertEquals("A,B,C,D", nodeNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -525,7 +528,7 @@ public class RuleServiceImplUnitTest
|
|||||||
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
||||||
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
||||||
|
|
||||||
assertEquals("Node names should match expected string", "A,C,B,E,D,F,G", nodeNames);
|
assertEquals("A,C,B,E,D,F,G", nodeNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -550,7 +553,7 @@ public class RuleServiceImplUnitTest
|
|||||||
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
||||||
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
||||||
|
|
||||||
assertEquals("Node names should match expected string", "A,D,C,F,B,E,G", nodeNames);
|
assertEquals("A,D,C,F,B,E,G", nodeNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -8,37 +8,36 @@
|
|||||||
<property name="location" value="test-messaging.properties" />
|
<property name="location" value="test-messaging.properties" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="transactionAwareEventProducer" class="org.mockito.Mockito" factory-method="mock">
|
|
||||||
<constructor-arg type="java.lang.Class" value="org.alfresco.repo.rawevents.TransactionAwareEventProducer" />
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="policyComponent" class="org.mockito.Mockito" factory-method="mock">
|
|
||||||
<constructor-arg type="java.lang.Class" value="org.alfresco.repo.policy.PolicyComponentImpl"/>
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="transformRequestProcessor" class="org.mockito.Mockito" factory-method="mock">
|
|
||||||
<constructor-arg type="java.lang.Class" value="org.alfresco.repo.rendition2.TransformRequestProcessor" />
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<import resource="classpath:/alfresco/subsystems/Messaging/default/messaging-context.xml" />
|
<import resource="classpath:/alfresco/subsystems/Messaging/default/messaging-context.xml" />
|
||||||
|
|
||||||
<bean id="messagingExceptionProcessor"
|
<bean id="messagingExceptionProcessor"
|
||||||
class="org.alfresco.messaging.camel.MockExceptionProcessor" />
|
class="org.alfresco.messaging.camel.MockExceptionProcessor" />
|
||||||
|
|
||||||
<bean id="mockConsumer"
|
<bean id="mockConsumer"
|
||||||
class="org.alfresco.messaging.camel.MockConsumer" />
|
class="org.alfresco.messaging.camel.MockConsumer" />
|
||||||
|
|
||||||
<bean id="mockExceptionThrowingConsumer"
|
|
||||||
class="org.alfresco.messaging.camel.MockExceptionThrowingConsumer" />
|
|
||||||
|
|
||||||
|
<bean id="mockExceptionThrowingConsumer"
|
||||||
|
class="org.alfresco.messaging.camel.MockExceptionThrowingConsumer" />
|
||||||
|
|
||||||
<import resource="testRoutes.xml" />
|
<import resource="testRoutes.xml" />
|
||||||
<bean id="testNewRouteLoader" class="org.alfresco.messaging.camel.SpringContextRouteLoader">
|
<bean id="testNewRouteLoader" class="org.alfresco.messaging.camel.SpringContextRouteLoader">
|
||||||
<property name="camelContextId" value="alfrescoCamelContext" />
|
<property name="camelContextId" value="alfrescoCamelContext" />
|
||||||
<property name="routeContextId" value="customRoutes" />
|
<property name="routeContextId" value="customRoutes" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="renditionEventProcessor" class="org.mockito.Mockito" factory-method="mock">
|
<bean id="transactionAwareEventProducer" class="org.mockito.Mockito" factory-method="mock">
|
||||||
<constructor-arg type="java.lang.Class" value="org.alfresco.repo.rendition2.RenditionEventProcessor"/>
|
<constructor-arg value="org.alfresco.repo.rawevents.TransactionAwareEventProducer" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="policyComponent" class="org.mockito.Mockito" factory-method="mock">
|
||||||
|
<constructor-arg value="org.alfresco.repo.policy.PolicyComponentImpl"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean id="renditionEventProcessor" class="org.mockito.Mockito" factory-method="mock">
|
||||||
|
<constructor-arg value="org.alfresco.repo.rendition2.RenditionEventProcessor"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean id="transformRequestProcessor" class="org.mockito.Mockito" factory-method="mock">
|
||||||
|
<constructor-arg value="org.alfresco.repo.rendition2.TransformRequestProcessor" />
|
||||||
|
</bean>
|
||||||
</beans>
|
</beans>
|
||||||
@@ -3,23 +3,23 @@
|
|||||||
<beans>
|
<beans>
|
||||||
|
|
||||||
<bean id="repositoryHelper" class="org.mockito.Mockito" factory-method="mock">
|
<bean id="repositoryHelper" class="org.mockito.Mockito" factory-method="mock">
|
||||||
<constructor-arg type="java.lang.Class" value="org.alfresco.repo.model.Repository" />
|
<constructor-arg value="org.alfresco.repo.model.Repository" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="SiteService" class="org.mockito.Mockito" factory-method="mock">
|
<bean id="SiteService" class="org.mockito.Mockito" factory-method="mock">
|
||||||
<constructor-arg type="java.lang.Class" value="org.alfresco.repo.site.SiteServiceInternal" />
|
<constructor-arg value="org.alfresco.repo.site.SiteServiceInternal" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="NodeService" class="org.mockito.Mockito" factory-method="mock">
|
<bean id="NodeService" class="org.mockito.Mockito" factory-method="mock">
|
||||||
<constructor-arg type="java.lang.Class" value="org.alfresco.service.cmr.repository.NodeService" />
|
<constructor-arg value="org.alfresco.service.cmr.repository.NodeService" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="NamespaceService" class="org.mockito.Mockito" factory-method="mock">
|
<bean id="NamespaceService" class="org.mockito.Mockito" factory-method="mock">
|
||||||
<constructor-arg type="java.lang.Class" value="org.alfresco.service.namespace.NamespaceService" />
|
<constructor-arg value="org.alfresco.service.namespace.NamespaceService" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="SearchService" class="org.mockito.Mockito" factory-method="mock">
|
<bean id="SearchService" class="org.mockito.Mockito" factory-method="mock">
|
||||||
<constructor-arg type="java.lang.Class" value="org.alfresco.service.cmr.search.SearchService" />
|
<constructor-arg value="org.alfresco.service.cmr.search.SearchService" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
</beans>
|
</beans>
|
||||||
Reference in New Issue
Block a user