@Test
public final void testOnCheckIn() throws Exception
{

    Map<String, Serializable> checkinProperties = new HashMap<String, Serializable>();
    checkinProperties.put(Version.PROP_DESCRIPTION, null);
    checkinProperties.put(VersionModel.PROP_VERSION_TYPE, VersionType.MAJOR);
    serviceRegistry.getCheckOutCheckInService().checkin(workingCopyNodeRef, checkinProperties);
    
    txn.commit();
    txn = null;
    assertEquals(2, auditMapList.size());
    boolean origIn0 = ((String)auditMapList.get(0).get("path")).endsWith("cm:content1");
    Map<String, Serializable> origMap = auditMapList.get(origIn0 ? 0 : 1);
    Map<String, Serializable> workMap = auditMapList.get(origIn0 ? 1 : 0);
    // working copy
    assertEquals("DELETE", workMap.get("action"));
    assertContains("deleteNode", workMap.get("sub-actions"));
    assertTrue("Expected working copy", ((String)workMap.get("path")).endsWith("(Working Copy)") &&
                                        ((String)workMap.get("path")).startsWith("/cm:homeFolder/cm:folder1/"));
    assertEquals("cm:content", workMap.get("type"));
    // original file
    assertEquals("CHECK IN", origMap.get("action"));
    assertContains("deleteNodeAspect", origMap.get("sub-actions"));     
    assertContains("addNodeAspect", origMap.get("sub-actions"));
    assertContains("copyNode", origMap.get("sub-actions"));
    assertContains("createVersion", origMap.get("sub-actions"));
    assertContains("updateNodeProperties", origMap.get("sub-actions"));
    assertContains("checkIn", origMap.get("sub-actions"));
    assertEquals("/cm:homeFolder/cm:folder1/cm:content1", origMap.get("path"));
    assertEquals("cm:content", origMap.get("type"));
}