### Question:
CollectionAuditAOImpl extends AbstractAuditAOImpl implements CollectionAuditAO { @Override public List<AuditedAction> findAllAuditRecordsForCollection(final IRODSFile irodsFile, final int partialStart, final int numberOfResultsDesired) throws FileNotFoundException, JargonException { log.info("findAllAuditRecordsForCollection()"); return super.findAllAuditRecordsForFile(irodsFile, partialStart, numberOfResultsDesired); } protected  CollectionAuditAOImpl(final IRODSSession irodsSession, final IRODSAccount irodsAccount); @Override List<AuditedAction> findAllAuditRecordsForCollection(final IRODSFile irodsFile, final int partialStart,
			final int numberOfResultsDesired); @Override AuditedAction getAuditedActionForCollection(final IRODSFile irodsFile, final String auditActionCode,
			final String timeStampInIRODSFormat); static final Logger log; static final char COMMA; }### Answer:
@Test public final void testFindAllAuditRecordsForCollection() throws Exception { if (!testingPropertiesHelper.isTestAudit(testingProperties)) { return; } String testFileName = System.currentTimeMillis() + "testFindAllAuditRecordsForCollection"; String targetIrodsFile = testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties( testingProperties, IRODS_TEST_SUBDIR_PATH + '/' + testFileName); IRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties); IRODSAccessObjectFactory accessObjectFactory = irodsFileSystem.getIRODSAccessObjectFactory(); IRODSFileFactory irodsFileFactory = accessObjectFactory.getIRODSFileFactory(irodsAccount); IRODSFile destFile = irodsFileFactory.instanceIRODSFile(targetIrodsFile); destFile.mkdirs(); IRODSAccount secondaryAccount = testingPropertiesHelper .buildIRODSAccountFromSecondaryTestProperties(testingProperties); CollectionAO collectionAO = accessObjectFactory.getCollectionAO(irodsAccount); collectionAO.setAccessPermissionRead(irodsAccount.getZone(), destFile.getAbsolutePath(), secondaryAccount.getUserName(), true); CollectionAuditAO collectionAuditAO = accessObjectFactory.getCollectionAuditAO(irodsAccount); List<AuditedAction> auditData = collectionAuditAO.findAllAuditRecordsForCollection(destFile, 0, 1000); Assert.assertFalse("empty audit data", auditData.isEmpty()); AuditedAction action = auditData.get(0); Assert.assertEquals("did not set data name", destFile.getAbsolutePath(), action.getDomainObjectUniqueName()); Assert.assertNotNull("did not set audit enum", action.getAuditActionEnum()); }
@Test(expected = FileNotFoundException.class) public final void testFindAllAuditRecordsForCollectionNotExists() throws Exception { if (!testingPropertiesHelper.isTestAudit(testingProperties)) { throw new FileNotFoundException("expected"); } String testFileName = System.currentTimeMillis() + "testFindAllAuditRecordsForCollectionNotExists"; String targetIrodsFile = testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties( testingProperties, IRODS_TEST_SUBDIR_PATH + '/' + testFileName); IRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties); IRODSAccessObjectFactory accessObjectFactory = irodsFileSystem.getIRODSAccessObjectFactory(); IRODSFileFactory irodsFileFactory = accessObjectFactory.getIRODSFileFactory(irodsAccount); IRODSFile destFile = irodsFileFactory.instanceIRODSFile(targetIrodsFile); CollectionAuditAO collectionAuditAO = accessObjectFactory.getCollectionAuditAO(irodsAccount); collectionAuditAO.findAllAuditRecordsForCollection(destFile, 0, 1000); }