RM-2477 Treat the empty string in the same way as null.

Fix an issue in the behaviour checking where the empty string was being
passed as the instructions when nothing was set.

+review RM

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@109843 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tom Page
2015-08-10 10:24:57 +00:00
parent 055eabac78
commit 43ea2e5bc4
2 changed files with 26 additions and 1 deletions

View File

@@ -98,4 +98,16 @@ public class ClassifiedAspectUnitTest implements ClassifiedContentModel
classifiedAspect.checkConsistencyOfProperties(NODE_REF);
}
/** Check that blank instructions are treated in the same way as null instructions. */
@Test(expected = MissingDowngradeInstructions.class)
public void testCheckConsistencyOfProperties_emptyStringsSupplied()
{
when(mockNodeService.hasAspect(NODE_REF, ASPECT_CLASSIFIED)).thenReturn(true);
when(mockNodeService.getProperty(NODE_REF, PROP_DOWNGRADE_DATE)).thenReturn("");
when(mockNodeService.getProperty(NODE_REF, PROP_DOWNGRADE_EVENT)).thenReturn("Event");
when(mockNodeService.getProperty(NODE_REF, PROP_DOWNGRADE_INSTRUCTIONS)).thenReturn("");
classifiedAspect.checkConsistencyOfProperties(NODE_REF);
}
}