mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
RM-5344 Handle case where site with id "rm" doesn't exist.
This is not possible normally, but it does happen with the integration tests. Also fix some whitespace in the test class.
This commit is contained in:
@@ -76,6 +76,7 @@ import org.alfresco.service.cmr.repository.MLText;
|
|||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeService;
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
import org.alfresco.service.cmr.security.AccessStatus;
|
import org.alfresco.service.cmr.security.AccessStatus;
|
||||||
|
import org.alfresco.service.cmr.site.SiteInfo;
|
||||||
import org.alfresco.service.cmr.site.SiteService;
|
import org.alfresco.service.cmr.site.SiteService;
|
||||||
import org.alfresco.service.namespace.NamespaceService;
|
import org.alfresco.service.namespace.NamespaceService;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
@@ -1104,10 +1105,14 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get audit entries
|
// Get audit entries
|
||||||
QName siteType = nodeService.getType(siteService.getSite(DEFAULT_SITE_NAME).getNodeRef());
|
SiteInfo siteInfo = siteService.getSite(DEFAULT_SITE_NAME);
|
||||||
if (siteType.equals(TYPE_DOD_5015_SITE))
|
if (siteInfo != null)
|
||||||
{
|
{
|
||||||
auditService.auditQuery(callback, dod5015AuditQueryParams, maxEntries);
|
QName siteType = nodeService.getType(siteInfo.getNodeRef());
|
||||||
|
if (siteType.equals(TYPE_DOD_5015_SITE))
|
||||||
|
{
|
||||||
|
auditService.auditQuery(callback, dod5015AuditQueryParams, maxEntries);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// We always need to make the standard query - regardless of the type of RM site (to get events like RM site created).
|
// We always need to make the standard query - regardless of the type of RM site (to get events like RM site created).
|
||||||
auditService.auditQuery(callback, auditQueryParams, maxEntries);
|
auditService.auditQuery(callback, auditQueryParams, maxEntries);
|
||||||
|
@@ -78,18 +78,18 @@ public class RecordsManagementAuditServiceImplTest extends BaseRMTestCase
|
|||||||
@Override
|
@Override
|
||||||
public Void run() throws Exception
|
public Void run() throws Exception
|
||||||
{
|
{
|
||||||
// test start time recorded
|
// test start time recorded
|
||||||
testStartTime = new Date();
|
testStartTime = new Date();
|
||||||
|
|
||||||
// Stop and clear the log
|
// Stop and clear the log
|
||||||
rmAuditService.stopAuditLog(filePlan);
|
rmAuditService.stopAuditLog(filePlan);
|
||||||
rmAuditService.clearAuditLog(filePlan);
|
rmAuditService.clearAuditLog(filePlan);
|
||||||
rmAuditService.startAuditLog(filePlan);
|
rmAuditService.startAuditLog(filePlan);
|
||||||
|
|
||||||
// check that audit service is started
|
// check that audit service is started
|
||||||
assertTrue(rmAuditService.isAuditLogEnabled(filePlan));
|
assertTrue(rmAuditService.isAuditLogEnabled(filePlan));
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -198,7 +198,7 @@ public class RecordsManagementAuditServiceImplTest extends BaseRMTestCase
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test getAuditTrail method and parameter filters.
|
* Test getAuditTrail method and parameter filters.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user