NodeChange implements

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

        OnContentReadPolicy, OnContentUpdatePolicy,

        OnCreateVersionPolicy,

        OnCopyCompletePolicy,
        
        OnCheckOut, OnCheckIn, OnCancelCheckOut { @Override public void onCreateVersion(QName classRef, NodeRef nodeRef, Map<String, Serializable> versionProperties, PolicyScope nodeDetails) { setVersionProperties((HashMap<String, Serializable>)versionProperties); appendSubAction(new NodeChange(nodeInfoFactory, namespaceService, nodeRef). setAction(CREATE_VERSION). setVersionProperties((HashMap<String, Serializable>)versionProperties)); } 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 testOnCreateVersion() { Map<String, Serializable> versionProperties = new HashMap<String, Serializable>(); versionProperties.put(Version.PROP_DESCRIPTION, "This is a test"); nodeChange.onCreateVersion(null, content1, versionProperties, null); Map<String, Serializable> auditMap = nodeChange.getAuditData(false); assertStandardData(auditMap, "CREATE VERSION", "createVersion"); assertEquals(1, ((Map<?,?>)auditMap.get("version-properties")).size()); assertEquals("Grouped description version-properties missing", "This is a test", ((Map<?,?>)auditMap.get("version-properties")).get(Version.PROP_DESCRIPTION)); assertEquals("Individual description version-properties missing", "This is a test", auditMap.get("version-properties/description")); }