mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-29 15:21:53 +00:00
Compare commits
4 Commits
23.1.0.183
...
feature/20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a8052d0ab | ||
|
|
a996fe2d2f | ||
|
|
e0db9362a4 | ||
|
|
63d853750e |
34
.github/workflows/ci.yml
vendored
34
.github/workflows/ci.yml
vendored
@@ -33,7 +33,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: >
|
if: >
|
||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
||||||
@@ -52,7 +52,7 @@ jobs:
|
|||||||
if: >
|
if: >
|
||||||
((github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) && github.event_name != 'pull_request') &&
|
((github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) && github.event_name != 'pull_request') &&
|
||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
||||||
@@ -76,7 +76,7 @@ jobs:
|
|||||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||||
!contains(github.event.head_commit.message, '[force]')
|
!contains(github.event.head_commit.message, '[force]')
|
||||||
steps:
|
steps:
|
||||||
- uses: Alfresco/ya-pmd-scan@v2.0.0
|
- uses: Alfresco/ya-pmd-scan@v1.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:
|
||||||
|
|||||||
@@ -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.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||||
<version>23.1.0.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
|
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
|
||||||
<version>23.1.0.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ import org.apache.http.HttpResponse;
|
|||||||
import org.apache.http.HttpStatus;
|
import org.apache.http.HttpStatus;
|
||||||
import org.apache.http.util.EntityUtils;
|
import org.apache.http.util.EntityUtils;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.testng.AssertJUnit;
|
import org.testng.AssertJUnit;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
@@ -64,9 +65,7 @@ import java.util.List;
|
|||||||
import static org.alfresco.rest.core.v0.BaseAPI.NODE_REF_WORKSPACE_SPACES_STORE;
|
import static org.alfresco.rest.core.v0.BaseAPI.NODE_REF_WORKSPACE_SPACES_STORE;
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS;
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS;
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAspects.CUT_OFF_ASPECT;
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAspects.CUT_OFF_ASPECT;
|
||||||
import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPeriodProperty.CREATED_DATE;
|
import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPeriodProperty.*;
|
||||||
import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPeriodProperty.DATE_FILED;
|
|
||||||
import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPeriodProperty.CUT_OFF_DATE;
|
|
||||||
import static org.alfresco.rest.rm.community.util.CommonTestUtils.generateTestPrefix;
|
import static org.alfresco.rest.rm.community.util.CommonTestUtils.generateTestPrefix;
|
||||||
import static org.alfresco.utility.report.log.Step.STEP;
|
import static org.alfresco.utility.report.log.Step.STEP;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
@@ -85,25 +84,28 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RecordFoldersAPI recordFoldersAPI;
|
private RecordFoldersAPI recordFoldersAPI;
|
||||||
private final static String TEST_PREFIX = generateTestPrefix(DispositionScheduleLinkedRecordsTest.class);
|
private final static String TEST_PREFIX = generateTestPrefix(DispositionScheduleLinkedRecordsTest.class);
|
||||||
private static final String CATEGORY_RM_3077 = TEST_PREFIX + "RM-3077_manager_sees_me";
|
private RecordCategory Category1;
|
||||||
private static final String COPY_CATEGORY_RM_3077 = "Copy_of_" + CATEGORY_RM_3077;
|
private RecordCategoryChild CopyCatFolder,folder1,CatFolder,folder2;
|
||||||
private static final String FOLDER_RM_3077 = "RM-3077_folder_"+ CATEGORY_RM_3077;
|
private static final String categoryRM3077 = TEST_PREFIX + "RM-3077_manager_sees_me";
|
||||||
private static final String COPY_FOLDER_RM_3077 = "Copy_of_" + FOLDER_RM_3077;
|
private static final String copyCategoryRM3077 = "Copy_of_" + categoryRM3077;
|
||||||
private static final String FIRST_CATEGORY_RM_3060 = TEST_PREFIX + "RM-3060_category_record";
|
private static final String folderRM3077 = "RM-3077_folder_"+ categoryRM3077;
|
||||||
private static final String SECOND_CATEGORY_RM_3060 = "Copy_of_" + FIRST_CATEGORY_RM_3060;
|
private static final String copyFolderRM3077 = "Copy_of_" + folderRM3077;
|
||||||
private static final String FIRST_FOLDER_RM_3060 = TEST_PREFIX + "RM-3060_folder";
|
private final String folder = TEST_PREFIX + "RM-2937 folder ghosting";
|
||||||
private static final String SECOND_FOLDER_RM_3060 = TEST_PREFIX + "RM-3060_disposition_on_Record_Level";
|
private static final String firstCategoryRM3060 = TEST_PREFIX + "RM-3060_category_record";
|
||||||
private static final String ELECTRONIC_RECORD_RM_3060 = TEST_PREFIX + "RM-3060_electronic_1_record";
|
private static final String secondCategoryRM3060 = "Copy_of_" + firstCategoryRM3060;
|
||||||
private static final String NON_ELECTRONIC_RECORD_RM_3060 = TEST_PREFIX + "RM-3060_non-electronic_record";
|
private static final String firstFolderRM3060 = TEST_PREFIX + "RM-3060_folder";
|
||||||
private static final String FIRST_CATEGORY_RM_1622 = TEST_PREFIX + "RM-1622_category_record";
|
private static final String secondFolderRM3060 = TEST_PREFIX + "RM-3060_disposition_on_Record_Level";
|
||||||
private static final String SECOND_CATEGORY_RM_1622 = "Copy_of_" + FIRST_CATEGORY_RM_1622;
|
private static final String electronicRecordRM3060 = TEST_PREFIX + "RM-3060_electronic_1_record";
|
||||||
private static final String FIRST_FOLDER_RM_1622 = TEST_PREFIX + "RM-1622_folder";
|
private static final String nonElectronicRecordRM3060 = TEST_PREFIX + "RM-3060_non-electronic_record";
|
||||||
private static final String ELECTRONIC_RECORD_RM_1622 = TEST_PREFIX + "RM-1622_electronic_1_record";
|
private static final String firstCategoryRM1622 = TEST_PREFIX + "RM-1622_category_record";
|
||||||
private static final String SECOND_FOLDER_RM_1622 = TEST_PREFIX + "RM-1622_disposition_on_Record_Level";
|
private static final String secondCategoryRM1622 = "Copy_of_" + firstCategoryRM1622;;
|
||||||
|
private static final String firstFolderRM1622 = TEST_PREFIX + "RM-1622_folder";
|
||||||
|
private static final String electronicRecordRM1622 = TEST_PREFIX + "RM-1622_electronic_1_record";
|
||||||
|
private static final String secondFolderRM1622 = TEST_PREFIX + "RM-1622_disposition_on_Record_Level";
|
||||||
private static final String TRANSFER_LOCATION = TEST_PREFIX + "RM-3060_transferred_records";
|
private static final String TRANSFER_LOCATION = TEST_PREFIX + "RM-3060_transferred_records";
|
||||||
public static final String TRANSFER_TYPE = "rma:transferred";
|
public static final String TRANSFER_TYPE = "rma:transferred";
|
||||||
private FilePlan filePlanModel;
|
private FilePlan filePlanModel;
|
||||||
private UserModel rmAdmin;
|
private UserModel rmAdmin, rmManager;
|
||||||
|
|
||||||
@BeforeClass(alwaysRun = true)
|
@BeforeClass(alwaysRun = true)
|
||||||
public void setupDispositionScheduleLinkedRecordsTest() {
|
public void setupDispositionScheduleLinkedRecordsTest() {
|
||||||
@@ -118,12 +120,11 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
|
|||||||
UserRoles.ROLE_RM_ADMIN.roleId);
|
UserRoles.ROLE_RM_ADMIN.roleId);
|
||||||
|
|
||||||
// create "rm Manager" user if it does not exist and assign it to RM Administrator role
|
// create "rm Manager" user if it does not exist and assign it to RM Administrator role
|
||||||
UserModel rmManager = getDataUser().createRandomTestUser();
|
rmManager = getDataUser().createRandomTestUser();
|
||||||
rmRolesAndActionsAPI.assignRoleToUser(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
rmRolesAndActionsAPI.assignRoleToUser(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(), rmManager.getUsername(),
|
getDataUser().usingAdmin().getAdminUser().getPassword(),rmManager.getUsername(),
|
||||||
UserRoles.ROLE_RM_MANAGER.roleId);
|
UserRoles.ROLE_RM_MANAGER.roleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disposition Schedule on Record Folder with linked records test
|
* Disposition Schedule on Record Folder with linked records test
|
||||||
* <p>
|
* <p>
|
||||||
@@ -135,202 +136,194 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
|
|||||||
* <p>
|
* <p>
|
||||||
* <p/> TestRail Test C775<p/>
|
* <p/> TestRail Test C775<p/>
|
||||||
**/
|
**/
|
||||||
@Test
|
// @Ignore("ACS-5020")
|
||||||
@AlfrescoTest(jira = "RM-1622")
|
// @Test
|
||||||
public void dispositionScheduleLinkedRecords() throws UnsupportedEncodingException {
|
// @AlfrescoTest(jira = "RM-1622")
|
||||||
STEP("Create record category");
|
// public void dispositionScheduleLinkedRecords() throws UnsupportedEncodingException {
|
||||||
RecordCategory category1 = createRootCategory(CATEGORY_RM_3077);
|
// STEP("Create record category");
|
||||||
|
// Category1 = createRootCategory(categoryRM3077);
|
||||||
//create retention schedule
|
//
|
||||||
dispositionScheduleService.createCategoryRetentionSchedule(category1.getName(), false);
|
// //create retention schedule
|
||||||
|
// dispositionScheduleService.createCategoryRetentionSchedule(Category1.getName(), false);
|
||||||
// add cut off step
|
//
|
||||||
dispositionScheduleService.addCutOffAfterPeriodStep(category1.getName(), "day|2", CREATED_DATE);
|
// // add cut off step
|
||||||
|
// dispositionScheduleService.addCutOffAfterPeriodStep(Category1.getName(), "day|2", CREATED_DATE);
|
||||||
//create a copy of the category recordsCategory
|
//
|
||||||
String copyCategoryId = copyCategory(getAdminUser(), category1.getId(), COPY_CATEGORY_RM_3077);
|
// //create a copy of the category recordsCategory
|
||||||
|
// String CopyCategoryId = copyCategory(getAdminUser(),Category1.getId(), copyCategoryRM3077);
|
||||||
// create folders in both categories
|
//
|
||||||
RecordCategoryChild catFolder = createRecordFolder(category1.getId(), FOLDER_RM_3077);
|
// // create folders in both categories
|
||||||
createRecordFolder(copyCategoryId, COPY_FOLDER_RM_3077);
|
// CatFolder = createRecordFolder(Category1.getId(), folderRM3077);
|
||||||
|
// CopyCatFolder = createRecordFolder(CopyCategoryId, copyFolderRM3077);
|
||||||
// create record files
|
//
|
||||||
String electronicRecord = "RM-2801 electronic record";
|
// // create record files
|
||||||
Record elRecord = createElectronicRecord(catFolder.getId(), electronicRecord);
|
// String electronicRecord = "RM-2801 electronic record";
|
||||||
String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
// Record elRecord = createElectronicRecord(CatFolder.getId(), electronicRecord);
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(), catFolder.getName(), electronicRecord);
|
// String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
|
// getDataUser().usingAdmin().getAdminUser().getPassword(), CatFolder.getName(), electronicRecord);
|
||||||
String nonElectronicRecord = "RM-2801 non-electronic record";
|
//
|
||||||
Record nonElRecord = createNonElectronicRecord(catFolder.getId(), nonElectronicRecord);
|
// String nonElectronicRecord = "RM-2801 non-electronic record";
|
||||||
String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
// Record nonElRecord = createNonElectronicRecord(CatFolder.getId(), nonElectronicRecord);
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(), catFolder.getName(), nonElectronicRecord);
|
// String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
|
// getDataUser().usingAdmin().getAdminUser().getPassword(), CatFolder.getName(), nonElectronicRecord);
|
||||||
// link the records to copy folder, then complete them
|
//
|
||||||
List<String> recordLists = new ArrayList<>();
|
// // link the records to copy folder, then complete them
|
||||||
recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + elRecord.getId());
|
// List<String> recordLists = new ArrayList<>();
|
||||||
recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + nonElRecord.getId());
|
// recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + elRecord.getId());
|
||||||
|
// recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + nonElRecord.getId());
|
||||||
linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
//
|
||||||
getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK, COPY_CATEGORY_RM_3077 + "/" +
|
// linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
||||||
COPY_FOLDER_RM_3077, recordLists);
|
// getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,copyCategoryRM3077 + "/" +
|
||||||
recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), elRecordFullName);
|
// copyFolderRM3077, recordLists);
|
||||||
recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), nonElRecordFullName);
|
// recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), elRecordFullName);
|
||||||
|
// recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), nonElRecordFullName);
|
||||||
// edit disposition date
|
//
|
||||||
recordFoldersAPI.postFolderAction(getAdminUser().getUsername(),
|
// // edit disposition date
|
||||||
getAdminUser().getPassword(),editDispositionDateJson(), catFolder.getName());
|
// recordFoldersAPI.postFolderAction(getAdminUser().getUsername(),
|
||||||
|
// getAdminUser().getPassword(),editDispositionDateJson(),CatFolder.getName());
|
||||||
// cut off the Folder
|
//
|
||||||
recordFoldersAPI.postFolderAction(getAdminUser().getUsername(),
|
// // cut off the Folder
|
||||||
getAdminUser().getPassword(),new JSONObject().put("name","cutoff"), catFolder.getName());
|
// recordFoldersAPI.postFolderAction(getAdminUser().getUsername(),
|
||||||
|
// getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),CatFolder.getName());
|
||||||
// Verify the Content
|
//
|
||||||
Node electronicNode = getNode(elRecord.getId());
|
// // Verify the Content
|
||||||
assertTrue("The content of " + electronicRecord + " is available",
|
// Node electronicNode = getNode(elRecord.getId());
|
||||||
StringUtils.isEmpty(electronicNode.getNodeContent().getResponse().getBody().asString()));
|
// assertTrue("The content of " + electronicRecord + " is available",
|
||||||
|
// StringUtils.isEmpty(electronicNode.getNodeContent().getResponse().getBody().asString()));
|
||||||
// verify the Properties
|
//
|
||||||
AssertJUnit.assertNull("The properties are present even after cutting off the record.", elRecord.getProperties().getTitle());
|
// // verify the Properties
|
||||||
|
// AssertJUnit.assertNull("The properties are present even after cutting off the record.", elRecord.getProperties().getTitle());
|
||||||
// delete precondition
|
//
|
||||||
deleteRecordCategory(category1.getId());
|
// // delete precondition
|
||||||
deleteRecordCategory(copyCategoryId);
|
// deleteRecordCategory(Category1.getId());
|
||||||
}
|
// deleteRecordCategory(CopyCategoryId);
|
||||||
|
// }
|
||||||
/**
|
// /**
|
||||||
* Test covering RM-3060
|
// * Test covering RM-3060
|
||||||
* Check the disposition steps for a record can be executed
|
// * Check the disposition steps for a record can be executed
|
||||||
* When the record is linked to a folder with the same disposition schedule
|
// * When the record is linked to a folder with the same disposition schedule
|
||||||
* */
|
// * */
|
||||||
@Test
|
// @Ignore("ACS-5020")
|
||||||
@AlfrescoTest (jira = "RM-3060")
|
//// @Test
|
||||||
public void sameDispositionScheduleLinkedRecords() throws UnsupportedEncodingException {
|
// @AlfrescoTest (jira = "RM-3060")
|
||||||
|
// public void sameDispositionScheduleLinkedRecords() throws UnsupportedEncodingException {
|
||||||
// create a category with retention applied on records level
|
//
|
||||||
RecordCategory recordCategory = getRestAPIFactory().getFilePlansAPI(rmAdmin)
|
// // create a category with retention applied on records level
|
||||||
.createRootRecordCategory(RecordCategory.builder().name(FIRST_CATEGORY_RM_3060).build(),
|
// RecordCategory recordCategory = getRestAPIFactory().getFilePlansAPI(rmAdmin)
|
||||||
RecordCategory.DEFAULT_FILE_PLAN_ALIAS);
|
// .createRootRecordCategory(RecordCategory.builder().name(firstCategoryRM3060).build(),
|
||||||
dispositionScheduleService.createCategoryRetentionSchedule(FIRST_CATEGORY_RM_3060, true);
|
// RecordCategory.DEFAULT_FILE_PLAN_ALIAS);
|
||||||
dispositionScheduleService.addCutOffAfterPeriodStep(FIRST_CATEGORY_RM_3060, "week|1", DATE_FILED);
|
// dispositionScheduleService.createCategoryRetentionSchedule(firstCategoryRM3060, true);
|
||||||
dispositionScheduleService.addTransferAfterEventStep(
|
// dispositionScheduleService.addCutOffAfterPeriodStep(firstCategoryRM3060, "week|1", DATE_FILED);
|
||||||
FIRST_CATEGORY_RM_3060, TRANSFER_LOCATION, RMEvents.CASE_CLOSED.getEventName());
|
// dispositionScheduleService.addTransferAfterEventStep(firstCategoryRM3060, TRANSFER_LOCATION, RMEvents.CASE_CLOSED.getEventName());
|
||||||
dispositionScheduleService.addDestroyWithoutGhostingAfterPeriodStep(FIRST_CATEGORY_RM_3060, "week|1", CUT_OFF_DATE);
|
// dispositionScheduleService.addDestroyWithoutGhostingAfterPeriodStep(firstCategoryRM3060, "week|1", CUT_OFF_DATE);
|
||||||
|
//
|
||||||
// make a copy of the category created
|
// // make a copy of the category created
|
||||||
String categorySecondId = copyCategory(getAdminUser(), recordCategory.getId(), SECOND_CATEGORY_RM_3060);
|
// String categorySecondId = copyCategory(getAdminUser(), recordCategory.getId(), secondCategoryRM3060);
|
||||||
|
//
|
||||||
// create a folder on the category firstCategoryRM3060 with a complete electronic record
|
// // create a folder on the category firstCategoryRM3060 with a complete electronic record
|
||||||
RecordCategoryChild firstFolderRecordCategoryChild = createRecordFolder(recordCategory.getId(),
|
// RecordCategoryChild firstFolderRecordCategoryChild = createRecordFolder(recordCategory.getId(),firstFolderRM3060);
|
||||||
FIRST_FOLDER_RM_3060);
|
// Record firstElectronicRecord = createElectronicRecord(firstFolderRecordCategoryChild.getId(),electronicRecordRM3060);
|
||||||
Record firstElectronicRecord = createElectronicRecord(firstFolderRecordCategoryChild.getId(),
|
//
|
||||||
ELECTRONIC_RECORD_RM_3060);
|
// String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().getAdminUser().getUsername(),
|
||||||
|
// getDataUser().getAdminUser().getPassword(),firstFolderRM3060, electronicRecordRM3060);
|
||||||
String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().getAdminUser().getUsername(),
|
// String elRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
getDataUser().getAdminUser().getPassword(), FIRST_FOLDER_RM_3060, ELECTRONIC_RECORD_RM_3060);
|
// getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM3060 + "/" + firstFolderRM3060);
|
||||||
String elRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
//
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + FIRST_CATEGORY_RM_3060 + "/" + FIRST_FOLDER_RM_3060);
|
// recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(),
|
||||||
|
// getDataUser().getAdminUser().getPassword(), elRecordFullName);
|
||||||
recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(),
|
//
|
||||||
getDataUser().getAdminUser().getPassword(), elRecordFullName);
|
// // create a folder on the category secondCategoryRM3060 with a non electronic record
|
||||||
|
// RecordCategoryChild secondFolderRecordCategoryChild = createRecordFolder(categorySecondId,secondFolderRM3060);
|
||||||
// create a folder on the category secondCategoryRM3060 with a non electronic record
|
// Record secondNonElectronicRecord = createNonElectronicRecord(secondFolderRecordCategoryChild.getId(),nonElectronicRecordRM3060);
|
||||||
RecordCategoryChild secondFolderRecordCategoryChild = createRecordFolder(categorySecondId,
|
//
|
||||||
SECOND_FOLDER_RM_3060);
|
// // link the nonElectronicRecordRM3060 to firstFolderRM3060
|
||||||
Record secondNonElectronicRecord = createNonElectronicRecord(secondFolderRecordCategoryChild.getId(),
|
// List<String> recordLists = new ArrayList<>();
|
||||||
NON_ELECTRONIC_RECORD_RM_3060);
|
// recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId());
|
||||||
|
//
|
||||||
// link the nonElectronicRecordRM3060 to firstFolderRM3060
|
// linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
||||||
List<String> recordLists = new ArrayList<>();
|
// getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,secondCategoryRM3060 + "/" +
|
||||||
recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId());
|
// secondFolderRM3060, recordLists);
|
||||||
|
// String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
// getDataUser().usingAdmin().getAdminUser().getPassword(), secondFolderRM3060, secondNonElectronicRecord.getName());
|
||||||
getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK, SECOND_CATEGORY_RM_3060 + "/" +
|
// String nonElRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
SECOND_FOLDER_RM_3060, recordLists);
|
// getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + secondCategoryRM3060 + "/" + secondFolderRM3060);
|
||||||
String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
//
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(),
|
// // complete records and cut them off
|
||||||
SECOND_FOLDER_RM_3060, secondNonElectronicRecord.getName());
|
// recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(),
|
||||||
String nonElRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
// getDataUser().getAdminUser().getPassword(), nonElRecordFullName);
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + SECOND_CATEGORY_RM_3060
|
//
|
||||||
+ "/" + SECOND_FOLDER_RM_3060);
|
// // edit the disposition date
|
||||||
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
// complete records and cut them off
|
// getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef);
|
||||||
recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(),
|
//
|
||||||
getDataUser().getAdminUser().getPassword(), nonElRecordFullName);
|
// // cut off the record
|
||||||
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
// edit the disposition date
|
// getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),nonElRecordNameNodeRef);
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
//
|
||||||
getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef);
|
// //check the record is cut off
|
||||||
|
// AssertJUnit.assertTrue("The file " + nonElectronicRecordRM3060 + " has not been successfully cut off.", getRestAPIFactory().getRecordsAPI().getRecord(secondNonElectronicRecord.getId()).getAspectNames().contains(CUT_OFF_ASPECT));
|
||||||
// cut off the record
|
//
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
// // link the electronic record to secondFolderRM3060
|
||||||
getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),nonElRecordNameNodeRef);
|
// recordLists.clear();
|
||||||
|
// recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId());
|
||||||
//check the record is cut off
|
// linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
||||||
AssertJUnit.assertTrue("The file " + NON_ELECTRONIC_RECORD_RM_3060 + " has not been successfully cut off.", getRestAPIFactory().getRecordsAPI().getRecord(secondNonElectronicRecord.getId()).getAspectNames().contains(CUT_OFF_ASPECT));
|
// getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,secondCategoryRM3060 + "/" +
|
||||||
|
// secondFolderRM3060, recordLists);
|
||||||
// link the electronic record to secondFolderRM3060
|
//
|
||||||
recordLists.clear();
|
// // edit the disposition date and cut off the record
|
||||||
recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId());
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
// getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef);
|
||||||
getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK, SECOND_CATEGORY_RM_3060 + "/" +
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
SECOND_FOLDER_RM_3060, recordLists);
|
// getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),elRecordNameNodeRef);
|
||||||
|
//
|
||||||
// edit the disposition date and cut off the record
|
// AssertJUnit.assertTrue("The file " + electronicRecordRM3060 + " has not been successfully cut off.", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(CUT_OFF_ASPECT));
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
//
|
||||||
getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef);
|
// // open the record and complete the disposition schedule event
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
// rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(),
|
||||||
getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),elRecordNameNodeRef);
|
// getAdminUser().getPassword(), elRecordFullName, RMEvents.CASE_CLOSED, Instant.now());
|
||||||
|
// rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(),
|
||||||
AssertJUnit.assertTrue("The file " + ELECTRONIC_RECORD_RM_3060 + " has not been successfully cut off.", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(CUT_OFF_ASPECT));
|
// getAdminUser().getPassword(), nonElRecordFullName, RMEvents.CASE_CLOSED, Instant.now());
|
||||||
|
//
|
||||||
// open the record and complete the disposition schedule event
|
// // transfer the files & complete transfers
|
||||||
rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(),
|
// HttpResponse nonElRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
getAdminUser().getPassword(), elRecordFullName, RMEvents.CASE_CLOSED, Instant.now());
|
// getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(),
|
// getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + secondCategoryRM3060 + "/" + secondFolderRM3060));
|
||||||
getAdminUser().getPassword(), nonElRecordFullName, RMEvents.CASE_CLOSED, Instant.now());
|
//
|
||||||
|
// String nonElRecordNameTransferId = getTransferId(nonElRecordNameHttpResponse,nonElRecordNameNodeRef);
|
||||||
// transfer the files & complete transfers
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
HttpResponse nonElRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
// getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),nonElRecordNameTransferId);
|
||||||
getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
//
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + SECOND_CATEGORY_RM_3060
|
// HttpResponse elRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
+ "/" + SECOND_FOLDER_RM_3060));
|
// getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
|
// getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM3060 + "/" + firstFolderRM3060));
|
||||||
String nonElRecordNameTransferId = getTransferId(nonElRecordNameHttpResponse,nonElRecordNameNodeRef);
|
//
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
// String elRecordNameTransferId = getTransferId(elRecordNameHttpResponse,elRecordNameNodeRef);
|
||||||
getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),nonElRecordNameTransferId);
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
|
// getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),elRecordNameTransferId);
|
||||||
HttpResponse elRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
//
|
||||||
getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
// AssertJUnit.assertTrue("The file " + electronicRecordRM3060 + " has not been successfully transferred", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE));
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + FIRST_CATEGORY_RM_3060
|
// AssertJUnit.assertTrue("The file " + nonElectronicRecordRM3060 + " has not been successfully transferred.", getRestAPIFactory().getRecordsAPI().getRecord(secondNonElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE));
|
||||||
+ "/" + FIRST_FOLDER_RM_3060));
|
//
|
||||||
|
// // edit the disposition date for nonElectronicRecordRM3060 & electronicRecordRM3060
|
||||||
String elRecordNameTransferId = getTransferId(elRecordNameHttpResponse,elRecordNameNodeRef);
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
// getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef);
|
||||||
getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),elRecordNameTransferId);
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
|
// getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef);
|
||||||
AssertJUnit.assertTrue("The file " + ELECTRONIC_RECORD_RM_3060 + " has not been successfully transferred", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE));
|
//
|
||||||
AssertJUnit.assertTrue("The file " + NON_ELECTRONIC_RECORD_RM_3060 + " has not been successfully transferred.", getRestAPIFactory().getRecordsAPI().getRecord(secondNonElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE));
|
// // destroy nonElectronicRecordRM3060 & electronicRecordRM3060 records
|
||||||
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
// edit the disposition date for nonElectronicRecordRM3060 & electronicRecordRM3060
|
// getAdminUser().getPassword(),new JSONObject().put("name","destroy"),nonElRecordNameNodeRef);
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef);
|
// getAdminUser().getPassword(),new JSONObject().put("name","destroy"),elRecordNameNodeRef);
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
//
|
||||||
getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef);
|
// // check the file is not displayed
|
||||||
|
// assertNull("The file " + nonElectronicRecordRM3060 + " has not been successfully destroyed.", secondNonElectronicRecord.getContent());
|
||||||
// destroy nonElectronicRecordRM3060 & electronicRecordRM3060 records
|
// assertNull("The file " + electronicRecordRM3060 + " has not been successfully destroyed.", firstElectronicRecord.getContent());
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
//
|
||||||
getAdminUser().getPassword(),new JSONObject().put("name","destroy"),nonElRecordNameNodeRef);
|
// // delete precondition
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
// deleteRecordCategory(recordCategory.getId());
|
||||||
getAdminUser().getPassword(),new JSONObject().put("name","destroy"),elRecordNameNodeRef);
|
// deleteRecordCategory(categorySecondId);
|
||||||
|
// }
|
||||||
// check the file is not displayed
|
|
||||||
assertNull("The file " + NON_ELECTRONIC_RECORD_RM_3060 + " has not been successfully destroyed.", secondNonElectronicRecord.getContent());
|
|
||||||
assertNull("The file " + ELECTRONIC_RECORD_RM_3060 + " has not been successfully destroyed.", firstElectronicRecord.getContent());
|
|
||||||
|
|
||||||
// delete precondition
|
|
||||||
deleteRecordCategory(recordCategory.getId());
|
|
||||||
deleteRecordCategory(categorySecondId);
|
|
||||||
}
|
|
||||||
|
|
||||||
private String copyCategory(UserModel user, String categoryId, String copyName) {
|
private String copyCategory(UserModel user, String categoryId, String copyName) {
|
||||||
RepoTestModel repoTestModel = new RepoTestModel() {};
|
RepoTestModel repoTestModel = new RepoTestModel() {};
|
||||||
@@ -361,7 +354,7 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
|
|||||||
|
|
||||||
private String getTransferId(HttpResponse httpResponse,String nodeRef) {
|
private String getTransferId(HttpResponse httpResponse,String nodeRef) {
|
||||||
HttpEntity entity = httpResponse.getEntity();
|
HttpEntity entity = httpResponse.getEntity();
|
||||||
String responseString;
|
String responseString = null;
|
||||||
try {
|
try {
|
||||||
responseString = EntityUtils.toString(entity, "UTF-8");
|
responseString = EntityUtils.toString(entity, "UTF-8");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -372,6 +365,7 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
|
|||||||
.getJSONObject("results")
|
.getJSONObject("results")
|
||||||
.get(nodeRef)
|
.get(nodeRef)
|
||||||
.toString();
|
.toString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -380,39 +374,35 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
|
|||||||
|
|
||||||
// create a category with retention applied on records level
|
// create a category with retention applied on records level
|
||||||
RecordCategory catsameLevel1 = getRestAPIFactory().getFilePlansAPI(rmAdmin)
|
RecordCategory catsameLevel1 = getRestAPIFactory().getFilePlansAPI(rmAdmin)
|
||||||
.createRootRecordCategory(RecordCategory.builder().name(
|
.createRootRecordCategory(RecordCategory.builder().name(firstCategoryRM1622).build(),
|
||||||
FIRST_CATEGORY_RM_1622).build(),
|
|
||||||
RecordCategory.DEFAULT_FILE_PLAN_ALIAS);
|
RecordCategory.DEFAULT_FILE_PLAN_ALIAS);
|
||||||
RecordCategory catsameLevel2 = getRestAPIFactory().getFilePlansAPI(rmAdmin)
|
RecordCategory catsameLevel2 = getRestAPIFactory().getFilePlansAPI(rmAdmin)
|
||||||
.createRootRecordCategory(RecordCategory.builder().name(
|
.createRootRecordCategory(RecordCategory.builder().name(secondCategoryRM1622).build(),
|
||||||
SECOND_CATEGORY_RM_1622).build(),
|
|
||||||
RecordCategory.DEFAULT_FILE_PLAN_ALIAS);
|
RecordCategory.DEFAULT_FILE_PLAN_ALIAS);
|
||||||
|
|
||||||
// create retention schedule applied on records for category 1
|
// create retention schedule applied on records for category 1
|
||||||
dispositionScheduleService.createCategoryRetentionSchedule(FIRST_CATEGORY_RM_1622, true);
|
dispositionScheduleService.createCategoryRetentionSchedule(firstCategoryRM1622, true);
|
||||||
|
|
||||||
// with retain immediately after record creation date and cut 1 day after record creation date
|
// with retain immediately after record creation date and cut 1 day after record creation date
|
||||||
dispositionScheduleService.addCutOffAfterPeriodStep(FIRST_CATEGORY_RM_1622, "day|1", DATE_FILED);
|
dispositionScheduleService.addCutOffAfterPeriodStep(firstCategoryRM1622, "day|1", DATE_FILED);
|
||||||
|
|
||||||
|
|
||||||
// create a folder on the category firstCategoryRM1622 with a complete electronic record
|
// create a folder on the category firstCategoryRM1622 with a complete electronic record
|
||||||
RecordCategoryChild firstFolderRecordCategoryChild = createRecordFolder(catsameLevel1.getId(),
|
RecordCategoryChild firstFolderRecordCategoryChild = createRecordFolder(catsameLevel1.getId(),firstFolderRM1622);
|
||||||
FIRST_FOLDER_RM_1622);
|
Record firstElectronicRecord = createElectronicRecord(firstFolderRecordCategoryChild.getId(),electronicRecordRM1622);
|
||||||
Record firstElectronicRecord = createElectronicRecord(firstFolderRecordCategoryChild.getId(),
|
|
||||||
ELECTRONIC_RECORD_RM_1622);
|
|
||||||
|
|
||||||
String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().getAdminUser().getUsername(),
|
String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().getAdminUser().getUsername(),
|
||||||
getDataUser().getAdminUser().getPassword(), FIRST_FOLDER_RM_1622, ELECTRONIC_RECORD_RM_1622);
|
getDataUser().getAdminUser().getPassword(),firstFolderRM1622, electronicRecordRM1622);
|
||||||
recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
String elRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + FIRST_CATEGORY_RM_1622 + "/" + FIRST_FOLDER_RM_1622);
|
getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM1622 + "/" + firstFolderRM1622);
|
||||||
|
|
||||||
recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(),
|
recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(),
|
||||||
getDataUser().getAdminUser().getPassword(), elRecordFullName);
|
getDataUser().getAdminUser().getPassword(), elRecordFullName);
|
||||||
|
|
||||||
// create a folder on the category secondCategoryRM1622 with a non electronic record
|
// create a folder on the category secondCategoryRM1622 with a non electronic record
|
||||||
createRecordFolder(catsameLevel2.getId(), SECOND_FOLDER_RM_1622);
|
RecordCategoryChild secondFolderRecordCategoryChild = createRecordFolder(catsameLevel2.getId(),secondFolderRM1622);
|
||||||
String elRecordNameNodeRefs = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
String elRecordNameNodeRefs = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||||
getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + FIRST_CATEGORY_RM_1622 + "/" + FIRST_FOLDER_RM_1622);
|
getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM1622 + "/" + firstFolderRM1622);
|
||||||
|
|
||||||
|
|
||||||
// link it to the folder in second category through the details page
|
// link it to the folder in second category through the details page
|
||||||
@@ -420,12 +410,14 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
|
|||||||
recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + firstElectronicRecord.getId());
|
recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + firstElectronicRecord.getId());
|
||||||
|
|
||||||
linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
||||||
getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK, SECOND_CATEGORY_RM_1622 + "/" +
|
getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,secondCategoryRM1622 + "/" +
|
||||||
SECOND_FOLDER_RM_1622, recordLists);
|
secondFolderRM1622, recordLists);
|
||||||
|
|
||||||
// edit disposition date
|
// edit disposition date
|
||||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||||
getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRefs);
|
getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRefs);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test (dependsOnMethods = {"sameLevelDispositionScheduleStepsPeriodsCalculation" })
|
@Test (dependsOnMethods = {"sameLevelDispositionScheduleStepsPeriodsCalculation" })
|
||||||
@@ -436,4 +428,4 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
|
|||||||
// Verify the status code
|
// Verify the status code
|
||||||
assertStatusCode(NO_CONTENT);
|
assertStatusCode(NO_CONTENT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||||
<version>23.1.0.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||||
<version>23.1.0.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||||
<version>23.1.0.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.1.0.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||||
<version>23.1.0.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
Binary file not shown.
@@ -48,7 +48,7 @@ function tagQuery()
|
|||||||
}
|
}
|
||||||
query += "ASPECT:\"{http://www.alfresco.org/model/content/1.0}taggable\"";
|
query += "ASPECT:\"{http://www.alfresco.org/model/content/1.0}taggable\"";
|
||||||
//MNT-2118 Share inconsistencies when displaying locked files with tags
|
//MNT-2118 Share inconsistencies when displaying locked files with tags
|
||||||
query += " AND -ASPECT:\"{http://www.alfresco.org/model/content/1.0}workingcopy\"";
|
query += " -ASPECT:\"{http://www.alfresco.org/model/content/1.0}workingcopy\"";
|
||||||
|
|
||||||
// MNT-20091 check to prevent cm:taggable with NULL
|
// MNT-20091 check to prevent cm:taggable with NULL
|
||||||
query += " AND ISNOTNULL:\"{http://www.alfresco.org/model/content/1.0}taggable\"";
|
query += " AND ISNOTNULL:\"{http://www.alfresco.org/model/content/1.0}taggable\"";
|
||||||
@@ -60,7 +60,7 @@ function tagQuery()
|
|||||||
query: query,
|
query: query,
|
||||||
language: "lucene",
|
language: "lucene",
|
||||||
page: {
|
page: {
|
||||||
// query minimum rows because all useful info will come with facets
|
// query minimum rows because all usefull info will come with facets
|
||||||
maxItems: 1,
|
maxItems: 1,
|
||||||
skipCount: 0
|
skipCount: 0
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ function getCategoryNode()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var queryPath = "/" + catAspect + "/" + encodePath(path);
|
var queryPath = "/" + catAspect + "/" + encodePath(path);
|
||||||
categoryResults = search.luceneSearch("+PATH:\"" + queryPath + "/*\" AND -PATH:\"" + queryPath + "/member\"");
|
categoryResults = search.luceneSearch("+PATH:\"" + queryPath + "/*\" -PATH:\"" + queryPath + "/member\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
// make each result an object and indicate it is selectable in the UI
|
// make each result an object and indicate it is selectable in the UI
|
||||||
@@ -71,4 +71,4 @@ function encodePath(path)
|
|||||||
function sortByName(a, b)
|
function sortByName(a, b)
|
||||||
{
|
{
|
||||||
return (b.node.name.toLowerCase() > a.node.name.toLowerCase() ? -1 : 1);
|
return (b.node.name.toLowerCase() > a.node.name.toLowerCase() ? -1 : 1);
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ function main()
|
|||||||
{
|
{
|
||||||
query = "+PATH:\"" + parsedArgs.pathNode.qnamePath + "//*\" ";
|
query = "+PATH:\"" + parsedArgs.pathNode.qnamePath + "//*\" ";
|
||||||
}
|
}
|
||||||
query += "AND +TYPE:\"cm:content\" AND +@cm\\:content.mimetype:\"image/*\"";
|
query += "+TYPE:\"cm:content\" +@cm\\:content.mimetype:image/*";
|
||||||
|
|
||||||
// Sort the list before trimming to page chunks
|
// Sort the list before trimming to page chunks
|
||||||
assets = search.query(
|
assets = search.query(
|
||||||
@@ -52,4 +52,4 @@ function main()
|
|||||||
/**
|
/**
|
||||||
* Images List Component: images
|
* Images List Component: images
|
||||||
*/
|
*/
|
||||||
model.images = main();
|
model.images = main();
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.1.0.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
@@ -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.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ 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()
|
||||||
{
|
{
|
||||||
@@ -70,18 +71,28 @@ 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 attachment == that.attachment && Objects.equals(contentUrl,
|
return Objects.equals(fileName, that.fileName) && 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);
|
return Objects.hash(contentUrl, expiryTime, attachment, fileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
@@ -9,6 +9,6 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||||
<version>23.1.0.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||||
<version>23.1.0.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.1.0.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||||
<version>23.1.0.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||||
<version>23.1.0.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<organization>
|
<organization>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||||
<version>23.1.0.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||||
<version>23.1.0.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||||
<version>23.1.0.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -1,16 +1,11 @@
|
|||||||
package org.alfresco.rest.favorites;
|
package org.alfresco.rest.favorites;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||||
import org.alfresco.rest.RestTest;
|
import org.alfresco.rest.RestTest;
|
||||||
import org.alfresco.rest.model.RestErrorModel;
|
import org.alfresco.rest.model.RestErrorModel;
|
||||||
import org.alfresco.rest.model.RestPersonFavoritesModel;
|
import org.alfresco.rest.model.RestPersonFavoritesModel;
|
||||||
import org.alfresco.rest.model.RestPersonFavoritesModelsCollection;
|
import org.alfresco.rest.model.RestPersonFavoritesModelsCollection;
|
||||||
import org.alfresco.rest.model.RestSiteModel;
|
import org.alfresco.rest.model.RestSiteModel;
|
||||||
import org.alfresco.rest.search.RestRequestQueryModel;
|
|
||||||
import org.alfresco.rest.search.SearchRequest;
|
|
||||||
import org.alfresco.utility.Utility;
|
|
||||||
import org.alfresco.utility.constants.UserRole;
|
import org.alfresco.utility.constants.UserRole;
|
||||||
import org.alfresco.utility.data.DataUser.ListUserWithRoles;
|
import org.alfresco.utility.data.DataUser.ListUserWithRoles;
|
||||||
import org.alfresco.utility.model.FileModel;
|
import org.alfresco.utility.model.FileModel;
|
||||||
@@ -20,7 +15,6 @@ 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;
|
||||||
@@ -67,7 +61,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||||
description = "Verify Manager user gets favorites with Rest API and status code is 200")
|
description = "Verify Manager user gets favorites with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||||
public void managerIsAbleToRetrieveFavorites()
|
public void managerIsAbleToRetrieveFavorites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -83,7 +77,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
description = "Verify user gets status code 401 if authentication call fails")
|
description = "Verify user gets status code 401 if authentication call fails")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||||
// @Bug(id = "MNT-16904", description = "It fails only on environment with tenants")
|
// @Bug(id = "MNT-16904", description = "It fails only on environment with tenants")
|
||||||
public void userIsNotAbleToRetrieveFavoritesIfAuthenticationFails()
|
public void userIsNotAbleToRetrieveFavoritesIfAuthenticationFails() throws Exception
|
||||||
{
|
{
|
||||||
UserModel siteManager = firstSiteUsers.getOneUserWithRole(UserRole.SiteManager);
|
UserModel siteManager = firstSiteUsers.getOneUserWithRole(UserRole.SiteManager);
|
||||||
siteManager.setPassword("wrongPassword");
|
siteManager.setPassword("wrongPassword");
|
||||||
@@ -94,7 +88,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify Admin user gets favorites sites with Rest API and status code is 200")
|
description = "Verify Admin user gets favorites sites with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void adminIsAbleToRetrieveFavoritesSites()
|
public void adminIsAbleToRetrieveFavoritesSites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(adminUserModel).addSiteToFavorites(firstSiteModel);
|
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(adminUserModel).addSiteToFavorites(firstSiteModel);
|
||||||
restClient.withCoreAPI().usingUser(adminUserModel).addSiteToFavorites(secondSiteModel);
|
restClient.withCoreAPI().usingUser(adminUserModel).addSiteToFavorites(secondSiteModel);
|
||||||
@@ -109,7 +103,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify Admin user gets favorites folders with Rest API and status code is 200")
|
description = "Verify Admin user gets favorites folders with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void adminIsAbleToRetrieveFavoritesFolders()
|
public void adminIsAbleToRetrieveFavoritesFolders() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(adminUserModel).addFolderToFavorites(firstFolderModel);
|
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(adminUserModel).addFolderToFavorites(firstFolderModel);
|
||||||
restClient.withCoreAPI().usingUser(adminUserModel).addFolderToFavorites(secondFolderModel);
|
restClient.withCoreAPI().usingUser(adminUserModel).addFolderToFavorites(secondFolderModel);
|
||||||
@@ -124,7 +118,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify Admin user gets favorites files with Rest API and status code is 200")
|
description = "Verify Admin user gets favorites files with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void adminIsAbleToRetrieveFavoritesFiles()
|
public void adminIsAbleToRetrieveFavoritesFiles() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(adminUserModel).addFileToFavorites(firstFileModel);
|
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(adminUserModel).addFileToFavorites(firstFileModel);
|
||||||
restClient.withCoreAPI().usingUser(adminUserModel).addFileToFavorites(secondFileModel);
|
restClient.withCoreAPI().usingUser(adminUserModel).addFileToFavorites(secondFileModel);
|
||||||
@@ -139,7 +133,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify Collaborator user gets favorites with Rest API and status code is 200")
|
description = "Verify Collaborator user gets favorites with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void collaboratorIsAbleToRetrieveFavorites()
|
public void collaboratorIsAbleToRetrieveFavorites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator))
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator))
|
||||||
.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -154,7 +148,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify Contributor user gets favorites with Rest API and status code is 200")
|
description = "Verify Contributor user gets favorites with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void contributorIsAbleToRetrieveFavorites()
|
public void contributorIsAbleToRetrieveFavorites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteContributor))
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteContributor))
|
||||||
.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -169,7 +163,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify Consumer user gets favorites with Rest API and status code is 200")
|
description = "Verify Consumer user gets favorites with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void consumerIsAbleToRetrieveFavorites()
|
public void consumerIsAbleToRetrieveFavorites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer))
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer))
|
||||||
.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -184,7 +178,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify user doesn't have permission to get favorites of another user with Rest API and status code is 404")
|
description = "Verify user doesn't have permission to get favorites of another user with Rest API and status code is 404")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsNotAbleToRetrieveFavoritesOfAnotherUser()
|
public void userIsNotAbleToRetrieveFavoritesOfAnotherUser() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer))
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer))
|
||||||
.withCoreAPI().usingUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator)).getFavorites();
|
.withCoreAPI().usingUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator)).getFavorites();
|
||||||
@@ -195,7 +189,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify user doesn't have permission to get favorites of admin user with Rest API and status code is 200")
|
description = "Verify user doesn't have permission to get favorites of admin user with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsNotAbleToRetrieveFavoritesOfAdminUser()
|
public void userIsNotAbleToRetrieveFavoritesOfAdminUser() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer)).withCoreAPI()
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer)).withCoreAPI()
|
||||||
.usingUser(adminUserModel).getFavorites();
|
.usingUser(adminUserModel).getFavorites();
|
||||||
@@ -206,7 +200,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify admin user doesn't have permission to get favorites of another user with Rest API and status code is 200")
|
description = "Verify admin user doesn't have permission to get favorites of another user with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void adminIsNotAbleToRetrieveFavoritesOfAnotherUser()
|
public void adminIsNotAbleToRetrieveFavoritesOfAnotherUser() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator))
|
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator))
|
||||||
.getFavorites();
|
.getFavorites();
|
||||||
@@ -217,7 +211,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify User gets only favorites sites with Rest API and status code is 200")
|
description = "Verify User gets only favorites sites with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToRetrieveOnlyFavoritesSites()
|
public void userIsAbleToRetrieveOnlyFavoritesSites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -235,7 +229,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify User gets only favorites files with Rest API and status code is 200")
|
description = "Verify User gets only favorites files with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToRetrieveOnlyFavoritesFiles()
|
public void userIsAbleToRetrieveOnlyFavoritesFiles() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator));
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -253,7 +247,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify User gets only favorites folders with Rest API and status code is 200")
|
description = "Verify User gets only favorites folders with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToRetrieveOnlyFavoritesFolders()
|
public void userIsAbleToRetrieveOnlyFavoritesFolders() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator));
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -271,7 +265,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify User gets only favorites files or folders with Rest API and status code is 200")
|
description = "Verify User gets only favorites files or folders with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToRetrieveFavoritesFilesOrFolders()
|
public void userIsAbleToRetrieveFavoritesFilesOrFolders() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer));
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -292,7 +286,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify User gets only favorites files or sites with Rest API and status code is 200")
|
description = "Verify User gets only favorites files or sites with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToRetrieveFavoritesFilesOrSites()
|
public void userIsAbleToRetrieveFavoritesFilesOrSites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -313,7 +307,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify User gets only favorites folders or sites with Rest API and status code is 200")
|
description = "Verify User gets only favorites folders or sites with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToRetrieveFavoritesFoldersOrSites()
|
public void userIsAbleToRetrieveFavoritesFoldersOrSites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -334,7 +328,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify User gets all favorites with Rest API and status code is 200")
|
description = "Verify User gets all favorites with Rest API and status code is 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToRetrieveAllFavorites()
|
public void userIsAbleToRetrieveAllFavorites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator));
|
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -365,7 +359,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify request for a user with no favorites returns status 200")
|
description = "Verify request for a user with no favorites returns status 200")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userHasNoFavorites()
|
public void userHasNoFavorites() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteContributor));
|
restClient.authenticateUser(secondSiteUsers.getOneUserWithRole(UserRole.SiteContributor));
|
||||||
|
|
||||||
@@ -377,7 +371,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify request using invalid where parameter returns status 400")
|
description = "Verify request using invalid where parameter returns status 400")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void getFavoritesUsingInvalidWhereParameter()
|
public void getFavoritesUsingInvalidWhereParameter() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer));
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteConsumer));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -393,7 +387,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify User gets correct favorites after deleting a favorite")
|
description = "Verify User gets correct favorites after deleting a favorite")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void checkFavoriteFolderIsRemoved()
|
public void checkFavoriteFolderIsRemoved() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
restClient.authenticateUser(firstSiteUsers.getOneUserWithRole(UserRole.SiteManager));
|
||||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||||
@@ -411,7 +405,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify get favorites specifying -me- string in place of <personid> for request")
|
description = "Verify get favorites specifying -me- string in place of <personid> for request")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToGetFavoritesWhenUsingMeAsUsername()
|
public void userIsAbleToGetFavoritesWhenUsingMeAsUsername() throws Exception
|
||||||
{
|
{
|
||||||
userFavorites = restClient.authenticateUser(userModel).withCoreAPI().usingMe().getFavorites();
|
userFavorites = restClient.authenticateUser(userModel).withCoreAPI().usingMe().getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
@@ -421,7 +415,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify get favorites using empty for where parameter for request")
|
description = "Verify get favorites using empty for where parameter for request")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToGetFavoritesWhenUsingEmptyWhereParameter()
|
public void userIsAbleToGetFavoritesWhenUsingEmptyWhereParameter() throws Exception
|
||||||
{
|
{
|
||||||
userFavorites = restClient.authenticateUser(adminUserModel).withCoreAPI().usingAuthUser().where().getFavorites();
|
userFavorites = restClient.authenticateUser(adminUserModel).withCoreAPI().usingAuthUser().where().getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
||||||
@@ -431,7 +425,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify that for invalid maxItems parameter status code returned is 400.")
|
description = "Verify that for invalid maxItems parameter status code returned is 400.")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void checkInvalidMaxItemsStatusCode()
|
public void checkInvalidMaxItemsStatusCode() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(adminUserModel).withParams("maxItems=AB").withCoreAPI().usingUser(adminUserModel).getFavorites();
|
restClient.authenticateUser(adminUserModel).withParams("maxItems=AB").withCoreAPI().usingUser(adminUserModel).getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError().containsSummary("Invalid paging parameter");
|
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError().containsSummary("Invalid paging parameter");
|
||||||
@@ -440,7 +434,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify that for invalid skipCount parameter status code returned is 400.")
|
description = "Verify that for invalid skipCount parameter status code returned is 400.")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void checkInvalidSkipCountStatusCode()
|
public void checkInvalidSkipCountStatusCode() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(adminUserModel).withParams("skipCount=AB").withCoreAPI().usingUser(adminUserModel).getFavorites();
|
restClient.authenticateUser(adminUserModel).withParams("skipCount=AB").withCoreAPI().usingUser(adminUserModel).getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError().containsSummary("Invalid paging parameter");
|
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError().containsSummary("Invalid paging parameter");
|
||||||
@@ -449,7 +443,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify get favorites when using invalid network id for non-tenant user")
|
description = "Verify get favorites when using invalid network id for non-tenant user")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void getFavoritesWhenNetworkIdIsInvalid()
|
public void getFavoritesWhenNetworkIdIsInvalid() throws Exception
|
||||||
{
|
{
|
||||||
UserModel networkUserModel = dataUser.createRandomTestUser();
|
UserModel networkUserModel = dataUser.createRandomTestUser();
|
||||||
networkUserModel.setDomain("invalidNetwork");
|
networkUserModel.setDomain("invalidNetwork");
|
||||||
@@ -460,7 +454,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify get favorites using AND instead of OR in where parameter for request")
|
description = "Verify get favorites using AND instead of OR in where parameter for request")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsNotAbleToGetFavoritesWhenUsingANDInWhereParameter()
|
public void userIsNotAbleToGetFavoritesWhenUsingANDInWhereParameter() throws Exception
|
||||||
{
|
{
|
||||||
userFavorites = restClient.withCoreAPI().usingAuthUser().where().targetFolderExist().invalidWhereParameter("AND").targetFileExist().getFavorites();
|
userFavorites = restClient.withCoreAPI().usingAuthUser().where().targetFolderExist().invalidWhereParameter("AND").targetFileExist().getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
||||||
@@ -470,7 +464,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify get favorites using wrong name instead of EXISTS in where parameter for request")
|
description = "Verify get favorites using wrong name instead of EXISTS in where parameter for request")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsNotAbleToGetFavoritesWhenUsingWrongWhereParameter()
|
public void userIsNotAbleToGetFavoritesWhenUsingWrongWhereParameter() throws Exception
|
||||||
{
|
{
|
||||||
userFavorites = restClient.withCoreAPI().usingAuthUser().where().invalidWhereParameter("EXIST((target/site))").targetFileExist().getFavorites();
|
userFavorites = restClient.withCoreAPI().usingAuthUser().where().invalidWhereParameter("EXIST((target/site))").targetFileExist().getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
||||||
@@ -480,7 +474,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify get favorites except the first one for request")
|
description = "Verify get favorites except the first one for request")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToGetFavoritesExceptTheFirstOne()
|
public void userIsAbleToGetFavoritesExceptTheFirstOne() throws Exception
|
||||||
{
|
{
|
||||||
userFavorites = restClient.authenticateUser(userModel).withParams("skipCount=1").withCoreAPI().usingUser(userModel).getFavorites();
|
userFavorites = restClient.authenticateUser(userModel).withParams("skipCount=1").withCoreAPI().usingUser(userModel).getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
@@ -493,7 +487,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify get first two favorites sites")
|
description = "Verify get first two favorites sites")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToGetFirstTwoFavorites()
|
public void userIsAbleToGetFirstTwoFavorites() throws Exception
|
||||||
{
|
{
|
||||||
userFavorites = restClient.authenticateUser(userModel).withParams("maxItems=2").withCoreAPI().usingUser(userModel).getFavorites();
|
userFavorites = restClient.authenticateUser(userModel).withParams("maxItems=2").withCoreAPI().usingUser(userModel).getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
@@ -509,7 +503,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify get favorites sites when using empty values for skipCount and maxItems")
|
description = "Verify get favorites sites when using empty values for skipCount and maxItems")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToGetFavoritesWhenSkipCountAndMaxItemsAreEmpty()
|
public void userIsAbleToGetFavoritesWhenSkipCountAndMaxItemsAreEmpty() throws Exception
|
||||||
{
|
{
|
||||||
restClient.authenticateUser(userModel).withParams("skipCount= ").withCoreAPI().usingUser(userModel).getFavorites();
|
restClient.authenticateUser(userModel).withParams("skipCount= ").withCoreAPI().usingUser(userModel).getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError().containsSummary(String.format(RestErrorModel.INVALID_SKIPCOUNT, " "));
|
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError().containsSummary(String.format(RestErrorModel.INVALID_SKIPCOUNT, " "));
|
||||||
@@ -521,7 +515,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify the get favorites request for a high value for skipCount parameter")
|
description = "Verify the get favorites request for a high value for skipCount parameter")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToGetFavoritesWithHighSkipCount()
|
public void userIsAbleToGetFavoritesWithHighSkipCount() throws Exception
|
||||||
{
|
{
|
||||||
userFavorites = restClient.authenticateUser(userModel).withParams("skipCount=999999999").withCoreAPI().usingUser(userModel).getFavorites();
|
userFavorites = restClient.authenticateUser(userModel).withParams("skipCount=999999999").withCoreAPI().usingUser(userModel).getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
@@ -532,7 +526,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||||
description = "Verify the get favorites request with properties parameter applied")
|
description = "Verify the get favorites request with properties parameter applied")
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
public void userIsAbleToGetFavoritesWithPropertiesParamApplied()
|
public void userIsAbleToGetFavoritesWithPropertiesParamApplied() throws Exception
|
||||||
{
|
{
|
||||||
userFavorites = restClient.authenticateUser(userModel).withParams("properties=targetGuid").withCoreAPI().usingUser(userModel).getFavorites();
|
userFavorites = restClient.authenticateUser(userModel).withParams("properties=targetGuid").withCoreAPI().usingUser(userModel).getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
@@ -543,7 +537,7 @@ public class GetFavoritesTests extends RestTest
|
|||||||
|
|
||||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify entry details for get favorites response with Rest API")
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify entry details for get favorites response with Rest API")
|
||||||
public void checkResponseSchemaForGetFavorites()
|
public void checkResponseSchemaForGetFavorites() throws Exception
|
||||||
{
|
{
|
||||||
userFavorites = restClient.authenticateUser(userModel).withCoreAPI().usingAuthUser().getFavorites();
|
userFavorites = restClient.authenticateUser(userModel).withCoreAPI().usingAuthUser().getFavorites();
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
@@ -559,12 +553,11 @@ 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,
|
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify if get favorites response returns allowableOperations object when requested")
|
||||||
description = "Verify if get favorites response returns allowableOperations object when requested")
|
public void checkResponseForGetFavoritesWithAllowableOperations()
|
||||||
public void checkResponsesForGetFavoritesWithAllowableOperations()
|
|
||||||
{
|
{
|
||||||
final RestPersonFavoritesModelsCollection adminFavorites =
|
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);
|
||||||
|
|
||||||
@@ -572,22 +565,4 @@ 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());
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||||
<version>23.1.0.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -388,6 +388,12 @@
|
|||||||
<load-on-startup>8</load-on-startup>
|
<load-on-startup>8</load-on-startup>
|
||||||
</servlet>
|
</servlet>
|
||||||
|
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>cmistck</servlet-name>
|
||||||
|
<servlet-class>org.apache.chemistry.opencmis.tck.runner.WebRunnerServlet</servlet-class>
|
||||||
|
<load-on-startup>8</load-on-startup>
|
||||||
|
</servlet>
|
||||||
|
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>publicapiServlet</servlet-name>
|
<servlet-name>publicapiServlet</servlet-name>
|
||||||
<servlet-class>org.alfresco.rest.api.PublicApiWebScriptServlet</servlet-class>
|
<servlet-class>org.alfresco.rest.api.PublicApiWebScriptServlet</servlet-class>
|
||||||
@@ -463,6 +469,14 @@
|
|||||||
<servlet-name>publicapiServlet</servlet-name>
|
<servlet-name>publicapiServlet</servlet-name>
|
||||||
<url-pattern>/api/*</url-pattern>
|
<url-pattern>/api/*</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
|
<!-- The CMIS TCK is deactivated by default. -->
|
||||||
|
<!-- CMISTCK
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>cmistck</servlet-name>
|
||||||
|
<url-pattern>/cmistck</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
CMISTCK -->
|
||||||
|
|
||||||
<!-- Enterprise servlet-mapping placeholder -->
|
<!-- Enterprise servlet-mapping placeholder -->
|
||||||
|
|
||||||
|
|||||||
38
pom.xml
38
pom.xml
@@ -2,7 +2,7 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.1.0.183</version>
|
<version>23.1.0.167-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>5.4.0</dependency.mockito-core.version>
|
<dependency.mockito-core.version>4.9.0</dependency.mockito-core.version>
|
||||||
<dependency.assertj.version>3.24.2</dependency.assertj.version>
|
<dependency.assertj.version>3.24.2</dependency.assertj.version>
|
||||||
<dependency.org-json.version>20230618</dependency.org-json.version>
|
<dependency.org-json.version>20230618</dependency.org-json.version>
|
||||||
<dependency.commons-dbcp.version>2.9.0</dependency.commons-dbcp.version>
|
<dependency.commons-dbcp.version>2.9.0</dependency.commons-dbcp.version>
|
||||||
@@ -84,8 +84,10 @@
|
|||||||
<dependency.poi.version>5.2.2</dependency.poi.version>
|
<dependency.poi.version>5.2.2</dependency.poi.version>
|
||||||
<dependency.poi-ooxml-lite.version>5.2.3</dependency.poi-ooxml-lite.version>
|
<dependency.poi-ooxml-lite.version>5.2.3</dependency.poi-ooxml-lite.version>
|
||||||
<dependency.jboss.logging.version>3.5.0.Final</dependency.jboss.logging.version>
|
<dependency.jboss.logging.version>3.5.0.Final</dependency.jboss.logging.version>
|
||||||
<dependency.camel.version>3.21.0</dependency.camel.version> <!-- when bumping this version, please keep track/sync with included netty.io dependencies -->
|
<dependency.camel.version>3.20.2</dependency.camel.version> <!-- when bumping this version, please keep track/sync with included netty.io dependencies -->
|
||||||
<dependency.netty.version>4.1.95.Final</dependency.netty.version> <!-- must be in sync with camels transitive dependencies, e.g.: netty-common -->
|
<dependency.netty.version>4.1.87.Final</dependency.netty.version> <!-- must be in sync with camels transitive dependencies, e.g.: netty-common -->
|
||||||
|
<dependency.netty.qpid.version>4.1.82.Final</dependency.netty.qpid.version> <!-- must be in sync with camels transitive dependencies: native-unix-common/native-epoll/native-kqueue -->
|
||||||
|
<dependency.netty-tcnative.version>2.0.56.Final</dependency.netty-tcnative.version> <!-- must be in sync with camels transitive dependencies -->
|
||||||
<dependency.activemq.version>5.17.4</dependency.activemq.version>
|
<dependency.activemq.version>5.17.4</dependency.activemq.version>
|
||||||
<dependency.apache-compress.version>1.23.0</dependency.apache-compress.version>
|
<dependency.apache-compress.version>1.23.0</dependency.apache-compress.version>
|
||||||
<dependency.apache.taglibs.version>1.2.5</dependency.apache.taglibs.version>
|
<dependency.apache.taglibs.version>1.2.5</dependency.apache.taglibs.version>
|
||||||
@@ -148,7 +150,7 @@
|
|||||||
<connection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</connection>
|
<connection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</connection>
|
||||||
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</developerConnection>
|
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</developerConnection>
|
||||||
<url>https://github.com/Alfresco/alfresco-community-repo</url>
|
<url>https://github.com/Alfresco/alfresco-community-repo</url>
|
||||||
<tag>23.1.0.183</tag>
|
<tag>HEAD</tag>
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
@@ -386,11 +388,7 @@
|
|||||||
<artifactId>commons-fileupload</artifactId>
|
<artifactId>commons-fileupload</artifactId>
|
||||||
<version>1.5</version>
|
<version>1.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>commons-net</groupId>
|
|
||||||
<artifactId>commons-net</artifactId>
|
|
||||||
<version>3.9.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
<artifactId>httpclient</artifactId>
|
<artifactId>httpclient</artifactId>
|
||||||
@@ -853,6 +851,17 @@
|
|||||||
<artifactId>camel-mock</artifactId>
|
<artifactId>camel-mock</artifactId>
|
||||||
<version>${dependency.camel.version}</version>
|
<version>${dependency.camel.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- Netty non-transitive dependencies declared for depending projects usage in conjunction with Camel's other transitive netty dependencies -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.netty</groupId>
|
||||||
|
<artifactId>netty-handler-proxy</artifactId>
|
||||||
|
<version>${dependency.netty.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.netty</groupId>
|
||||||
|
<artifactId>netty-tcnative-classes</artifactId>
|
||||||
|
<version>${dependency.netty-tcnative.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.taglibs</groupId>
|
<groupId>org.apache.taglibs</groupId>
|
||||||
@@ -897,15 +906,6 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.netty</groupId>
|
|
||||||
<artifactId>netty-bom</artifactId>
|
|
||||||
<version>${dependency.netty.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.security</groupId>
|
<groupId>org.springframework.security</groupId>
|
||||||
<artifactId>spring-security-bom</artifactId>
|
<artifactId>spring-security-bom</artifactId>
|
||||||
|
|||||||
@@ -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.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
@@ -63,11 +63,6 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import java.util.concurrent.locks.Lock;
|
|
||||||
import java.util.concurrent.locks.ReadWriteLock;
|
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
import static org.mockito.ArgumentMatchers.anyInt;
|
import static org.mockito.ArgumentMatchers.anyInt;
|
||||||
import static org.mockito.Mockito.doAnswer;
|
import static org.mockito.Mockito.doAnswer;
|
||||||
@@ -506,78 +501,40 @@ class BlockingRemoteUserMapper implements RemoteUserMapper, ActivateableBean
|
|||||||
private volatile int timePassed;
|
private volatile int timePassed;
|
||||||
|
|
||||||
private boolean isEnabled = true;
|
private boolean isEnabled = true;
|
||||||
private final ReadWriteLock lock = new ReentrantReadWriteLock();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRemoteUser(HttpServletRequest request)
|
public String getRemoteUser(HttpServletRequest request)
|
||||||
{
|
{
|
||||||
doWithLock(lock.writeLock(), () -> {
|
long t1 = System.currentTimeMillis();
|
||||||
long t1 = System.currentTimeMillis();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Thread.sleep(BLOCKING_FOR_MILLIS);
|
|
||||||
} catch (InterruptedException ie)
|
|
||||||
{
|
|
||||||
wasInterrupted = true;
|
|
||||||
} finally
|
|
||||||
{
|
|
||||||
timePassed = (int) (System.currentTimeMillis() - t1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void doWithLock(Lock lock, Runnable action)
|
|
||||||
{
|
|
||||||
getWithLock(lock, () ->
|
|
||||||
{
|
|
||||||
action.run();
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private static <T> T getWithLock(Lock lock, Supplier<T> supplier)
|
|
||||||
{
|
|
||||||
final boolean locked;
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
locked = lock.tryLock(BLOCKING_FOR_MILLIS * 2, TimeUnit.MILLISECONDS);
|
Thread.sleep(BLOCKING_FOR_MILLIS);
|
||||||
}
|
}
|
||||||
catch (InterruptedException e)
|
catch (InterruptedException ie)
|
||||||
{
|
{
|
||||||
Thread.currentThread().interrupt();
|
wasInterrupted = true;
|
||||||
throw new IllegalStateException("Unexpected InterruptedException while acquiring " + lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!locked) throw new IllegalStateException("Unexpected failure while acquiring " + lock);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return supplier.get();
|
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
lock.unlock();
|
timePassed = (int) (System.currentTimeMillis() - t1);
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isWasInterrupted()
|
public boolean isWasInterrupted()
|
||||||
{
|
{
|
||||||
return getWithLock(lock.readLock(), () -> wasInterrupted);
|
return wasInterrupted;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTimePassed()
|
public int getTimePassed()
|
||||||
{
|
{
|
||||||
return getWithLock(lock.readLock(), () -> timePassed);
|
return timePassed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reset()
|
public void reset()
|
||||||
{
|
{
|
||||||
doWithLock(lock.writeLock(), () ->
|
wasInterrupted = false;
|
||||||
{
|
timePassed = 0;
|
||||||
wasInterrupted = false;
|
|
||||||
timePassed = 0;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -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.183</version>
|
<version>23.1.0.167-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@@ -741,6 +741,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-net</groupId>
|
<groupId>commons-net</groupId>
|
||||||
<artifactId>commons-net</artifactId>
|
<artifactId>commons-net</artifactId>
|
||||||
|
<version>3.8.0</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -655,6 +655,9 @@ 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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -69,22 +69,22 @@ public class AlfrescoRmiRegistryFactoryBean implements FactoryBean<Registry>, Di
|
|||||||
if (LOG.isDebugEnabled()) {
|
if (LOG.isDebugEnabled()) {
|
||||||
LOG.debug("Looking for RMI registry at port '" + this.port + "', using custom socket factory");
|
LOG.debug("Looking for RMI registry at port '" + this.port + "', using custom socket factory");
|
||||||
}
|
}
|
||||||
|
Registry registry;
|
||||||
synchronized (LocateRegistry.class) {
|
synchronized (LocateRegistry.class) {
|
||||||
try {
|
try {
|
||||||
// Retrieve existing registry.
|
// Retrieve existing registry.
|
||||||
final Registry localRegistry = LocateRegistry.getRegistry(null, this.port, socketFactory);
|
registry = LocateRegistry.getRegistry(null, this.port, socketFactory);
|
||||||
testRegistry(localRegistry);
|
testRegistry(this.registry);
|
||||||
return localRegistry;
|
|
||||||
}
|
}
|
||||||
catch (RemoteException ex) {
|
catch (RemoteException ex) {
|
||||||
LOG.trace("RMI registry access threw exception", ex);
|
LOG.trace("RMI registry access threw exception", ex);
|
||||||
LOG.debug("Could not detect RMI registry - creating new one");
|
LOG.debug("Could not detect RMI registry - creating new one");
|
||||||
// Assume no registry found -> create new one.
|
// Assume no registry found -> create new one.
|
||||||
this.created = true;
|
this.created = true;
|
||||||
return LocateRegistry.createRegistry(this.port, socketFactory, socketFactory);
|
registry = LocateRegistry.createRegistry(this.port, socketFactory, socketFactory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return registry;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEnabled()
|
public boolean isEnabled()
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -166,34 +166,46 @@ 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);
|
||||||
assertNull(directAccessUrl);
|
assertEquals("fileName was not set properly on the DirectAccessUrl response", fileNameOverride, directAccessUrl.getFileName());
|
||||||
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);
|
||||||
assertNull(directAccessUrl);
|
assertEquals("fileName was not set properly on the DirectAccessUrl response", SOME_FILE_NAME, directAccessUrl.getFileName());
|
||||||
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, "");
|
||||||
assertNull(directAccessUrl);
|
assertEquals("fileName was not set properly on the DirectAccessUrl response", SOME_FILE_NAME, directAccessUrl.getFileName());
|
||||||
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Repository
|
* Alfresco Repository
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2023 Alfresco Software Limited
|
* Copyright (C) 2005 - 2022 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
@@ -34,7 +34,6 @@ import static org.alfresco.model.ContentModel.ASSOC_MEMBER;
|
|||||||
import static org.alfresco.model.ContentModel.TYPE_CONTENT;
|
import static org.alfresco.model.ContentModel.TYPE_CONTENT;
|
||||||
import static org.alfresco.model.ContentModel.TYPE_FOLDER;
|
import static org.alfresco.model.ContentModel.TYPE_FOLDER;
|
||||||
import static org.alfresco.repo.rule.RuleModel.ASPECT_IGNORE_INHERITED_RULES;
|
import static org.alfresco.repo.rule.RuleModel.ASPECT_IGNORE_INHERITED_RULES;
|
||||||
import static org.alfresco.repo.rule.RuleModel.ASPECT_RULES;
|
|
||||||
import static org.alfresco.repo.rule.RuleModel.ASSOC_ACTION;
|
import static org.alfresco.repo.rule.RuleModel.ASSOC_ACTION;
|
||||||
import static org.alfresco.repo.rule.RuleModel.ASSOC_RULE_FOLDER;
|
import static org.alfresco.repo.rule.RuleModel.ASSOC_RULE_FOLDER;
|
||||||
import static org.alfresco.repo.rule.RuleModel.TYPE_RULE;
|
import static org.alfresco.repo.rule.RuleModel.TYPE_RULE;
|
||||||
@@ -49,7 +48,11 @@ import static org.mockito.ArgumentMatchers.eq;
|
|||||||
import static org.mockito.ArgumentMatchers.nullable;
|
import static org.mockito.ArgumentMatchers.nullable;
|
||||||
import static org.mockito.BDDMockito.given;
|
import static org.mockito.BDDMockito.given;
|
||||||
import static org.mockito.BDDMockito.then;
|
import static org.mockito.BDDMockito.then;
|
||||||
import static org.mockito.Mockito.*;
|
import static org.mockito.Mockito.atLeastOnce;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.times;
|
||||||
|
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
import static org.mockito.MockitoAnnotations.openMocks;
|
import static org.mockito.MockitoAnnotations.openMocks;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@@ -94,7 +97,7 @@ public class RuleServiceImplUnitTest
|
|||||||
@Mock
|
@Mock
|
||||||
private PermissionService permissionService;
|
private PermissionService permissionService;
|
||||||
@Mock
|
@Mock
|
||||||
private SimpleCache<NodeRef, List<Rule>> nodeRulesCache;
|
private SimpleCache nodeRulesCache;
|
||||||
@Mock
|
@Mock
|
||||||
private NodeService runtimeNodeService;
|
private NodeService runtimeNodeService;
|
||||||
@Mock
|
@Mock
|
||||||
@@ -135,12 +138,12 @@ public class RuleServiceImplUnitTest
|
|||||||
// Call the method under test.
|
// Call the method under test.
|
||||||
ruleService.saveRule(FOLDER_NODE, mockRule);
|
ruleService.saveRule(FOLDER_NODE, mockRule);
|
||||||
|
|
||||||
then(nodeService).should(times(2)).hasAspect(FOLDER_NODE, ASPECT_RULES);
|
then(nodeService).should(times(2)).hasAspect(FOLDER_NODE, RuleModel.ASPECT_RULES);
|
||||||
then(nodeService).should().exists(FOLDER_NODE);
|
then(nodeService).should().exists(FOLDER_NODE);
|
||||||
then(nodeService).should().addAspect(FOLDER_NODE, ASPECT_RULES, null);
|
then(nodeService).should().addAspect(FOLDER_NODE, RuleModel.ASPECT_RULES, null);
|
||||||
then(nodeService).should().createNode(eq(RULE_SET_NODE), eq(ASSOC_CONTAINS), any(QName.class), eq(TYPE_RULE));
|
then(nodeService).should().createNode(eq(RULE_SET_NODE), eq(ASSOC_CONTAINS), any(QName.class), eq(TYPE_RULE));
|
||||||
then(nodeService).should(atLeastOnce()).setProperty(eq(RULE_NODE), any(QName.class), nullable(Serializable.class));
|
then(nodeService).should(atLeastOnce()).setProperty(eq(RULE_NODE), any(QName.class), nullable(Serializable.class));
|
||||||
then(nodeService).should().getChildAssocs(RULE_NODE, ASSOC_ACTION, ASSOC_ACTION);
|
then(nodeService).should().getChildAssocs(RULE_NODE, RuleModel.ASSOC_ACTION, RuleModel.ASSOC_ACTION);
|
||||||
verifyNoMoreInteractions(nodeService);
|
verifyNoMoreInteractions(nodeService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -426,7 +429,7 @@ public class RuleServiceImplUnitTest
|
|||||||
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
||||||
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
||||||
|
|
||||||
assertEquals("Node names should match expected string", "A,B,C,D,E", nodeNames);
|
assertEquals("A,B,C,D,E", nodeNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check that ordered parents are returned in the correct order. */
|
/** Check that ordered parents are returned in the correct order. */
|
||||||
@@ -440,7 +443,7 @@ public class RuleServiceImplUnitTest
|
|||||||
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
||||||
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
||||||
|
|
||||||
assertEquals("Node names should match expected string", "A,B,C,D,E", nodeNames);
|
assertEquals("A,B,C,D,E", nodeNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check that the ASPECT_IGNORE_INHERITED_RULES aspect breaks the chain. */
|
/** Check that the ASPECT_IGNORE_INHERITED_RULES aspect breaks the chain. */
|
||||||
@@ -455,7 +458,7 @@ public class RuleServiceImplUnitTest
|
|||||||
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
||||||
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
||||||
|
|
||||||
assertEquals("Node names should match expected string", "C,D,E", nodeNames);
|
assertEquals("C,D,E", nodeNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check that the user group hierarchy is not traversed. */
|
/** Check that the user group hierarchy is not traversed. */
|
||||||
@@ -472,7 +475,7 @@ public class RuleServiceImplUnitTest
|
|||||||
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
||||||
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
||||||
|
|
||||||
assertEquals("Node names should match expected string", "C,D,E", nodeNames);
|
assertEquals("C,D,E", nodeNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check that a cycle doesn't cause a problem. */
|
/** Check that a cycle doesn't cause a problem. */
|
||||||
@@ -486,7 +489,7 @@ public class RuleServiceImplUnitTest
|
|||||||
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
||||||
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
||||||
|
|
||||||
assertEquals("Node names should match expected string", "A,B,C", nodeNames);
|
assertEquals("A,B,C", nodeNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check that a diamond of nodes is traversed correctly. */
|
/** Check that a diamond of nodes is traversed correctly. */
|
||||||
@@ -500,7 +503,7 @@ public class RuleServiceImplUnitTest
|
|||||||
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
||||||
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
||||||
|
|
||||||
assertEquals("Node names should match expected string", "A,B,C,D", nodeNames);
|
assertEquals("A,B,C,D", nodeNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -525,7 +528,7 @@ public class RuleServiceImplUnitTest
|
|||||||
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
||||||
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
||||||
|
|
||||||
assertEquals("Node names should match expected string", "A,C,B,E,D,F,G", nodeNames);
|
assertEquals("A,C,B,E,D,F,G", nodeNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -550,7 +553,7 @@ public class RuleServiceImplUnitTest
|
|||||||
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
Map<NodeRef, String> invertedMap = MapUtils.invertMap(nodes);
|
||||||
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
String nodeNames = actual.stream().map(invertedMap::get).collect(joining(","));
|
||||||
|
|
||||||
assertEquals("Node names should match expected string", "A,D,C,F,B,E,G", nodeNames);
|
assertEquals("A,D,C,F,B,E,G", nodeNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -8,37 +8,36 @@
|
|||||||
<property name="location" value="test-messaging.properties" />
|
<property name="location" value="test-messaging.properties" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="transactionAwareEventProducer" class="org.mockito.Mockito" factory-method="mock">
|
|
||||||
<constructor-arg type="java.lang.Class" value="org.alfresco.repo.rawevents.TransactionAwareEventProducer" />
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="policyComponent" class="org.mockito.Mockito" factory-method="mock">
|
|
||||||
<constructor-arg type="java.lang.Class" value="org.alfresco.repo.policy.PolicyComponentImpl"/>
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="transformRequestProcessor" class="org.mockito.Mockito" factory-method="mock">
|
|
||||||
<constructor-arg type="java.lang.Class" value="org.alfresco.repo.rendition2.TransformRequestProcessor" />
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<import resource="classpath:/alfresco/subsystems/Messaging/default/messaging-context.xml" />
|
<import resource="classpath:/alfresco/subsystems/Messaging/default/messaging-context.xml" />
|
||||||
|
|
||||||
<bean id="messagingExceptionProcessor"
|
<bean id="messagingExceptionProcessor"
|
||||||
class="org.alfresco.messaging.camel.MockExceptionProcessor" />
|
class="org.alfresco.messaging.camel.MockExceptionProcessor" />
|
||||||
|
|
||||||
<bean id="mockConsumer"
|
<bean id="mockConsumer"
|
||||||
class="org.alfresco.messaging.camel.MockConsumer" />
|
class="org.alfresco.messaging.camel.MockConsumer" />
|
||||||
|
|
||||||
<bean id="mockExceptionThrowingConsumer"
|
|
||||||
class="org.alfresco.messaging.camel.MockExceptionThrowingConsumer" />
|
|
||||||
|
|
||||||
|
<bean id="mockExceptionThrowingConsumer"
|
||||||
|
class="org.alfresco.messaging.camel.MockExceptionThrowingConsumer" />
|
||||||
|
|
||||||
<import resource="testRoutes.xml" />
|
<import resource="testRoutes.xml" />
|
||||||
<bean id="testNewRouteLoader" class="org.alfresco.messaging.camel.SpringContextRouteLoader">
|
<bean id="testNewRouteLoader" class="org.alfresco.messaging.camel.SpringContextRouteLoader">
|
||||||
<property name="camelContextId" value="alfrescoCamelContext" />
|
<property name="camelContextId" value="alfrescoCamelContext" />
|
||||||
<property name="routeContextId" value="customRoutes" />
|
<property name="routeContextId" value="customRoutes" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="renditionEventProcessor" class="org.mockito.Mockito" factory-method="mock">
|
<bean id="transactionAwareEventProducer" class="org.mockito.Mockito" factory-method="mock">
|
||||||
<constructor-arg type="java.lang.Class" value="org.alfresco.repo.rendition2.RenditionEventProcessor"/>
|
<constructor-arg value="org.alfresco.repo.rawevents.TransactionAwareEventProducer" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="policyComponent" class="org.mockito.Mockito" factory-method="mock">
|
||||||
|
<constructor-arg value="org.alfresco.repo.policy.PolicyComponentImpl"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean id="renditionEventProcessor" class="org.mockito.Mockito" factory-method="mock">
|
||||||
|
<constructor-arg value="org.alfresco.repo.rendition2.RenditionEventProcessor"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean id="transformRequestProcessor" class="org.mockito.Mockito" factory-method="mock">
|
||||||
|
<constructor-arg value="org.alfresco.repo.rendition2.TransformRequestProcessor" />
|
||||||
|
</bean>
|
||||||
</beans>
|
</beans>
|
||||||
@@ -3,23 +3,23 @@
|
|||||||
<beans>
|
<beans>
|
||||||
|
|
||||||
<bean id="repositoryHelper" class="org.mockito.Mockito" factory-method="mock">
|
<bean id="repositoryHelper" class="org.mockito.Mockito" factory-method="mock">
|
||||||
<constructor-arg type="java.lang.Class" value="org.alfresco.repo.model.Repository" />
|
<constructor-arg value="org.alfresco.repo.model.Repository" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="SiteService" class="org.mockito.Mockito" factory-method="mock">
|
<bean id="SiteService" class="org.mockito.Mockito" factory-method="mock">
|
||||||
<constructor-arg type="java.lang.Class" value="org.alfresco.repo.site.SiteServiceInternal" />
|
<constructor-arg value="org.alfresco.repo.site.SiteServiceInternal" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="NodeService" class="org.mockito.Mockito" factory-method="mock">
|
<bean id="NodeService" class="org.mockito.Mockito" factory-method="mock">
|
||||||
<constructor-arg type="java.lang.Class" value="org.alfresco.service.cmr.repository.NodeService" />
|
<constructor-arg value="org.alfresco.service.cmr.repository.NodeService" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="NamespaceService" class="org.mockito.Mockito" factory-method="mock">
|
<bean id="NamespaceService" class="org.mockito.Mockito" factory-method="mock">
|
||||||
<constructor-arg type="java.lang.Class" value="org.alfresco.service.namespace.NamespaceService" />
|
<constructor-arg value="org.alfresco.service.namespace.NamespaceService" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="SearchService" class="org.mockito.Mockito" factory-method="mock">
|
<bean id="SearchService" class="org.mockito.Mockito" factory-method="mock">
|
||||||
<constructor-arg type="java.lang.Class" value="org.alfresco.service.cmr.search.SearchService" />
|
<constructor-arg value="org.alfresco.service.cmr.search.SearchService" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
</beans>
|
</beans>
|
||||||
Reference in New Issue
Block a user