mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Additional checkin related to RM-2291. Change the unit test so that it validates only the levels configured by the user (in .json file) and excludes the built-in special case of Unclassified.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@106141 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
package org.alfresco.module.org_alfresco_module_rm.classification;
|
package org.alfresco.module.org_alfresco_module_rm.classification;
|
||||||
|
|
||||||
import static java.util.Arrays.asList;
|
import static java.util.Arrays.asList;
|
||||||
|
import static org.apache.commons.collections.ListUtils.union;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.mockito.Matchers.any;
|
import static org.mockito.Matchers.any;
|
||||||
@@ -57,10 +58,13 @@ import org.mockito.MockitoAnnotations;
|
|||||||
*/
|
*/
|
||||||
public class ClassificationServiceBootstrapUnitTest
|
public class ClassificationServiceBootstrapUnitTest
|
||||||
{
|
{
|
||||||
private static final List<ClassificationLevel> DEFAULT_CLASSIFICATION_LEVELS = asLevelList("TS", "rm.classification.topSecret",
|
private static final List<ClassificationLevel> DEFAULT_CONFIGURED_CLASSIFICATION_LEVELS =
|
||||||
"S", "rm.classification.secret",
|
asLevelList("TS", "rm.classification.topSecret",
|
||||||
"C", "rm.classification.confidential",
|
"S", "rm.classification.secret",
|
||||||
"U", "rm.classification.unclassified");
|
"C", "rm.classification.confidential");
|
||||||
|
private static final List<ClassificationLevel> DEFAULT_CLASSIFICATION_LEVELS =
|
||||||
|
union(DEFAULT_CONFIGURED_CLASSIFICATION_LEVELS,
|
||||||
|
asLevelList("U", "rm.classification.unclassified"));
|
||||||
private static final List<ClassificationLevel> ALT_CLASSIFICATION_LEVELS = asLevelList("B", "Board",
|
private static final List<ClassificationLevel> ALT_CLASSIFICATION_LEVELS = asLevelList("B", "Board",
|
||||||
"EM", "ExecutiveManagement",
|
"EM", "ExecutiveManagement",
|
||||||
"E", "Employee",
|
"E", "Employee",
|
||||||
@@ -115,12 +119,12 @@ public class ClassificationServiceBootstrapUnitTest
|
|||||||
|
|
||||||
@Test public void defaultLevelsConfigurationVanillaSystem()
|
@Test public void defaultLevelsConfigurationVanillaSystem()
|
||||||
{
|
{
|
||||||
when(mockClassificationServiceDAO.getConfiguredLevels()).thenReturn(DEFAULT_CLASSIFICATION_LEVELS);
|
when(mockClassificationServiceDAO.getConfiguredLevels()).thenReturn(DEFAULT_CONFIGURED_CLASSIFICATION_LEVELS);
|
||||||
when(mockAttributeService.getAttribute(anyString(), anyString(), anyString())).thenReturn(null);
|
when(mockAttributeService.getAttribute(anyString(), anyString(), anyString())).thenReturn(null);
|
||||||
|
|
||||||
classificationServiceBootstrap.initConfiguredClassificationLevels();
|
classificationServiceBootstrap.initConfiguredClassificationLevels();
|
||||||
|
|
||||||
verify(mockAttributeService).setAttribute(eq((Serializable) DEFAULT_CLASSIFICATION_LEVELS),
|
verify(mockAttributeService).setAttribute(eq((Serializable) DEFAULT_CONFIGURED_CLASSIFICATION_LEVELS),
|
||||||
anyString(), anyString(), anyString());
|
anyString(), anyString(), anyString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user