Additional work for RM-2614. Validation that the configured model property name is either null or a valid QName for a property recognised by the dictionary.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/DEV/caveatmarkdatatype@114957 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Neil McErlean
2015-10-22 14:20:44 +00:00
parent 08221fc1b6
commit fc2bb65c67
3 changed files with 46 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ 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.Matchers.any;
import static org.mockito.Mockito.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -29,7 +30,10 @@ 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.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.junit.Before;
import org.junit.Test;
@@ -49,6 +53,11 @@ public class CaveatDAOFromJSONUnitTest
NamespaceService namespaceService = mock(NamespaceService.class);
when(namespaceService.getNamespaceURI(anyString())).thenReturn("{mockedNamespace}");
DictionaryService dictionaryService = mock(DictionaryService.class);
PropertyDefinition mockProperty = mock(PropertyDefinition.class);
when(dictionaryService.getProperty(any(QName.class))).thenReturn(mockProperty);
caveatDAOFromJSON.setDictionaryService(dictionaryService);
caveatDAOFromJSON.setNamespaceService(namespaceService);
}