Compare commits

..

52 Commits

Author SHA1 Message Date
alfresco-build
a0c39e4d59 [maven-release-plugin][skip ci] prepare for next development iteration 2023-08-06 00:06:30 +00:00
alfresco-build
fc206cfd76 [maven-release-plugin][skip ci] prepare release 23.1.0.182 2023-08-06 00:06:27 +00:00
Alfresco CI User
1da5e242bc [force] Force release for 2023-08-06. 2023-08-06 00:03:10 +00:00
alfresco-build
317ac9c5fe [maven-release-plugin][skip ci] prepare for next development iteration 2023-08-04 07:49:37 +00:00
alfresco-build
8b4dcb293b [maven-release-plugin][skip ci] prepare release 23.1.0.181 2023-08-04 07:49:34 +00:00
kcichonczyk
de97875518 [ACS-5756] Introduce locks to make sure the methods are not interfering with each other 2023-08-04 09:03:56 +02:00
alfresco-build
96c3a7cec0 [maven-release-plugin][skip ci] prepare for next development iteration 2023-08-03 17:06:28 +00:00
alfresco-build
bf2ec6c36f [maven-release-plugin][skip ci] prepare release 23.1.0.180 2023-08-03 17:06:26 +00:00
Tom Page
36d09c230e PRODENG-222 Update to PMD 7. (#2111) 2023-08-03 15:46:32 +01:00
alfresco-build
2ce4d837c5 [maven-release-plugin][skip ci] prepare for next development iteration 2023-08-01 15:24:32 +00:00
alfresco-build
ffe60440af [maven-release-plugin][skip ci] prepare release 23.1.0.179 2023-08-01 15:24:28 +00:00
Oskar Rajzner
b4eb5b6607 ACS-5020 Fix intermittent test class failure(#2098) 2023-08-01 16:00:08 +02:00
alfresco-build
9e7bd17961 [maven-release-plugin][skip ci] prepare for next development iteration 2023-07-30 02:05:19 +00:00
alfresco-build
66426ae9db [maven-release-plugin][skip ci] prepare release 23.1.0.178 2023-07-30 02:05:16 +00:00
suneet-gupta
83a17d0876 Preparing Code freeze Alpha Release 2023-07-30 06:26:33 +05:30
alfresco-build
500d9fa3aa [maven-release-plugin][skip ci] prepare for next development iteration 2023-07-30 00:06:55 +00:00
alfresco-build
992617667e [maven-release-plugin][skip ci] prepare release 23.1.0.177 2023-07-30 00:06:52 +00:00
Alfresco CI User
3a1596c3fa [force] Force release for 2023-07-30. 2023-07-30 00:03:16 +00:00
alfresco-build
d3883e0ad8 [maven-release-plugin][skip ci] prepare for next development iteration 2023-07-29 10:35:58 +00:00
alfresco-build
bc621ff4cf [maven-release-plugin][skip ci] prepare release 23.1.0.176 2023-07-29 10:35:53 +00:00
suneet-gupta
ca3f620bc3 Preparing Code freeze Alpha Release 2023-07-29 15:20:02 +05:30
alfresco-build
208f139f57 [maven-release-plugin][skip ci] prepare for next development iteration 2023-07-28 11:20:41 +00:00
alfresco-build
780bc94796 [maven-release-plugin][skip ci] prepare release 23.1.0.175 2023-07-28 11:20:38 +00:00
Oskar Rajzner
86189efc4a ACS-5449 Code quality improvements to LockServiceImplTest & RuleServiceImplUnitTest (#2087) 2023-07-28 12:20:18 +02:00
alfresco-build
a39fa50bcf [maven-release-plugin][skip ci] prepare for next development iteration 2023-07-28 10:03:06 +00:00
alfresco-build
bce433fa12 [maven-release-plugin][skip ci] prepare release 23.1.0.174 2023-07-28 10:03:04 +00:00
Piotr Żurek
d7f5e72d2d ACS-5720 Fix NPE while retrieving the RMI Registry (#2095) 2023-07-28 11:07:14 +02:00
alfresco-build
cf5bf05096 [maven-release-plugin][skip ci] prepare for next development iteration 2023-07-27 19:25:35 +00:00
alfresco-build
f96014e570 [maven-release-plugin][skip ci] prepare release 23.1.0.173 2023-07-27 19:25:32 +00:00
Maciej Pichura
154614b674 ACS-5624 Search and Favorites API enhancements - E2E test (#2091)
* ACS-5624: Seacrh and Favorites API enhancements.

* ACS-5624: Reverting unwanted test change.

* ACS-5624: Adding isFavorite to SearchNodeModel.

* ACS-5624: Moving E2E test from InsightEngine/SearchServices project.

* ACS-5624: Moving E2E test from InsightEngine/SearchServices project.

* ACS-5624: Splitting test into 2 methods.

* ACS-5624: Fixing test method name

Co-authored-by: Tom Page <tpage-alfresco@users.noreply.github.com>

* ACS-5624: Fixing some static code scan issues.

---------

Co-authored-by: Tom Page <tpage-alfresco@users.noreply.github.com>
2023-07-27 18:01:41 +02:00
alfresco-build
c842e6ba49 [maven-release-plugin][skip ci] prepare for next development iteration 2023-07-27 13:46:15 +00:00
alfresco-build
a1d6538223 [maven-release-plugin][skip ci] prepare release 23.1.0.172 2023-07-27 13:46:12 +00:00
Oskar Rajzner
7008875dbc ACS-5449 Add commons-net to dependenciesManagement in pom.xml (#2093) 2023-07-27 14:25:57 +02:00
Tom Page
0b6b405c5f ACS-5698 Allow specifying version when performing force release. (#2089) 2023-07-26 15:51:12 +01:00
alfresco-build
f96b638c38 [maven-release-plugin][skip ci] prepare for next development iteration 2023-07-26 13:37:18 +00:00
alfresco-build
8bab9b3331 [maven-release-plugin][skip ci] prepare release 23.1.0.171 2023-07-26 13:37:15 +00:00
Oskar Rajzner
8a75a48f99 ACS-5449 Bump commons-net from 3.8.0 to 3.9.0 (#2080) 2023-07-26 14:48:25 +02:00
alfresco-build
6f27523f5f [maven-release-plugin][skip ci] prepare for next development iteration 2023-07-26 11:01:56 +00:00
alfresco-build
3cb17dc1a5 [maven-release-plugin][skip ci] prepare release 23.1.0.170 2023-07-26 11:01:52 +00:00
Oskar Rajzner
4faeaff6b6 ACS-5449 Bump mockito-core from 4.9.0 to 5.4.0 (#2071) 2023-07-26 11:37:59 +02:00
Tom Page
fcf3e005e4 Merge pull request #2085 from Alfresco/feature/MNT-23763_ImagePreviewWebscript
MNT-23763 Fix image preview webscript for use with ES.
2023-07-26 10:14:39 +01:00
Tom Page
5253e77444 MNT-23763 Fix boolean logic for two more webscripts to match latest search behaviour. 2023-07-25 15:24:00 +01:00
alfresco-build
e2464ffd4f [maven-release-plugin][skip ci] prepare for next development iteration 2023-07-25 14:09:58 +00:00
alfresco-build
57da82028f [maven-release-plugin][skip ci] prepare release 23.1.0.169 2023-07-25 14:09:54 +00:00
Tom Page
90dd44e63b MNT-23763 Update image preview dashlet query to work with Solr and ES.
Also mark previews and thumbnails as isIndexed:false in the sample site.
2023-07-25 15:05:42 +01:00
Piotr Żurek
61cf8a7273 PRODSEC-7238 Upgrade Camel/Netty (#2084) 2023-07-25 14:45:54 +02:00
alfresco-build
7684a74dcc [maven-release-plugin][skip ci] prepare for next development iteration 2023-07-24 14:12:47 +00:00
alfresco-build
4a49c29b3c [maven-release-plugin][skip ci] prepare release 23.1.0.168 2023-07-24 14:12:44 +00:00
Kacper Magdziarz
693f8cd5c9 [ACS-5578] Remove cmistck servlet (#2083) 2023-07-24 15:24:01 +02:00
alfresco-build
083bd3ce35 [maven-release-plugin][skip ci] prepare for next development iteration 2023-07-23 00:08:00 +00:00
alfresco-build
aef7febbf5 [maven-release-plugin][skip ci] prepare release 23.1.0.167 2023-07-23 00:07:57 +00:00
Alfresco CI User
db1644dbb2 [force] Force release for 2023-07-23. 2023-07-23 00:03:20 +00:00
42 changed files with 1145 additions and 1159 deletions

View File

@@ -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@v1.0.0 - uses: Alfresco/ya-pmd-scan@v2.0.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:

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<modules> <modules>

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<modules> <modules>

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<build> <build>

View File

@@ -50,7 +50,6 @@ 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;
@@ -65,7 +64,9 @@ 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.*; import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPeriodProperty.CREATED_DATE;
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;
@@ -84,28 +85,25 @@ 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 RecordCategory Category1; private static final String CATEGORY_RM_3077 = TEST_PREFIX + "RM-3077_manager_sees_me";
private RecordCategoryChild CopyCatFolder,folder1,CatFolder,folder2; private static final String COPY_CATEGORY_RM_3077 = "Copy_of_" + CATEGORY_RM_3077;
private static final String categoryRM3077 = TEST_PREFIX + "RM-3077_manager_sees_me"; private static final String FOLDER_RM_3077 = "RM-3077_folder_"+ CATEGORY_RM_3077;
private static final String copyCategoryRM3077 = "Copy_of_" + categoryRM3077; private static final String COPY_FOLDER_RM_3077 = "Copy_of_" + FOLDER_RM_3077;
private static final String folderRM3077 = "RM-3077_folder_"+ categoryRM3077; private static final String FIRST_CATEGORY_RM_3060 = TEST_PREFIX + "RM-3060_category_record";
private static final String copyFolderRM3077 = "Copy_of_" + folderRM3077; private static final String SECOND_CATEGORY_RM_3060 = "Copy_of_" + FIRST_CATEGORY_RM_3060;
private final String folder = TEST_PREFIX + "RM-2937 folder ghosting"; private static final String FIRST_FOLDER_RM_3060 = TEST_PREFIX + "RM-3060_folder";
private static final String firstCategoryRM3060 = TEST_PREFIX + "RM-3060_category_record"; private static final String SECOND_FOLDER_RM_3060 = TEST_PREFIX + "RM-3060_disposition_on_Record_Level";
private static final String secondCategoryRM3060 = "Copy_of_" + firstCategoryRM3060; private static final String ELECTRONIC_RECORD_RM_3060 = TEST_PREFIX + "RM-3060_electronic_1_record";
private static final String firstFolderRM3060 = TEST_PREFIX + "RM-3060_folder"; private static final String NON_ELECTRONIC_RECORD_RM_3060 = TEST_PREFIX + "RM-3060_non-electronic_record";
private static final String secondFolderRM3060 = TEST_PREFIX + "RM-3060_disposition_on_Record_Level"; private static final String FIRST_CATEGORY_RM_1622 = TEST_PREFIX + "RM-1622_category_record";
private static final String electronicRecordRM3060 = TEST_PREFIX + "RM-3060_electronic_1_record"; private static final String SECOND_CATEGORY_RM_1622 = "Copy_of_" + FIRST_CATEGORY_RM_1622;
private static final String nonElectronicRecordRM3060 = TEST_PREFIX + "RM-3060_non-electronic_record"; private static final String FIRST_FOLDER_RM_1622 = TEST_PREFIX + "RM-1622_folder";
private static final String firstCategoryRM1622 = TEST_PREFIX + "RM-1622_category_record"; private static final String ELECTRONIC_RECORD_RM_1622 = TEST_PREFIX + "RM-1622_electronic_1_record";
private static final String secondCategoryRM1622 = "Copy_of_" + firstCategoryRM1622;; private static final String SECOND_FOLDER_RM_1622 = TEST_PREFIX + "RM-1622_disposition_on_Record_Level";
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, rmManager; private UserModel rmAdmin;
@BeforeClass(alwaysRun = true) @BeforeClass(alwaysRun = true)
public void setupDispositionScheduleLinkedRecordsTest() { public void setupDispositionScheduleLinkedRecordsTest() {
@@ -120,11 +118,12 @@ 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
rmManager = getDataUser().createRandomTestUser(); UserModel 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>
@@ -136,194 +135,202 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
* <p> * <p>
* <p/> TestRail Test C775<p/> * <p/> TestRail Test C775<p/>
**/ **/
// @Ignore("ACS-5020") @Test
// @Test @AlfrescoTest(jira = "RM-1622")
// @AlfrescoTest(jira = "RM-1622") public void dispositionScheduleLinkedRecords() throws UnsupportedEncodingException {
// public void dispositionScheduleLinkedRecords() throws UnsupportedEncodingException { STEP("Create record category");
// STEP("Create record category"); RecordCategory category1 = createRootCategory(CATEGORY_RM_3077);
// Category1 = createRootCategory(categoryRM3077);
// //create retention schedule
// //create retention schedule dispositionScheduleService.createCategoryRetentionSchedule(category1.getName(), false);
// dispositionScheduleService.createCategoryRetentionSchedule(Category1.getName(), false);
// // add cut off step
// // add cut off step dispositionScheduleService.addCutOffAfterPeriodStep(category1.getName(), "day|2", CREATED_DATE);
// dispositionScheduleService.addCutOffAfterPeriodStep(Category1.getName(), "day|2", CREATED_DATE);
// //create a copy of the category recordsCategory
// //create a copy of the category recordsCategory String copyCategoryId = copyCategory(getAdminUser(), category1.getId(), COPY_CATEGORY_RM_3077);
// String CopyCategoryId = copyCategory(getAdminUser(),Category1.getId(), copyCategoryRM3077);
// // create folders in both categories
// // create folders in both categories RecordCategoryChild catFolder = createRecordFolder(category1.getId(), FOLDER_RM_3077);
// CatFolder = createRecordFolder(Category1.getId(), folderRM3077); createRecordFolder(copyCategoryId, COPY_FOLDER_RM_3077);
// CopyCatFolder = createRecordFolder(CopyCategoryId, copyFolderRM3077);
// // create record files
// // create record files String electronicRecord = "RM-2801 electronic record";
// String electronicRecord = "RM-2801 electronic record"; Record elRecord = createElectronicRecord(catFolder.getId(), electronicRecord);
// Record elRecord = createElectronicRecord(CatFolder.getId(), electronicRecord); String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
// String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(), getDataUser().usingAdmin().getAdminUser().getPassword(), catFolder.getName(), electronicRecord);
// getDataUser().usingAdmin().getAdminUser().getPassword(), CatFolder.getName(), electronicRecord);
// String nonElectronicRecord = "RM-2801 non-electronic record";
// String nonElectronicRecord = "RM-2801 non-electronic record"; Record nonElRecord = createNonElectronicRecord(catFolder.getId(), nonElectronicRecord);
// Record nonElRecord = createNonElectronicRecord(CatFolder.getId(), nonElectronicRecord); String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
// String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(), getDataUser().usingAdmin().getAdminUser().getPassword(), catFolder.getName(), nonElectronicRecord);
// getDataUser().usingAdmin().getAdminUser().getPassword(), CatFolder.getName(), nonElectronicRecord);
// // link the records to copy folder, then complete them
// // link the records to copy folder, then complete them List<String> recordLists = new ArrayList<>();
// List<String> recordLists = new ArrayList<>(); recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + elRecord.getId());
// recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + elRecord.getId()); recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + nonElRecord.getId());
// recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + nonElRecord.getId());
// linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
// linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(), getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK, COPY_CATEGORY_RM_3077 + "/" +
// getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,copyCategoryRM3077 + "/" + COPY_FOLDER_RM_3077, recordLists);
// copyFolderRM3077, recordLists); recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), elRecordFullName);
// recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), elRecordFullName); recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), nonElRecordFullName);
// recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), nonElRecordFullName);
// // edit disposition date
// // edit disposition date recordFoldersAPI.postFolderAction(getAdminUser().getUsername(),
// recordFoldersAPI.postFolderAction(getAdminUser().getUsername(), getAdminUser().getPassword(),editDispositionDateJson(), catFolder.getName());
// getAdminUser().getPassword(),editDispositionDateJson(),CatFolder.getName());
// // cut off the Folder
// // cut off the Folder recordFoldersAPI.postFolderAction(getAdminUser().getUsername(),
// recordFoldersAPI.postFolderAction(getAdminUser().getUsername(), getAdminUser().getPassword(),new JSONObject().put("name","cutoff"), catFolder.getName());
// getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),CatFolder.getName());
// // Verify the Content
// // Verify the Content Node electronicNode = getNode(elRecord.getId());
// Node electronicNode = getNode(elRecord.getId()); assertTrue("The content of " + electronicRecord + " is available",
// assertTrue("The content of " + electronicRecord + " is available", StringUtils.isEmpty(electronicNode.getNodeContent().getResponse().getBody().asString()));
// StringUtils.isEmpty(electronicNode.getNodeContent().getResponse().getBody().asString()));
// // verify the Properties
// // verify the Properties AssertJUnit.assertNull("The properties are present even after cutting off the record.", elRecord.getProperties().getTitle());
// AssertJUnit.assertNull("The properties are present even after cutting off the record.", elRecord.getProperties().getTitle());
// // delete precondition
// // delete precondition deleteRecordCategory(category1.getId());
// deleteRecordCategory(Category1.getId()); deleteRecordCategory(copyCategoryId);
// 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
// * */ * */
// @Ignore("ACS-5020") @Test
//// @Test @AlfrescoTest (jira = "RM-3060")
// @AlfrescoTest (jira = "RM-3060") public void sameDispositionScheduleLinkedRecords() throws UnsupportedEncodingException {
// public void sameDispositionScheduleLinkedRecords() throws UnsupportedEncodingException {
// // create a category with retention applied on records level
// // create a category with retention applied on records level RecordCategory recordCategory = getRestAPIFactory().getFilePlansAPI(rmAdmin)
// RecordCategory recordCategory = getRestAPIFactory().getFilePlansAPI(rmAdmin) .createRootRecordCategory(RecordCategory.builder().name(FIRST_CATEGORY_RM_3060).build(),
// .createRootRecordCategory(RecordCategory.builder().name(firstCategoryRM3060).build(), RecordCategory.DEFAULT_FILE_PLAN_ALIAS);
// RecordCategory.DEFAULT_FILE_PLAN_ALIAS); dispositionScheduleService.createCategoryRetentionSchedule(FIRST_CATEGORY_RM_3060, true);
// dispositionScheduleService.createCategoryRetentionSchedule(firstCategoryRM3060, true); dispositionScheduleService.addCutOffAfterPeriodStep(FIRST_CATEGORY_RM_3060, "week|1", DATE_FILED);
// dispositionScheduleService.addCutOffAfterPeriodStep(firstCategoryRM3060, "week|1", DATE_FILED); dispositionScheduleService.addTransferAfterEventStep(
// dispositionScheduleService.addTransferAfterEventStep(firstCategoryRM3060, TRANSFER_LOCATION, RMEvents.CASE_CLOSED.getEventName()); FIRST_CATEGORY_RM_3060, TRANSFER_LOCATION, RMEvents.CASE_CLOSED.getEventName());
// dispositionScheduleService.addDestroyWithoutGhostingAfterPeriodStep(firstCategoryRM3060, "week|1", CUT_OFF_DATE); dispositionScheduleService.addDestroyWithoutGhostingAfterPeriodStep(FIRST_CATEGORY_RM_3060, "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(), secondCategoryRM3060); String categorySecondId = copyCategory(getAdminUser(), recordCategory.getId(), SECOND_CATEGORY_RM_3060);
//
// // 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(),firstFolderRM3060); RecordCategoryChild firstFolderRecordCategoryChild = createRecordFolder(recordCategory.getId(),
// Record firstElectronicRecord = createElectronicRecord(firstFolderRecordCategoryChild.getId(),electronicRecordRM3060); FIRST_FOLDER_RM_3060);
// Record firstElectronicRecord = createElectronicRecord(firstFolderRecordCategoryChild.getId(),
// String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().getAdminUser().getUsername(), ELECTRONIC_RECORD_RM_3060);
// getDataUser().getAdminUser().getPassword(),firstFolderRM3060, electronicRecordRM3060);
// String elRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(), String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().getAdminUser().getUsername(),
// getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM3060 + "/" + firstFolderRM3060); getDataUser().getAdminUser().getPassword(), FIRST_FOLDER_RM_3060, ELECTRONIC_RECORD_RM_3060);
// String elRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
// recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(), getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + FIRST_CATEGORY_RM_3060 + "/" + FIRST_FOLDER_RM_3060);
// getDataUser().getAdminUser().getPassword(), elRecordFullName);
// recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(),
// // create a folder on the category secondCategoryRM3060 with a non electronic record getDataUser().getAdminUser().getPassword(), elRecordFullName);
// RecordCategoryChild secondFolderRecordCategoryChild = createRecordFolder(categorySecondId,secondFolderRM3060);
// Record secondNonElectronicRecord = createNonElectronicRecord(secondFolderRecordCategoryChild.getId(),nonElectronicRecordRM3060); // create a folder on the category secondCategoryRM3060 with a non electronic record
// RecordCategoryChild secondFolderRecordCategoryChild = createRecordFolder(categorySecondId,
// // link the nonElectronicRecordRM3060 to firstFolderRM3060 SECOND_FOLDER_RM_3060);
// List<String> recordLists = new ArrayList<>(); Record secondNonElectronicRecord = createNonElectronicRecord(secondFolderRecordCategoryChild.getId(),
// recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId()); NON_ELECTRONIC_RECORD_RM_3060);
//
// linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(), // link the nonElectronicRecordRM3060 to firstFolderRM3060
// getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,secondCategoryRM3060 + "/" + List<String> recordLists = new ArrayList<>();
// secondFolderRM3060, recordLists); recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId());
// String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
// getDataUser().usingAdmin().getAdminUser().getPassword(), secondFolderRM3060, secondNonElectronicRecord.getName()); linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
// String nonElRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(), getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK, SECOND_CATEGORY_RM_3060 + "/" +
// getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + secondCategoryRM3060 + "/" + secondFolderRM3060); SECOND_FOLDER_RM_3060, recordLists);
// String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
// // complete records and cut them off getDataUser().usingAdmin().getAdminUser().getPassword(),
// recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(), SECOND_FOLDER_RM_3060, secondNonElectronicRecord.getName());
// getDataUser().getAdminUser().getPassword(), nonElRecordFullName); String nonElRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
// getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + SECOND_CATEGORY_RM_3060
// // edit the disposition date + "/" + SECOND_FOLDER_RM_3060);
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
// getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef); // complete records and cut them off
// recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(),
// // cut off the record getDataUser().getAdminUser().getPassword(), nonElRecordFullName);
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
// getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),nonElRecordNameNodeRef); // edit the disposition date
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
// //check the record is cut off getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef);
// 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
// // link the electronic record to secondFolderRM3060 recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
// recordLists.clear(); getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),nonElRecordNameNodeRef);
// recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId());
// linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(), //check the record is cut off
// getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,secondCategoryRM3060 + "/" + 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));
// secondFolderRM3060, recordLists);
// // link the electronic record to secondFolderRM3060
// // edit the disposition date and cut off the record recordLists.clear();
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId());
// getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef); linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK, SECOND_CATEGORY_RM_3060 + "/" +
// getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),elRecordNameNodeRef); SECOND_FOLDER_RM_3060, recordLists);
//
// AssertJUnit.assertTrue("The file " + electronicRecordRM3060 + " has not been successfully cut off.", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(CUT_OFF_ASPECT)); // edit the disposition date and cut off the record
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
// // open the record and complete the disposition schedule event getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef);
// rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(), recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
// getAdminUser().getPassword(), elRecordFullName, RMEvents.CASE_CLOSED, Instant.now()); getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),elRecordNameNodeRef);
// rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(),
// getAdminUser().getPassword(), nonElRecordFullName, RMEvents.CASE_CLOSED, Instant.now()); AssertJUnit.assertTrue("The file " + ELECTRONIC_RECORD_RM_3060 + " has not been successfully cut off.", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(CUT_OFF_ASPECT));
//
// // transfer the files & complete transfers // open the record and complete the disposition schedule event
// HttpResponse nonElRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(),
// getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(), getAdminUser().getPassword(), elRecordFullName, RMEvents.CASE_CLOSED, Instant.now());
// getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + secondCategoryRM3060 + "/" + secondFolderRM3060)); rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(),
// getAdminUser().getPassword(), nonElRecordFullName, RMEvents.CASE_CLOSED, Instant.now());
// String nonElRecordNameTransferId = getTransferId(nonElRecordNameHttpResponse,nonElRecordNameNodeRef);
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), // transfer the files & complete transfers
// getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),nonElRecordNameTransferId); HttpResponse nonElRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
// getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
// HttpResponse elRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + SECOND_CATEGORY_RM_3060
// getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(), + "/" + SECOND_FOLDER_RM_3060));
// getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM3060 + "/" + firstFolderRM3060));
// String nonElRecordNameTransferId = getTransferId(nonElRecordNameHttpResponse,nonElRecordNameNodeRef);
// String elRecordNameTransferId = getTransferId(elRecordNameHttpResponse,elRecordNameNodeRef); recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),nonElRecordNameTransferId);
// getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),elRecordNameTransferId);
// HttpResponse elRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
// AssertJUnit.assertTrue("The file " + electronicRecordRM3060 + " has not been successfully transferred", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE)); getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
// AssertJUnit.assertTrue("The file " + nonElectronicRecordRM3060 + " has not been successfully transferred.", getRestAPIFactory().getRecordsAPI().getRecord(secondNonElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE)); getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + FIRST_CATEGORY_RM_3060
// + "/" + FIRST_FOLDER_RM_3060));
// // edit the disposition date for nonElectronicRecordRM3060 & electronicRecordRM3060
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), String elRecordNameTransferId = getTransferId(elRecordNameHttpResponse,elRecordNameNodeRef);
// getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef); recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),elRecordNameTransferId);
// 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));
// // destroy nonElectronicRecordRM3060 & electronicRecordRM3060 records AssertJUnit.assertTrue("The file " + NON_ELECTRONIC_RECORD_RM_3060 + " has not been successfully transferred.", getRestAPIFactory().getRecordsAPI().getRecord(secondNonElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE));
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
// getAdminUser().getPassword(),new JSONObject().put("name","destroy"),nonElRecordNameNodeRef); // edit the disposition date for nonElectronicRecordRM3060 & electronicRecordRM3060
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
// getAdminUser().getPassword(),new JSONObject().put("name","destroy"),elRecordNameNodeRef); getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef);
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
// // check the file is not displayed getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef);
// assertNull("The file " + nonElectronicRecordRM3060 + " has not been successfully destroyed.", secondNonElectronicRecord.getContent());
// assertNull("The file " + electronicRecordRM3060 + " has not been successfully destroyed.", firstElectronicRecord.getContent()); // destroy nonElectronicRecordRM3060 & electronicRecordRM3060 records
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
// // delete precondition getAdminUser().getPassword(),new JSONObject().put("name","destroy"),nonElRecordNameNodeRef);
// deleteRecordCategory(recordCategory.getId()); recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
// deleteRecordCategory(categorySecondId); getAdminUser().getPassword(),new JSONObject().put("name","destroy"),elRecordNameNodeRef);
// }
// 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() {};
@@ -354,7 +361,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 = null; String responseString;
try { try {
responseString = EntityUtils.toString(entity, "UTF-8"); responseString = EntityUtils.toString(entity, "UTF-8");
} catch (IOException e) { } catch (IOException e) {
@@ -365,7 +372,6 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
.getJSONObject("results") .getJSONObject("results")
.get(nodeRef) .get(nodeRef)
.toString(); .toString();
} }
@Test @Test
@@ -374,35 +380,39 @@ 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(firstCategoryRM1622).build(), .createRootRecordCategory(RecordCategory.builder().name(
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(secondCategoryRM1622).build(), .createRootRecordCategory(RecordCategory.builder().name(
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(firstCategoryRM1622, true); dispositionScheduleService.createCategoryRetentionSchedule(FIRST_CATEGORY_RM_1622, 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(firstCategoryRM1622, "day|1", DATE_FILED); dispositionScheduleService.addCutOffAfterPeriodStep(FIRST_CATEGORY_RM_1622, "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(),firstFolderRM1622); RecordCategoryChild firstFolderRecordCategoryChild = createRecordFolder(catsameLevel1.getId(),
Record firstElectronicRecord = createElectronicRecord(firstFolderRecordCategoryChild.getId(),electronicRecordRM1622); FIRST_FOLDER_RM_1622);
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(),firstFolderRM1622, electronicRecordRM1622); getDataUser().getAdminUser().getPassword(), FIRST_FOLDER_RM_1622, ELECTRONIC_RECORD_RM_1622);
String elRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(), recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM1622 + "/" + firstFolderRM1622); getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + FIRST_CATEGORY_RM_1622 + "/" + FIRST_FOLDER_RM_1622);
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
RecordCategoryChild secondFolderRecordCategoryChild = createRecordFolder(catsameLevel2.getId(),secondFolderRM1622); createRecordFolder(catsameLevel2.getId(), SECOND_FOLDER_RM_1622);
String elRecordNameNodeRefs = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(), String elRecordNameNodeRefs = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM1622 + "/" + firstFolderRM1622); getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + FIRST_CATEGORY_RM_1622 + "/" + FIRST_FOLDER_RM_1622);
// link it to the folder in second category through the details page // link it to the folder in second category through the details page
@@ -410,14 +420,12 @@ 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,secondCategoryRM1622 + "/" + getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK, SECOND_CATEGORY_RM_1622 + "/" +
secondFolderRM1622, recordLists); SECOND_FOLDER_RM_1622, 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" })
@@ -428,4 +436,4 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
// Verify the status code // Verify the status code
assertStatusCode(NO_CONTENT); assertStatusCode(NO_CONTENT);
} }
} }

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<modules> <modules>

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<properties> <properties>

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<build> <build>

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<modules> <modules>

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<properties> <properties>

View File

@@ -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 += " -ASPECT:\"{http://www.alfresco.org/model/content/1.0}workingcopy\""; query += " AND -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 usefull info will come with facets // query minimum rows because all useful info will come with facets
maxItems: 1, maxItems: 1,
skipCount: 0 skipCount: 0
}, },

View File

@@ -24,7 +24,7 @@ function getCategoryNode()
else else
{ {
var queryPath = "/" + catAspect + "/" + encodePath(path); var queryPath = "/" + catAspect + "/" + encodePath(path);
categoryResults = search.luceneSearch("+PATH:\"" + queryPath + "/*\" -PATH:\"" + queryPath + "/member\""); categoryResults = search.luceneSearch("+PATH:\"" + queryPath + "/*\" AND -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);
} }

View File

@@ -29,7 +29,7 @@ function main()
{ {
query = "+PATH:\"" + parsedArgs.pathNode.qnamePath + "//*\" "; query = "+PATH:\"" + parsedArgs.pathNode.qnamePath + "//*\" ";
} }
query += "+TYPE:\"cm:content\" +@cm\\:content.mimetype:image/*"; query += "AND +TYPE:\"cm:content\" AND +@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();

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<dependencies> <dependencies>

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<properties> <properties>

View File

@@ -39,7 +39,6 @@ public class DirectAccessUrl implements Serializable
private String contentUrl; private String contentUrl;
private Date expiryTime; private Date expiryTime;
private boolean attachment; private boolean attachment;
private String fileName;
public String getContentUrl() public String getContentUrl()
{ {
@@ -71,28 +70,18 @@ public class DirectAccessUrl implements Serializable
this.attachment = attachment; this.attachment = attachment;
} }
public String getFileName()
{
return fileName;
}
public void setFileName(String fileName)
{
this.fileName = fileName;
}
@Override public boolean equals(Object obj) @Override public boolean equals(Object obj)
{ {
if (this == obj) return true; if (this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false; if (obj == null || getClass() != obj.getClass()) return false;
DirectAccessUrl that = (DirectAccessUrl) obj; DirectAccessUrl that = (DirectAccessUrl) obj;
return Objects.equals(fileName, that.fileName) && attachment == that.attachment && Objects.equals(contentUrl, return attachment == that.attachment && Objects.equals(contentUrl,
that.contentUrl) && Objects.equals(expiryTime, that.expiryTime); that.contentUrl) && Objects.equals(expiryTime, that.expiryTime);
} }
@Override public int hashCode() @Override public int hashCode()
{ {
return Objects.hash(contentUrl, expiryTime, attachment, fileName); return Objects.hash(contentUrl, expiryTime, attachment);
} }
} }

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<dependencies> <dependencies>

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
</project> </project>

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<properties> <properties>

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<modules> <modules>

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<modules> <modules>

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<organization> <organization>

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<developers> <developers>

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<developers> <developers>

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<properties> <properties>

View File

@@ -1,11 +1,16 @@
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;
@@ -15,6 +20,7 @@ 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;
@@ -61,7 +67,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() throws Exception public void managerIsAbleToRetrieveFavorites()
{ {
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteManager)); restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteManager));
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel); restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
@@ -77,7 +83,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() throws Exception public void userIsNotAbleToRetrieveFavoritesIfAuthenticationFails()
{ {
UserModel siteManager = firstSiteUsers.getOneUserWithRole(UserRole.SiteManager); UserModel siteManager = firstSiteUsers.getOneUserWithRole(UserRole.SiteManager);
siteManager.setPassword("wrongPassword"); siteManager.setPassword("wrongPassword");
@@ -88,7 +94,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() throws Exception public void adminIsAbleToRetrieveFavoritesSites()
{ {
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);
@@ -103,7 +109,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() throws Exception public void adminIsAbleToRetrieveFavoritesFolders()
{ {
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);
@@ -118,7 +124,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() throws Exception public void adminIsAbleToRetrieveFavoritesFiles()
{ {
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);
@@ -133,7 +139,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() throws Exception public void collaboratorIsAbleToRetrieveFavorites()
{ {
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator)) restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator))
.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel); .withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
@@ -148,7 +154,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() throws Exception public void contributorIsAbleToRetrieveFavorites()
{ {
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteContributor)) restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteContributor))
.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel); .withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
@@ -163,7 +169,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() throws Exception public void consumerIsAbleToRetrieveFavorites()
{ {
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer)) restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer))
.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel); .withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
@@ -178,7 +184,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() throws Exception public void userIsNotAbleToRetrieveFavoritesOfAnotherUser()
{ {
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();
@@ -189,7 +195,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() throws Exception public void userIsNotAbleToRetrieveFavoritesOfAdminUser()
{ {
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer)).withCoreAPI() restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer)).withCoreAPI()
.usingUser(adminUserModel).getFavorites(); .usingUser(adminUserModel).getFavorites();
@@ -200,7 +206,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() throws Exception public void adminIsNotAbleToRetrieveFavoritesOfAnotherUser()
{ {
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator)) restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator))
.getFavorites(); .getFavorites();
@@ -211,7 +217,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() throws Exception public void userIsAbleToRetrieveOnlyFavoritesSites()
{ {
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteManager)); restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteManager));
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel); restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
@@ -229,7 +235,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() throws Exception public void userIsAbleToRetrieveOnlyFavoritesFiles()
{ {
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator)); restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator));
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel); restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
@@ -247,7 +253,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() throws Exception public void userIsAbleToRetrieveOnlyFavoritesFolders()
{ {
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator)); restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator));
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel); restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
@@ -265,7 +271,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() throws Exception public void userIsAbleToRetrieveFavoritesFilesOrFolders()
{ {
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer)); restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer));
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel); restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
@@ -286,7 +292,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() throws Exception public void userIsAbleToRetrieveFavoritesFilesOrSites()
{ {
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteManager)); restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteManager));
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel); restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
@@ -307,7 +313,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() throws Exception public void userIsAbleToRetrieveFavoritesFoldersOrSites()
{ {
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteManager)); restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteManager));
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel); restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
@@ -328,7 +334,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() throws Exception public void userIsAbleToRetrieveAllFavorites()
{ {
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator)); restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator));
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel); restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
@@ -359,7 +365,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() throws Exception public void userHasNoFavorites()
{ {
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteContributor)); restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteContributor));
@@ -371,7 +377,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() throws Exception public void getFavoritesUsingInvalidWhereParameter()
{ {
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer)); restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer));
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel); restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
@@ -387,7 +393,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() throws Exception public void checkFavoriteFolderIsRemoved()
{ {
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteManager)); restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteManager));
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel); restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
@@ -405,7 +411,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() throws Exception public void userIsAbleToGetFavoritesWhenUsingMeAsUsername()
{ {
userFavorites = restClient.authenticateUser(userModel).withCoreAPI().usingMe().getFavorites(); userFavorites = restClient.authenticateUser(userModel).withCoreAPI().usingMe().getFavorites();
restClient.assertStatusCodeIs(HttpStatus.OK); restClient.assertStatusCodeIs(HttpStatus.OK);
@@ -415,7 +421,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() throws Exception public void userIsAbleToGetFavoritesWhenUsingEmptyWhereParameter()
{ {
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)
@@ -425,7 +431,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() throws Exception public void checkInvalidMaxItemsStatusCode()
{ {
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");
@@ -434,7 +440,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() throws Exception public void checkInvalidSkipCountStatusCode()
{ {
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");
@@ -443,7 +449,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() throws Exception public void getFavoritesWhenNetworkIdIsInvalid()
{ {
UserModel networkUserModel = dataUser.createRandomTestUser(); UserModel networkUserModel = dataUser.createRandomTestUser();
networkUserModel.setDomain("invalidNetwork"); networkUserModel.setDomain("invalidNetwork");
@@ -454,7 +460,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() throws Exception public void userIsNotAbleToGetFavoritesWhenUsingANDInWhereParameter()
{ {
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)
@@ -464,7 +470,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() throws Exception public void userIsNotAbleToGetFavoritesWhenUsingWrongWhereParameter()
{ {
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)
@@ -474,7 +480,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() throws Exception public void userIsAbleToGetFavoritesExceptTheFirstOne()
{ {
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);
@@ -487,7 +493,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() throws Exception public void userIsAbleToGetFirstTwoFavorites()
{ {
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);
@@ -503,7 +509,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() throws Exception public void userIsAbleToGetFavoritesWhenSkipCountAndMaxItemsAreEmpty()
{ {
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, " "));
@@ -515,7 +521,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() throws Exception public void userIsAbleToGetFavoritesWithHighSkipCount()
{ {
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);
@@ -526,7 +532,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() throws Exception public void userIsAbleToGetFavoritesWithPropertiesParamApplied()
{ {
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);
@@ -537,7 +543,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() throws Exception public void checkResponseSchemaForGetFavorites()
{ {
userFavorites = restClient.authenticateUser(userModel).withCoreAPI().usingAuthUser().getFavorites(); userFavorites = restClient.authenticateUser(userModel).withCoreAPI().usingAuthUser().getFavorites();
restClient.assertStatusCodeIs(HttpStatus.OK); restClient.assertStatusCodeIs(HttpStatus.OK);
@@ -553,11 +559,12 @@ public class GetFavoritesTests extends RestTest
.field("title").is(thirdSiteModel.getTitle()); .field("title").is(thirdSiteModel.getTitle());
} }
@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 if get favorites response returns allowableOperations object when requested") @TestRail(section = {TestGroup.REST_API, TestGroup.FAVORITES}, executionType = ExecutionType.REGRESSION,
public void checkResponseForGetFavoritesWithAllowableOperations() description = "Verify if get favorites response returns allowableOperations object when requested")
public void checkResponsesForGetFavoritesWithAllowableOperations()
{ {
RestPersonFavoritesModelsCollection adminFavorites = final RestPersonFavoritesModelsCollection adminFavorites =
restClient.authenticateUser(adminUserModel).withCoreAPI().usingAuthUser().include(ALLOWABLE_OPERATIONS).getFavorites(); restClient.authenticateUser(adminUserModel).withCoreAPI().usingAuthUser().include(ALLOWABLE_OPERATIONS).getFavorites();
restClient.assertStatusCodeIs(HttpStatus.OK); restClient.assertStatusCodeIs(HttpStatus.OK);
@@ -565,4 +572,22 @@ public class GetFavoritesTests extends RestTest
.map(RestPersonFavoritesModel::onModel) .map(RestPersonFavoritesModel::onModel)
.forEach(m -> m.assertThat().field(ALLOWABLE_OPERATIONS).isNotEmpty()); .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());
}
);
}
} }

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<developers> <developers>

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<properties> <properties>

View File

@@ -388,12 +388,6 @@
<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>
@@ -469,14 +463,6 @@
<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 -->

36
pom.xml
View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>Alfresco Community Repo Parent</name> <name>Alfresco Community Repo Parent</name>
@@ -63,7 +63,7 @@
<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>4.9.0</dependency.mockito-core.version> <dependency.mockito-core.version>5.4.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>
@@ -84,10 +84,8 @@
<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.20.2</dependency.camel.version> <!-- when bumping this version, please keep track/sync with included netty.io dependencies --> <dependency.camel.version>3.21.0</dependency.camel.version> <!-- when bumping this version, please keep track/sync with included netty.io dependencies -->
<dependency.netty.version>4.1.87.Final</dependency.netty.version> <!-- must be in sync with camels transitive dependencies, e.g.: netty-common --> <dependency.netty.version>4.1.95.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>
@@ -388,7 +386,11 @@
<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>
@@ -851,17 +853,6 @@
<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>
@@ -906,6 +897,15 @@
</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>

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<dependencies> <dependencies>

View File

@@ -63,6 +63,11 @@ 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;
@@ -501,40 +506,78 @@ 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)
{ {
long t1 = System.currentTimeMillis(); doWithLock(lock.writeLock(), () -> {
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
{ {
Thread.sleep(BLOCKING_FOR_MILLIS); locked = lock.tryLock(BLOCKING_FOR_MILLIS * 2, TimeUnit.MILLISECONDS);
} }
catch (InterruptedException ie) catch (InterruptedException e)
{ {
wasInterrupted = true; Thread.currentThread().interrupt();
throw new IllegalStateException("Unexpected InterruptedException while acquiring " + lock);
}
if (!locked) throw new IllegalStateException("Unexpected failure while acquiring " + lock);
try
{
return supplier.get();
} }
finally finally
{ {
timePassed = (int) (System.currentTimeMillis() - t1); lock.unlock();
} }
return null;
} }
public boolean isWasInterrupted() public boolean isWasInterrupted()
{ {
return wasInterrupted; return getWithLock(lock.readLock(), () -> wasInterrupted);
} }
public int getTimePassed() public int getTimePassed()
{ {
return timePassed; return getWithLock(lock.readLock(), () -> timePassed);
} }
public void reset() public void reset()
{ {
wasInterrupted = false; doWithLock(lock.writeLock(), () ->
timePassed = 0; {
wasInterrupted = false;
timePassed = 0;
});
} }
@Override @Override

View File

@@ -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.167-SNAPSHOT</version> <version>23.1.0.183-SNAPSHOT</version>
</parent> </parent>
<dependencies> <dependencies>
@@ -741,7 +741,6 @@
<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>

View File

@@ -655,9 +655,6 @@ public class ContentServiceImpl implements ContentService, ApplicationContextAwa
try try
{ {
directAccessUrl = store.requestContentDirectUrl(contentUrl, attachment, fileName, contentMimetype, validFor); directAccessUrl = store.requestContentDirectUrl(contentUrl, attachment, fileName, contentMimetype, validFor);
if (directAccessUrl != null) {
directAccessUrl.setFileName(fileName);
}
} }
catch (UnsupportedOperationException ex) catch (UnsupportedOperationException ex)
{ {

View File

@@ -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.
registry = LocateRegistry.getRegistry(null, this.port, socketFactory); final Registry localRegistry = LocateRegistry.getRegistry(null, this.port, socketFactory);
testRegistry(this.registry); testRegistry(localRegistry);
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;
registry = LocateRegistry.createRegistry(this.port, socketFactory, socketFactory); return LocateRegistry.createRegistry(this.port, socketFactory, socketFactory);
} }
} }
return registry;
} }
public boolean isEnabled() public boolean isEnabled()

View File

@@ -166,46 +166,34 @@ public class ContentServiceImplUnitTest
@Test @Test
public void testRequestContentDirectUrl_StoreRequestContentDirectUrlIsCalledWithFileNameOverride() public void testRequestContentDirectUrl_StoreRequestContentDirectUrlIsCalledWithFileNameOverride()
{ {
DirectAccessUrl mockDirectAccessUrl = new DirectAccessUrl();
mockDirectAccessUrl.setAttachment(true);
mockDirectAccessUrl.setContentUrl(SOME_CONTENT_URL);
final String fileNameOverride = "fileNameOverride.txt"; final String fileNameOverride = "fileNameOverride.txt";
setupSystemWideDirectAccessConfig(ENABLED); setupSystemWideDirectAccessConfig(ENABLED);
when(mockContentStore.isContentDirectUrlEnabled()).thenReturn(ENABLED); when(mockContentStore.isContentDirectUrlEnabled()).thenReturn(ENABLED);
when(mockContentStore.requestContentDirectUrl(anyString(), eq(true), eq(fileNameOverride), anyString(), anyLong())).thenReturn(mockDirectAccessUrl);
DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(NODE_REF, PROP_CONTENT_QNAME, true, 20L, fileNameOverride); DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(NODE_REF, PROP_CONTENT_QNAME, true, 20L, fileNameOverride);
assertEquals("fileName was not set properly on the DirectAccessUrl response", fileNameOverride, directAccessUrl.getFileName()); assertNull(directAccessUrl);
verify(mockContentStore, times(1)).requestContentDirectUrl(anyString(), eq(true), eq(fileNameOverride), anyString(), anyLong()); verify(mockContentStore, times(1)).requestContentDirectUrl(anyString(), eq(true), eq(fileNameOverride), anyString(), anyLong());
} }
@Test @Test
public void testRequestContentDirectUrl_StoreRequestContentDirectUrlIsCalledWithNodeNamePropertyWhenFileNameOverrideIsNull() public void testRequestContentDirectUrl_StoreRequestContentDirectUrlIsCalledWithNodeNamePropertyWhenFileNameOverrideIsNull()
{ {
DirectAccessUrl mockDirectAccessUrl = new DirectAccessUrl();
mockDirectAccessUrl.setAttachment(true);
mockDirectAccessUrl.setContentUrl(SOME_CONTENT_URL);
setupSystemWideDirectAccessConfig(ENABLED); setupSystemWideDirectAccessConfig(ENABLED);
when(mockContentStore.isContentDirectUrlEnabled()).thenReturn(ENABLED); when(mockContentStore.isContentDirectUrlEnabled()).thenReturn(ENABLED);
when(mockContentStore.requestContentDirectUrl(anyString(), eq(true), eq(SOME_FILE_NAME), anyString(), anyLong())).thenReturn(mockDirectAccessUrl);
DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(NODE_REF, PROP_CONTENT_QNAME, true, 20L, null); DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(NODE_REF, PROP_CONTENT_QNAME, true, 20L, null);
assertEquals("fileName was not set properly on the DirectAccessUrl response", SOME_FILE_NAME, directAccessUrl.getFileName()); assertNull(directAccessUrl);
verify(mockContentStore, times(1)).requestContentDirectUrl(anyString(), eq(true), eq(SOME_FILE_NAME), anyString(), anyLong()); verify(mockContentStore, times(1)).requestContentDirectUrl(anyString(), eq(true), eq(SOME_FILE_NAME), anyString(), anyLong());
} }
@Test @Test
public void testRequestContentDirectUrl_StoreRequestContentDirectUrlIsCalledWithNodeNamePropertyWhenFileNameOverrideIsEmpty() public void testRequestContentDirectUrl_StoreRequestContentDirectUrlIsCalledWithNodeNamePropertyWhenFileNameOverrideIsEmpty()
{ {
DirectAccessUrl mockDirectAccessUrl = new DirectAccessUrl();
mockDirectAccessUrl.setAttachment(true);
mockDirectAccessUrl.setContentUrl(SOME_CONTENT_URL);
setupSystemWideDirectAccessConfig(ENABLED); setupSystemWideDirectAccessConfig(ENABLED);
when(mockContentStore.isContentDirectUrlEnabled()).thenReturn(ENABLED); when(mockContentStore.isContentDirectUrlEnabled()).thenReturn(ENABLED);
when(mockContentStore.requestContentDirectUrl(anyString(), eq(true), eq(SOME_FILE_NAME), anyString(), anyLong())).thenReturn(mockDirectAccessUrl);
DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(NODE_REF, PROP_CONTENT_QNAME, true, 20L, ""); DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(NODE_REF, PROP_CONTENT_QNAME, true, 20L, "");
assertEquals("fileName was not set properly on the DirectAccessUrl response", SOME_FILE_NAME, directAccessUrl.getFileName()); assertNull(directAccessUrl);
verify(mockContentStore, times(1)).requestContentDirectUrl(anyString(), eq(true), eq(SOME_FILE_NAME), anyString(), anyLong()); verify(mockContentStore, times(1)).requestContentDirectUrl(anyString(), eq(true), eq(SOME_FILE_NAME), anyString(), anyLong());
} }

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Repository * Alfresco Repository
* %% * %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited * Copyright (C) 2005 - 2023 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,6 +34,7 @@ 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;
@@ -48,11 +49,7 @@ 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.atLeastOnce; import static org.mockito.Mockito.*;
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;
@@ -97,7 +94,7 @@ public class RuleServiceImplUnitTest
@Mock @Mock
private PermissionService permissionService; private PermissionService permissionService;
@Mock @Mock
private SimpleCache nodeRulesCache; private SimpleCache<NodeRef, List<Rule>> nodeRulesCache;
@Mock @Mock
private NodeService runtimeNodeService; private NodeService runtimeNodeService;
@Mock @Mock
@@ -138,12 +135,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, RuleModel.ASPECT_RULES); then(nodeService).should(times(2)).hasAspect(FOLDER_NODE, ASPECT_RULES);
then(nodeService).should().exists(FOLDER_NODE); then(nodeService).should().exists(FOLDER_NODE);
then(nodeService).should().addAspect(FOLDER_NODE, RuleModel.ASPECT_RULES, null); then(nodeService).should().addAspect(FOLDER_NODE, 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, RuleModel.ASSOC_ACTION, RuleModel.ASSOC_ACTION); then(nodeService).should().getChildAssocs(RULE_NODE, ASSOC_ACTION, ASSOC_ACTION);
verifyNoMoreInteractions(nodeService); verifyNoMoreInteractions(nodeService);
} }
@@ -429,7 +426,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("A,B,C,D,E", nodeNames); assertEquals("Node names should match expected string", "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. */
@@ -443,7 +440,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("A,B,C,D,E", nodeNames); assertEquals("Node names should match expected string", "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. */
@@ -458,7 +455,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("C,D,E", nodeNames); assertEquals("Node names should match expected string", "C,D,E", nodeNames);
} }
/** Check that the user group hierarchy is not traversed. */ /** Check that the user group hierarchy is not traversed. */
@@ -475,7 +472,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("C,D,E", nodeNames); assertEquals("Node names should match expected string", "C,D,E", nodeNames);
} }
/** Check that a cycle doesn't cause a problem. */ /** Check that a cycle doesn't cause a problem. */
@@ -489,7 +486,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("A,B,C", nodeNames); assertEquals("Node names should match expected string", "A,B,C", nodeNames);
} }
/** Check that a diamond of nodes is traversed correctly. */ /** Check that a diamond of nodes is traversed correctly. */
@@ -503,7 +500,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("A,B,C,D", nodeNames); assertEquals("Node names should match expected string", "A,B,C,D", nodeNames);
} }
/** /**
@@ -528,7 +525,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("A,C,B,E,D,F,G", nodeNames); assertEquals("Node names should match expected string", "A,C,B,E,D,F,G", nodeNames);
} }
/** /**
@@ -553,7 +550,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("A,D,C,F,B,E,G", nodeNames); assertEquals("Node names should match expected string", "A,D,C,F,B,E,G", nodeNames);
} }
/** /**

View File

@@ -8,36 +8,37 @@
<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="transactionAwareEventProducer" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="org.alfresco.repo.rawevents.TransactionAwareEventProducer" />
</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"> <bean id="renditionEventProcessor" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="org.alfresco.repo.rendition2.RenditionEventProcessor"/> <constructor-arg type="java.lang.Class" value="org.alfresco.repo.rendition2.RenditionEventProcessor"/>
</bean> </bean>
<bean id="transformRequestProcessor" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="org.alfresco.repo.rendition2.TransformRequestProcessor" />
</bean>
</beans> </beans>

View File

@@ -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 value="org.alfresco.repo.model.Repository" /> <constructor-arg type="java.lang.Class" 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 value="org.alfresco.repo.site.SiteServiceInternal" /> <constructor-arg type="java.lang.Class" 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 value="org.alfresco.service.cmr.repository.NodeService" /> <constructor-arg type="java.lang.Class" 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 value="org.alfresco.service.namespace.NamespaceService" /> <constructor-arg type="java.lang.Class" 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 value="org.alfresco.service.cmr.search.SearchService" /> <constructor-arg type="java.lang.Class" value="org.alfresco.service.cmr.search.SearchService" />
</bean> </bean>
</beans> </beans>