### Question:
DataObjectAuditAOImpl extends AbstractAuditAOImpl implements DataObjectAuditAO { @Override public List<AuditedAction> findAllAuditRecordsForDataObject(final IRODSFile irodsFile, final int partialStart, final int numberOfResultsDesired) throws FileNotFoundException, JargonException { log.info("findAllAuditRecordsForDataObject()"); return super.findAllAuditRecordsForFile(irodsFile, partialStart, numberOfResultsDesired); } protected  DataObjectAuditAOImpl(final IRODSSession irodsSession, final IRODSAccount irodsAccount); @Override AuditedAction getAuditedActionForDataObject(final IRODSFile irodsFile, final String auditActionCode,
			final String timeStampInIRODSFormat); @Override List<AuditedAction> findAllAuditRecordsForDataObject(final IRODSFile irodsFile, final int partialStart,
			final int numberOfResultsDesired); static final Logger log; static final char COMMA; }### Answer:
@Test public void testFindAllAuditRecordsForDataObject() throws Exception { if (!testingPropertiesHelper.isTestAudit(testingProperties)) { return; } String testFileName = System.currentTimeMillis() + "testFindAllAuditRecordsForDataObject.txt"; String absPath = scratchFileUtils.createAndReturnAbsoluteScratchPath(IRODS_TEST_SUBDIR_PATH); String localFileName = FileGenerator.generateFileOfFixedLengthGivenName(absPath, testFileName, 300); String targetIrodsFile = testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties( testingProperties, IRODS_TEST_SUBDIR_PATH + '/' + testFileName); File localFile = new File(localFileName); IRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties); IRODSAccessObjectFactory accessObjectFactory = irodsFileSystem.getIRODSAccessObjectFactory(); IRODSFileFactory irodsFileFactory = accessObjectFactory.getIRODSFileFactory(irodsAccount); DataObjectAOImpl dataObjectAO = (DataObjectAOImpl) accessObjectFactory.getDataObjectAO(irodsAccount); IRODSFile destFile = irodsFileFactory.instanceIRODSFile(targetIrodsFile); dataObjectAO.putLocalDataObjectToIRODS(localFile, destFile, true); DataObjectAuditAO dataObjectAuditAO = accessObjectFactory.getDataObjectAuditAO(irodsAccount); List<AuditedAction> auditData = dataObjectAuditAO.findAllAuditRecordsForDataObject(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 void testFindAllAuditRecordsForDataObjectNotExists() throws Exception { if (!testingPropertiesHelper.isTestAudit(testingProperties)) { throw new FileNotFoundException("expected"); } String testFileName = System.currentTimeMillis() + "testFindAllAuditRecordsForDataObject.txt"; 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); DataObjectAuditAO dataObjectAuditAO = accessObjectFactory.getDataObjectAuditAO(irodsAccount); dataObjectAuditAO.findAllAuditRecordsForDataObject(destFile, 0, 1000); }