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
This commit is contained in:
Tuna Aksoy
2015-08-06 22:10:14 +00:00
parent 0da87474c5
commit 0a52f24c6a
5 changed files with 188 additions and 24 deletions

View File

@@ -2,6 +2,8 @@
<shortname>Classifies a content</shortname>
<description><![CDATA[
Classifies the specified content.<br/>
Classification level id, classified by, classification reasons are mandatory fields.<br/>
Downgrade instructions becomes a mandotory field if a downgrade date and/or downgrade event is provided.<br/>
<br/>
The body of the post should be in the form, e.g.<br/>
{<br/>
@@ -10,10 +12,32 @@
"classificationAgency": "anAgency",<br/>
"classificationReasons": [<br/>
{<br/>
"id": "reason1Id"<br/>
"displayLabel": "reason1DisplayLabel",<br/>
"fullReason": "reason1Id: reason1DisplayLabel",<br/>
"id": "reason1Id",<br/>
"label": "reason1Id: reason1DisplayLabel",<br/>
"value": "reason1Id"<br/>
},<br/>
{<br/>
"id": "reason2Id"<br/>
"displayLabel": "reason2DisplayLabel",<br/>
"fullReason": "reason2Id: reason2DisplayLabel",<br/>
"id": "reason2Id",<br/>
"label": "reason2Id: reason2DisplayLabel",<br/>
"value": "reason2Id"<br/>
}<br/>
],<br/>
"downgradeDate": "YYYY-MM-DD",<br/>
"downgradeEvent": "aDowngradeEvent",<br/>
"downgradeInstructions": "aDowngradeInstruction",<br/>
"declassificationDate": "YYYY-MM-DD",<br/>
"declassificationEvent": "adeclassificationEvent",<br/>
"declassificationExemptions: [<br/>
{<br/>
"displayLabel": "anExemptionDisplayLabel",<br/>
"fullCategory": "anExemptionId: anExemptionDisplayLabel",<br/>
"id": "anExemptionId",<br/>
"label": "anExemptionId: anExemptionDisplayLabel",<br/>
"value": "anExemptionId"<br/>
}<br/>
]<br/>
}<br/>

View File

@@ -2,6 +2,8 @@
<shortname>Edits a classified content</shortname>
<description><![CDATA[
Edits the classified content.<br/>
Classification level id, classified by, classification reasons are mandatory fields.<br/>
Downgrade instructions becomes a mandotory field if a downgrade date and/or downgrade event is provided.<br/>
<br/>
The body of the put should be in the form, e.g.<br/>
{<br/>
@@ -10,12 +12,36 @@
"classificationAgency": "anAgency",<br/>
"classificationReasons": [<br/>
{<br/>
"id": "reason1Id"<br/>
"displayLabel": "reason1DisplayLabel",<br/>
"fullReason": "reason1Id: reason1DisplayLabel",<br/>
"id": "reason1Id",<br/>
"label": "reason1Id: reason1DisplayLabel",<br/>
"value": "reason1Id"<br/>
},<br/>
{<br/>
"id": "reason2Id"<br/>
"displayLabel": "reason2DisplayLabel",<br/>
"fullReason": "reason2Id: reason2DisplayLabel",<br/>
"id": "reason2Id",<br/>
"label": "reason2Id: reason2DisplayLabel",<br/>
"value": "reason2Id"<br/>
}<br/>
]<br/>
],<br/>
"downgradeDate": "YYYY-MM-DD",<br/>
"downgradeEvent": "aDowngradeEvent",<br/>
"downgradeInstructions": "aDowngradeInstruction",<br/>
"declassificationDate": "YYYY-MM-DD",<br/>
"declassificationEvent": "adeclassificationEvent",<br/>
"declassificationExemptions: [<br/>
{<br/>
"displayLabel": "anExemptionDisplayLabel",<br/>
"fullCategory": "anExemptionId: anExemptionDisplayLabel",<br/>
"id": "anExemptionId",<br/>
"label": "anExemptionId: anExemptionDisplayLabel",<br/>
"value": "anExemptionId"<br/>
}<br/>
],<br/>
"lastReclassifyBy": "aUsername",<br/>
"lastReclassifyReason": "aReasonForReclassification"<br/>
}<br/>
]]>
</description>

View File

@@ -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<String> 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<String> 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 <code>null</code> then <code>null</code> 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)
{

View File

@@ -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<String> classificationReasonsList = (List<String>) nodeService.getProperty(record, ClassifiedContentModel.PROP_CLASSIFICATION_REASONS);
List<String> classificationReasonsList = (List<String>) 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<String> declassificationExemptionsList = (List<String>) 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<String> editedClassificationReasonsList = (List<String>) nodeService.getProperty(record, ClassifiedContentModel.PROP_CLASSIFICATION_REASONS);
List<String> editedClassificationReasonsList = (List<String>) 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));
}
}

View File

@@ -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<String, String> parameters = buildParameters