From 8b18d502088d2d68f3efa0ff17e0d3e876c67bf0 Mon Sep 17 00:00:00 2001 From: Roy Wetherall Date: Thu, 14 May 2015 04:14:30 +0000 Subject: [PATCH] RM-2198: Can't classify a frozen record. * server integration tests added * UI integration tests added (based on adjusted acceptance critera on RM-2052) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104141 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../classification/ClassifyTest.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/ClassifyTest.java b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/ClassifyTest.java index d5e6edf505..9f79cd9b6c 100644 --- a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/ClassifyTest.java +++ b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/ClassifyTest.java @@ -23,6 +23,7 @@ import java.util.List; import org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel; import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase; +import org.alfresco.repo.security.permissions.AccessDeniedException; import org.alfresco.service.cmr.repository.NodeRef; /** @@ -38,6 +39,37 @@ public class ClassifyTest extends BaseRMTestCase private static final String CLASSIFICATION_REASON = "Test Reason 1"; private static final String CLASSIFICATION_AUTHORITY = "classification authority"; private static final String RECORD_NAME = "recordname.txt"; + + /** + * Given that a record is frozen + * And unclassified + * When I set the initial classification + * Then a AccessDeniedException is raised + */ + public void testClassifyFrozenRecord() throws Exception + { + doBehaviourDrivenTest(new BehaviourDrivenTest(AccessDeniedException.class) + { + private NodeRef record; + + public void given() throws Exception + { + record = utils.createRecord(rmFolder, RECORD_NAME); + + NodeRef hold = holdService.createHold(filePlan, "my hold", "for test", "for test"); + holdService.addToHold(hold, record); + } + + public void when() throws Exception + { + classificationService.classifyContent( + CLASSIFICATION_LEVEL, + CLASSIFICATION_AUTHORITY, + Collections.singleton(CLASSIFICATION_REASON), + record); + } + }); + } /** * Given that a record is complete