From 0a52f24c6a71a51fa985b28637560decc39a3de7 Mon Sep 17 00:00:00 2001 From: Tuna Aksoy Date: Thu, 6 Aug 2015 22:10:14 +0000 Subject: [PATCH] RM-2402 (Extend classification schedule REST API) RM-2433 (Extend reclassification REST API) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@109730 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../classifycontent.post.desc.xml | 28 +++- .../classifycontent.put.desc.xml | 32 ++++- .../classification/ClassifyContentBase.java | 11 +- .../webscript/ClassificationRestApiTest.java | 127 ++++++++++++++++-- .../ClassifyContentPostUnitTest.java | 14 +- 5 files changed, 188 insertions(+), 24 deletions(-) diff --git a/rm-server/config/alfresco/templates/webscripts/org/alfresco/rma/classification/classifycontent.post.desc.xml b/rm-server/config/alfresco/templates/webscripts/org/alfresco/rma/classification/classifycontent.post.desc.xml index 2e43613aa1..0241462ac2 100644 --- a/rm-server/config/alfresco/templates/webscripts/org/alfresco/rma/classification/classifycontent.post.desc.xml +++ b/rm-server/config/alfresco/templates/webscripts/org/alfresco/rma/classification/classifycontent.post.desc.xml @@ -2,6 +2,8 @@ Classifies a content + Classification level id, classified by, classification reasons are mandatory fields.
+ Downgrade instructions becomes a mandotory field if a downgrade date and/or downgrade event is provided.

The body of the post should be in the form, e.g.
{
@@ -10,10 +12,32 @@ "classificationAgency": "anAgency",
"classificationReasons": [
{
- "id": "reason1Id"
+ "displayLabel": "reason1DisplayLabel",
+ "fullReason": "reason1Id: reason1DisplayLabel",
+ "id": "reason1Id",
+ "label": "reason1Id: reason1DisplayLabel",
+ "value": "reason1Id"
},
{
- "id": "reason2Id"
+ "displayLabel": "reason2DisplayLabel",
+ "fullReason": "reason2Id: reason2DisplayLabel",
+ "id": "reason2Id",
+ "label": "reason2Id: reason2DisplayLabel",
+ "value": "reason2Id"
+ }
+ ],
+ "downgradeDate": "YYYY-MM-DD",
+ "downgradeEvent": "aDowngradeEvent",
+ "downgradeInstructions": "aDowngradeInstruction",
+ "declassificationDate": "YYYY-MM-DD",
+ "declassificationEvent": "adeclassificationEvent",
+ "declassificationExemptions: [
+ {
+ "displayLabel": "anExemptionDisplayLabel",
+ "fullCategory": "anExemptionId: anExemptionDisplayLabel",
+ "id": "anExemptionId",
+ "label": "anExemptionId: anExemptionDisplayLabel",
+ "value": "anExemptionId"
}
]
}
diff --git a/rm-server/config/alfresco/templates/webscripts/org/alfresco/rma/classification/classifycontent.put.desc.xml b/rm-server/config/alfresco/templates/webscripts/org/alfresco/rma/classification/classifycontent.put.desc.xml index 926b679580..45af3f5ff5 100644 --- a/rm-server/config/alfresco/templates/webscripts/org/alfresco/rma/classification/classifycontent.put.desc.xml +++ b/rm-server/config/alfresco/templates/webscripts/org/alfresco/rma/classification/classifycontent.put.desc.xml @@ -2,6 +2,8 @@ Edits a classified content + Classification level id, classified by, classification reasons are mandatory fields.
+ Downgrade instructions becomes a mandotory field if a downgrade date and/or downgrade event is provided.

The body of the put should be in the form, e.g.
{
@@ -10,12 +12,36 @@ "classificationAgency": "anAgency",
"classificationReasons": [
{
- "id": "reason1Id"
+ "displayLabel": "reason1DisplayLabel",
+ "fullReason": "reason1Id: reason1DisplayLabel",
+ "id": "reason1Id",
+ "label": "reason1Id: reason1DisplayLabel",
+ "value": "reason1Id"
},
{
- "id": "reason2Id"
+ "displayLabel": "reason2DisplayLabel",
+ "fullReason": "reason2Id: reason2DisplayLabel",
+ "id": "reason2Id",
+ "label": "reason2Id: reason2DisplayLabel",
+ "value": "reason2Id"
}
- ]
+ ],
+ "downgradeDate": "YYYY-MM-DD",
+ "downgradeEvent": "aDowngradeEvent",
+ "downgradeInstructions": "aDowngradeInstruction",
+ "declassificationDate": "YYYY-MM-DD",
+ "declassificationEvent": "adeclassificationEvent",
+ "declassificationExemptions: [
+ {
+ "displayLabel": "anExemptionDisplayLabel",
+ "fullCategory": "anExemptionId: anExemptionDisplayLabel",
+ "id": "anExemptionId",
+ "label": "anExemptionId: anExemptionDisplayLabel",
+ "value": "anExemptionId"
+ }
+ ],
+ "lastReclassifyBy": "aUsername",
+ "lastReclassifyReason": "aReasonForReclassification"
}
]]>
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ClassifyContentBase.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ClassifyContentBase.java index 548c8ddcb5..7078853977 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ClassifyContentBase.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ClassifyContentBase.java @@ -22,6 +22,7 @@ import static org.alfresco.util.WebScriptUtils.getJSONArrayFromJSONObject; import static org.alfresco.util.WebScriptUtils.getJSONArrayValue; import static org.alfresco.util.WebScriptUtils.getRequestContentAsJsonObject; import static org.alfresco.util.WebScriptUtils.getStringValueFromJSONObject; +import static org.apache.commons.lang3.StringUtils.isNotBlank; import static org.apache.commons.lang3.time.DateFormatUtils.ISO_DATE_FORMAT; import static org.springframework.extensions.webscripts.Status.STATUS_BAD_REQUEST; @@ -111,10 +112,10 @@ public abstract class ClassifyContentBase extends AbstractRmWebScript String classifiedBy = getStringValueFromJSONObject(jsonObject, CLASSIFIED_BY); String classificationAgency = getStringValueFromJSONObject(jsonObject, CLASSIFICATION_AGENCY, false, false); Set classificationReasonIds = getClassificationReasonIds(jsonObject); - Object downgradeDate = jsonObject.isNull(DOWNGRADE_DATE) ? null : getStringValueFromJSONObject(jsonObject, DOWNGRADE_DATE, false, false); + String downgradeDate = getStringValueFromJSONObject(jsonObject, DOWNGRADE_DATE, false, false); String downgradeEvent = getStringValueFromJSONObject(jsonObject, DOWNGRADE_EVENT, false, false); String downgradeInstructions = getStringValueFromJSONObject(jsonObject, DOWNGRADE_INSTRUCTIONS, false, false); - Object declassificationDate = jsonObject.isNull(DECLASSIFICATION_DATE) ? null : getStringValueFromJSONObject(jsonObject, DECLASSIFICATION_DATE, false, false); + String declassificationDate = getStringValueFromJSONObject(jsonObject, DECLASSIFICATION_DATE, false, false); String declassificationEvent = getStringValueFromJSONObject(jsonObject, DECLASSIFICATION_EVENT, false, false); Set exemptionCategoryIds = getExemptionCategoryIds(jsonObject); String lastReclassifyBy = getStringValueFromJSONObject(jsonObject, LAST_RECLASSIFY_BY, false, false); @@ -200,15 +201,15 @@ public abstract class ClassifyContentBase extends AbstractRmWebScript * @param date The {@link Object} which will be parsed * @return The parsed date. If the given date is null then null will be returned. */ - private Date parseDate(Object date) + private Date parseDate(String date) { Date parsedDate = null; - if (date != null) + if (isNotBlank(date)) { try { - parsedDate = DateUtils.parseDate((String) date, ISO_DATE_FORMAT.getPattern()); + parsedDate = DateUtils.parseDate(date, ISO_DATE_FORMAT.getPattern()); } catch (ParseException error) { diff --git a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/legacy/webscript/ClassificationRestApiTest.java b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/legacy/webscript/ClassificationRestApiTest.java index 3154a7f8f1..dd5f00c673 100644 --- a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/legacy/webscript/ClassificationRestApiTest.java +++ b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/legacy/webscript/ClassificationRestApiTest.java @@ -18,18 +18,48 @@ */ package org.alfresco.module.org_alfresco_module_rm.test.legacy.webscript; +import static org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeService.Reclassification.DOWNGRADE; import static org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel.PROP_CLASSIFICATION_AGENCY; +import static org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel.PROP_CLASSIFICATION_REASONS; import static org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel.PROP_CLASSIFIED_BY; import static org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel.PROP_CURRENT_CLASSIFICATION; +import static org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel.PROP_DECLASSIFICATION_DATE; +import static org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel.PROP_DECLASSIFICATION_EVENT; +import static org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel.PROP_DECLASSIFICATION_EXEMPTIONS; +import static org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel.PROP_DOWNGRADE_DATE; +import static org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel.PROP_DOWNGRADE_EVENT; +import static org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel.PROP_DOWNGRADE_INSTRUCTIONS; +import static org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel.PROP_LAST_RECLASSIFICATION_ACTION; +import static org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel.PROP_LAST_RECLASSIFY_AT; +import static org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel.PROP_LAST_RECLASSIFY_BY; +import static org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel.PROP_LAST_RECLASSIFY_REASON; +import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentBase.CLASSIFICATION_AGENCY; +import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentBase.CLASSIFICATION_LEVEL_ID; +import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentBase.CLASSIFICATION_REASONS; +import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentBase.CLASSIFIED_BY; +import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentBase.DECLASSIFICATION_DATE; +import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentBase.DECLASSIFICATION_EVENT; +import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentBase.DECLASSIFICATION_EXEMPTIONS; +import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentBase.DOWNGRADE_DATE; +import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentBase.DOWNGRADE_EVENT; +import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentBase.DOWNGRADE_INSTRUCTIONS; +import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentBase.LAST_RECLASSIFY_BY; +import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentBase.LAST_RECLASSIFY_REASON; import static org.alfresco.util.GUID.generate; +import static org.apache.commons.lang3.time.DateFormatUtils.ISO_DATE_FORMAT; +import static org.apache.commons.lang3.time.DateUtils.parseDate; import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.text.ParseException; +import java.util.Date; 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.BaseRMWebScriptTestCase; +import org.alfresco.service.cmr.repository.InvalidNodeRefException; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.StoreRef; +import org.apache.tools.ant.util.DateUtils; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -55,10 +85,6 @@ public class ClassificationRestApiTest extends BaseRMWebScriptTestCase private static final String RESPONSE_SUCCESS = "success"; /** Constants for classification request body parameters */ - private static final String CLASSIFICATION_LEVEL_ID = "classificationLevelId"; - private static final String CLASSIFIED_BY = "classifiedBy"; - private static final String CLASSIFICATION_AGENCY = "classificationAgency"; - private static final String CLASSIFICATION_REASONS = "classificationReasons"; private static final String ID = "id"; private static final String CLASSIFICATION_LEVEL_ID1_VALUE = "level1"; private static final String CLASSIFICATION_LEVEL_ID2_VALUE = "level2"; @@ -69,10 +95,19 @@ public class ClassificationRestApiTest extends BaseRMWebScriptTestCase private static final String CLASSIFICATION_REASON_1_ID_VALUE = "Test Reason 1"; private static final String CLASSIFICATION_REASON_2_ID_VALUE = "Test Reason 1.2"; private static final String CLASSIFICATION_REASON_3_ID_VALUE = "Test Reason 1.2(c)"; + private static final String DOWNGRADE_DATE_VALUE = "2015-07-08"; + private static final String DOWNGRADE_EVENT_VALUE = generate(); + private static final String DOWNGRADE_INSTRUCTIONS_VALUE = generate(); + private static final String DECLASSIFICATION_DATE_VALUE = "2015-12-01"; + private static final String DECLASSIFICATION_EVENT_VALUE = generate(); + private static final String DECLASSIFICATION_EXEMPTION_1_ID_VALUE = "Test Category 1"; + private static final String DECLASSIFICATION_EXEMPTION_2_ID_VALUE = "Test Category 2"; + private static final String LAST_RECLASSIFY_BY_VALUE = generate(); + private static final String LAST_RECLASSIFY_REASON_VALUE = generate(); /** Tests classifying a content and editing a classified content */ @SuppressWarnings("unchecked") - public void testClassifyEditContent() throws IOException, JSONException + public void testClassifyEditContent() throws IOException, JSONException, InvalidNodeRefException, ParseException { // Create record to classify NodeRef recordCategory = filePlanService.createRecordCategory(filePlan, generate()); @@ -95,6 +130,12 @@ public class ClassificationRestApiTest extends BaseRMWebScriptTestCase classificationReasons.put(new JSONObject().put(ID, CLASSIFICATION_REASON_1_ID_VALUE)); classificationReasons.put(new JSONObject().put(ID, CLASSIFICATION_REASON_2_ID_VALUE)); requestBody.put(CLASSIFICATION_REASONS, classificationReasons); + requestBody.put(DECLASSIFICATION_DATE, DECLASSIFICATION_DATE_VALUE); + requestBody.put(DECLASSIFICATION_EVENT, DECLASSIFICATION_EVENT_VALUE); + JSONArray declassificationExemptions = new JSONArray(); + declassificationExemptions.put(new JSONObject().put(ID, DECLASSIFICATION_EXEMPTION_1_ID_VALUE)); + declassificationExemptions.put(new JSONObject().put(ID, DECLASSIFICATION_EXEMPTION_2_ID_VALUE)); + requestBody.put(DECLASSIFICATION_EXEMPTIONS, declassificationExemptions); Response response = sendRequest(new PostRequest(url, requestBody.toString(), APPLICATION_JSON), 200); String responseContent = response.getContentAsString(); JSONObject responseAsJson = new JSONObject(responseContent); @@ -104,11 +145,18 @@ public class ClassificationRestApiTest extends BaseRMWebScriptTestCase assertEquals(CLASSIFICATION_LEVEL_ID1_VALUE, nodeService.getProperty(record, PROP_CURRENT_CLASSIFICATION)); assertEquals(CLASSIFIED_BY1, nodeService.getProperty(record, PROP_CLASSIFIED_BY)); assertEquals(CLASSIFICATION_AGENCY1, nodeService.getProperty(record, PROP_CLASSIFICATION_AGENCY)); - List classificationReasonsList = (List) nodeService.getProperty(record, ClassifiedContentModel.PROP_CLASSIFICATION_REASONS); + List classificationReasonsList = (List) nodeService.getProperty(record, PROP_CLASSIFICATION_REASONS); assertNotNull(classificationReasonsList); assertEquals(2, classificationReasonsList.size()); assertTrue(classificationReasonsList.contains(CLASSIFICATION_REASON_1_ID_VALUE)); assertTrue(classificationReasonsList.contains(CLASSIFICATION_REASON_2_ID_VALUE)); + assertEquals(parseDate(DECLASSIFICATION_DATE_VALUE, ISO_DATE_FORMAT.getPattern()), nodeService.getProperty(record, PROP_DECLASSIFICATION_DATE)); + assertEquals(DECLASSIFICATION_EVENT_VALUE, nodeService.getProperty(record, PROP_DECLASSIFICATION_EVENT)); + List declassificationExemptionsList = (List) nodeService.getProperty(record, PROP_DECLASSIFICATION_EXEMPTIONS); + assertNotNull(declassificationExemptionsList); + assertEquals(2, declassificationExemptionsList.size()); + assertTrue(declassificationExemptionsList.contains(DECLASSIFICATION_EXEMPTION_1_ID_VALUE)); + assertTrue(declassificationExemptionsList.contains(DECLASSIFICATION_EXEMPTION_2_ID_VALUE)); // Edit classified content requestBody = new JSONObject(); @@ -118,6 +166,8 @@ public class ClassificationRestApiTest extends BaseRMWebScriptTestCase classificationReasons = new JSONArray(); classificationReasons.put(new JSONObject().put(ID, CLASSIFICATION_REASON_3_ID_VALUE)); requestBody.put(CLASSIFICATION_REASONS, classificationReasons); + requestBody.put(LAST_RECLASSIFY_BY, LAST_RECLASSIFY_BY_VALUE); + requestBody.put(LAST_RECLASSIFY_REASON, LAST_RECLASSIFY_REASON_VALUE); response = sendRequest(new PutRequest(url, requestBody.toString(), APPLICATION_JSON), 200); responseContent = response.getContentAsString(); responseAsJson = new JSONObject(responseContent); @@ -127,9 +177,70 @@ public class ClassificationRestApiTest extends BaseRMWebScriptTestCase assertEquals(CLASSIFICATION_LEVEL_ID2_VALUE, nodeService.getProperty(record, PROP_CURRENT_CLASSIFICATION)); assertEquals(CLASSIFIED_BY2, nodeService.getProperty(record, PROP_CLASSIFIED_BY)); assertEquals(CLASSIFICATION_AGENCY2, nodeService.getProperty(record, PROP_CLASSIFICATION_AGENCY)); - List editedClassificationReasonsList = (List) nodeService.getProperty(record, ClassifiedContentModel.PROP_CLASSIFICATION_REASONS); + List editedClassificationReasonsList = (List) nodeService.getProperty(record, PROP_CLASSIFICATION_REASONS); assertNotNull(editedClassificationReasonsList); assertEquals(1, editedClassificationReasonsList.size()); assertTrue(editedClassificationReasonsList.contains(CLASSIFICATION_REASON_3_ID_VALUE)); + assertEquals(DOWNGRADE.toModelString(), nodeService.getProperty(record, PROP_LAST_RECLASSIFICATION_ACTION)); + String date1 = DateUtils.format(new Date(), ISO_DATE_FORMAT.getPattern()); + String date2 = DateUtils.format((Date) nodeService.getProperty(record, PROP_LAST_RECLASSIFY_AT), ISO_DATE_FORMAT.getPattern()); + assertEquals(date1, date2); + assertEquals(LAST_RECLASSIFY_BY_VALUE, nodeService.getProperty(record, PROP_LAST_RECLASSIFY_BY)); + assertEquals(LAST_RECLASSIFY_REASON_VALUE, nodeService.getProperty(record, PROP_LAST_RECLASSIFY_REASON)); + } + + /** Test downgrade schedule */ + public void testDowngradeSchedule() throws JSONException, UnsupportedEncodingException, IOException, InvalidNodeRefException, ParseException + { + // Create record to classify + NodeRef recordCategory = filePlanService.createRecordCategory(filePlan, generate()); + NodeRef recordFolder = recordFolderService.createRecordFolder(recordCategory, generate()); + NodeRef record = utils.createRecord(recordFolder, generate()); + + // Format the URL + StoreRef storeRef = record.getStoreRef(); + String storeProtocol = storeRef.getProtocol(); + String storeId = storeRef.getIdentifier(); + String id = record.getId(); + String url = String.format(RM_CLASSIFY_ACTIONS_URL, storeProtocol, storeId, id); + + // Classify content + JSONObject requestBody = new JSONObject(); + requestBody.put(CLASSIFICATION_LEVEL_ID, CLASSIFICATION_LEVEL_ID1_VALUE); + requestBody.put(CLASSIFIED_BY, CLASSIFIED_BY1); + requestBody.put(CLASSIFICATION_AGENCY, CLASSIFICATION_AGENCY1); + JSONArray classificationReasons = new JSONArray(); + classificationReasons.put(new JSONObject().put(ID, CLASSIFICATION_REASON_1_ID_VALUE)); + classificationReasons.put(new JSONObject().put(ID, CLASSIFICATION_REASON_2_ID_VALUE)); + requestBody.put(CLASSIFICATION_REASONS, classificationReasons); + + // Set just a downgrade date + requestBody.put(DOWNGRADE_DATE, DOWNGRADE_DATE_VALUE); + // An exception is expected + sendRequest(new PostRequest(url, requestBody.toString(), APPLICATION_JSON), 500); + + // Set just a downgrade event + requestBody.remove(DOWNGRADE_DATE); + requestBody.put(DOWNGRADE_EVENT, DOWNGRADE_EVENT_VALUE); + // An exception is expected + sendRequest(new PostRequest(url, requestBody.toString(), APPLICATION_JSON), 500); + + // Set a downgrade date and downgrade event + requestBody.put(DOWNGRADE_DATE, DOWNGRADE_DATE_VALUE); + // An exception is expected + sendRequest(new PostRequest(url, requestBody.toString(), APPLICATION_JSON), 500); + + // Set a downgrade instructions + requestBody.put(DOWNGRADE_INSTRUCTIONS, DOWNGRADE_INSTRUCTIONS_VALUE); + Response response = sendRequest(new PostRequest(url, requestBody.toString(), APPLICATION_JSON), 200); + + String responseContent = response.getContentAsString(); + JSONObject responseAsJson = new JSONObject(responseContent); + + assertNotNull(responseAsJson); + assertTrue(responseAsJson.getBoolean(RESPONSE_SUCCESS)); + assertEquals(parseDate(DOWNGRADE_DATE_VALUE, ISO_DATE_FORMAT.getPattern()), nodeService.getProperty(record, PROP_DOWNGRADE_DATE)); + assertEquals(DOWNGRADE_EVENT_VALUE, nodeService.getProperty(record, PROP_DOWNGRADE_EVENT)); + assertEquals(DOWNGRADE_INSTRUCTIONS_VALUE, nodeService.getProperty(record, PROP_DOWNGRADE_INSTRUCTIONS)); } } diff --git a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ClassifyContentPostUnitTest.java b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ClassifyContentPostUnitTest.java index 3d1d5ef17e..d6c3c5ec6b 100644 --- a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ClassifyContentPostUnitTest.java +++ b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ClassifyContentPostUnitTest.java @@ -18,10 +18,10 @@ */ package org.alfresco.module.org_alfresco_module_rm.script.classification; -import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentPost.CLASSIFICATION_AGENCY; -import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentPost.CLASSIFICATION_LEVEL_ID; -import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentPost.CLASSIFICATION_REASONS; -import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentPost.CLASSIFIED_BY; +import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentBase.CLASSIFICATION_AGENCY; +import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentBase.CLASSIFICATION_LEVEL_ID; +import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentBase.CLASSIFICATION_REASONS; +import static org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentBase.CLASSIFIED_BY; import static org.alfresco.util.WebScriptUtils.getStringValueFromJSONObject; import static org.alfresco.util.WebScriptUtils.is4xxError; import static org.alfresco.util.WebScriptUtils.putValuetoJSONObject; @@ -34,7 +34,6 @@ import static org.mockito.Mockito.verify; import java.util.Map; -import com.google.common.collect.Sets; import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationAspectProperties; import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationLevelManager; import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationReasonManager; @@ -51,6 +50,8 @@ import org.mockito.Spy; import org.springframework.extensions.webscripts.DeclarativeWebScript; import org.springframework.extensions.webscripts.WebScriptException; +import com.google.common.collect.Sets; + /** * Classify content REST API POST implementation unit test. * @@ -134,7 +135,8 @@ public class ClassifyContentPostUnitTest extends BaseWebScriptUnitTest assertEquals(Sets.newHashSet(REASON1_ID, REASON2_ID), propertiesDTO.getClassificationReasonIds()); } - @Test public void classifyingWithBlankClassifiedByShouldReturn4xxResponse() throws Exception + @Test + public void classifyingWithBlankClassifiedByShouldReturn4xxResponse() throws Exception { // Setup web script parameters Map parameters = buildParameters