NodeChange implements

        BeforeDeleteNodePolicy, OnAddAspectPolicy, OnCreateNodePolicy, OnMoveNodePolicy,
        OnRemoveAspectPolicy, OnUpdatePropertiesPolicy,

        OnContentReadPolicy, OnContentUpdatePolicy,

        OnCreateVersionPolicy,

        OnCopyCompletePolicy,
        
        OnCheckOut, OnCheckIn, OnCancelCheckOut { @Override public void onRemoveAspect(NodeRef nodeRef, QName aspect) { deleteAspect(aspect); appendSubAction(new NodeChange(nodeInfoFactory, namespaceService, nodeRef). setAction(DELETE_NODE_ASPECT). deleteAspect(aspect)); } NodeChange(NodeInfoFactory nodeInfoFactory, NamespaceService namespaceService, NodeRef nodeRef); String getDerivedAction(); boolean isTemporaryNode(); NodeChange setAuditSubActions(boolean auditSubActions); @Override void beforeDeleteNode(NodeRef nodeRef); @Override void onCreateNode(ChildAssociationRef childAssocRef); @Override void onMoveNode(ChildAssociationRef fromChildAssocRef, ChildAssociationRef toChildAssocRef); @Override void onUpdateProperties(NodeRef nodeRef,
            Map<QName, Serializable> fromProperties, Map<QName, Serializable> toProperties); @Override void onRemoveAspect(NodeRef nodeRef, QName aspect); @Override void onAddAspect(NodeRef nodeRef, QName aspect); @Override void onContentUpdate(NodeRef nodeRef, boolean newContent); @Override void onContentRead(NodeRef nodeRef); @Override void onCreateVersion(QName classRef, NodeRef nodeRef,
            Map<String, Serializable> versionProperties, PolicyScope nodeDetails); void onCopyComplete(QName classRef, NodeRef sourceNodeRef, NodeRef targetNodeRef,
            boolean copyToNewNode, Map<NodeRef, NodeRef> copyMap); void onCheckOut(NodeRef workingCopy); void onCheckIn(NodeRef nodeRef); void onCancelCheckOut(NodeRef nodeRef); Map<String, Serializable> getAuditData(boolean subAction); static final String SUB_ACTION; static Collection<String> SUMMARY_KEYS; static final String SUB_ACTION_PREFIX; }
@Test public final void testOnRemoveAspect() { nodeChange.onRemoveAspect(content1, ContentModel.ASPECT_ARCHIVED); nodeChange.onAddAspect(content1, ContentModel.ASPECT_COPIEDFROM); nodeChange.onRemoveAspect(content1, ContentModel.ASPECT_COPIEDFROM); nodeChange.onRemoveAspect(content1, ContentModel.ASPECT_EMAILED); nodeChange.onAddAspect(content1, ContentModel.ASPECT_EMAILED); nodeChange.onRemoveAspect(content1, ContentModel.ASPECT_EMAILED); nodeChange.onRemoveAspect(content1, ContentModel.ASPECT_GEOGRAPHIC); nodeChange.onRemoveAspect(content1, ContentModel.ASPECT_GEOGRAPHIC); Map<String, Serializable> auditMap = nodeChange.getAuditData(false); assertStandardData(auditMap, "deleteNodeAspect", "deleteNodeAspect addNodeAspect"); assertEquals(3, ((Set<?>)auditMap.get("aspects/delete")).size()); assertTrue("Grouped cm:archived aspect missing", ((Set<?>)auditMap.get("aspects/delete")).contains(ContentModel.ASPECT_ARCHIVED)); assertTrue("Grouped cm:emailed aspect missing", ((Set<?>)auditMap.get("aspects/delete")).contains(ContentModel.ASPECT_EMAILED)); assertTrue("Grouped cm:geographic aspect missing", ((Set<?>)auditMap.get("aspects/delete")).contains(ContentModel.ASPECT_GEOGRAPHIC)); assertTrue("Individual cm:archived aspect missing", auditMap.containsKey("aspects/delete/cm:archived")); assertTrue("Individual cm:emailed aspect missing", auditMap.containsKey("aspects/delete/cm:emailed")); assertTrue("Individual cm:geographic aspect missing", auditMap.containsKey("aspects/delete/cm:geographic")); }