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:
Tom Page
2018-01-04 14:28:27 +00:00
parent 29e00d1ec2
commit 77b5d35685
2 changed files with 18 additions and 13 deletions

View File

@@ -76,6 +76,7 @@ import org.alfresco.service.cmr.repository.MLText;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
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.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
@@ -1104,11 +1105,15 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
}
// Get audit entries
QName siteType = nodeService.getType(siteService.getSite(DEFAULT_SITE_NAME).getNodeRef());
SiteInfo siteInfo = siteService.getSite(DEFAULT_SITE_NAME);
if (siteInfo != null)
{
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).
auditService.auditQuery(callback, auditQueryParams, maxEntries);