mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fix for RM-2549. The copyAspect implementation needs to be very careful to use addProperties not setPropertiesand it also needs to not copy inherited properties.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@110844 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -27,6 +27,8 @@ import static org.mockito.Mockito.mock;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.test.util.ExceptionUtils.expectedException;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
import org.alfresco.service.cmr.dictionary.AspectDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryException;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
@@ -97,9 +99,15 @@ public class CoreServicesExtrasUnitTest
|
||||
final NodeService mockNS = mock(NodeService.class);
|
||||
|
||||
final AspectDefinition mockAspect = mock(AspectDefinition.class);
|
||||
when(mockAspect.getName()).thenReturn(testAspect);
|
||||
|
||||
final Map<QName, PropertyDefinition> props = new HashMap<>();
|
||||
final PropertyDefinition mockProp1 = mock(PropertyDefinition.class);
|
||||
final PropertyDefinition mockProp2 = mock(PropertyDefinition.class);
|
||||
for (PropertyDefinition p : asList(mockProp1, mockProp2))
|
||||
{
|
||||
when(p.getContainerClass()).thenReturn(mockAspect);
|
||||
}
|
||||
props.put(testProp1, mockProp1);
|
||||
props.put(testProp2, mockProp2);
|
||||
when(mockAspect.getProperties()).thenReturn(props);
|
||||
|
Reference in New Issue
Block a user