RM-2045 Check that content is not re-classified.

Currently this is not supported, although it will be needed in the future.

Also take the opportunity to change the unit tests to use:
    when(x.y()).thenReturn(z));
rather than:
    doReturn(z).when(x).y();
This is because I noticed the javadoc for "doReturn" gives a good
explanation of when to use each (use the former whenever possible for
readability; use the latter if there's no choice).

+review RM-25

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102231 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tom Page
2015-04-21 08:06:31 +00:00
parent b269570cbb
commit 07fc43cf29
2 changed files with 25 additions and 6 deletions

View File

@@ -230,6 +230,11 @@ public class ClassificationServiceImpl extends ServiceBaseImpl
{
throw new InvalidNode(content, "The supplied node is not a content node.");
}
if (nodeService.hasAspect(content, ASPECT_CLASSIFIED))
{
throw new UnsupportedOperationException(
"The content has already been classified. Reclassification is currently not supported.");
}
Map<QName, Serializable> properties = new HashMap<QName, Serializable>();
checkClassificationLevelId(classificationLevelId);