Implementation of RM-2614 +review RM

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/DEV/caveatmarkdatatype@114954 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Neil McErlean
2015-10-22 13:35:46 +00:00
parent 131eef36b1
commit 5cade63f9d
12 changed files with 151 additions and 5 deletions

View File

@@ -21,11 +21,16 @@ package org.alfresco.module.org_alfresco_module_rm.caveat.dao;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.Map;
import org.alfresco.module.org_alfresco_module_rm.caveat.CaveatException.MalformedConfiguration;
import org.alfresco.module.org_alfresco_module_rm.caveat.scheme.CaveatGroup;
import org.alfresco.service.namespace.NamespaceService;
import org.junit.Before;
import org.junit.Test;
/**
@@ -39,6 +44,14 @@ public class CaveatDAOFromJSONUnitTest
/** The class under test. */
CaveatDAOFromJSON caveatDAOFromJSON = new CaveatDAOFromJSON();
@Before public void initClassUnderTest()
{
NamespaceService namespaceService = mock(NamespaceService.class);
when(namespaceService.getNamespaceURI(anyString())).thenReturn("{mockedNamespace}");
caveatDAOFromJSON.setNamespaceService(namespaceService);
}
/** Test that loading the default caveat configuration file doesn't throw any exceptions. */
@Test
public void testGetCaveatGroups_defaultConfiguration()