mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
Merged 5.2.N-AUDIT-API (5.2.2) to 5.2.N (5.2.2)
137927 eknizat: REPO-1298 Enable/Disable Application Auditing - Changes following code review git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@137972 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -381,11 +381,11 @@ public class AuditImpl implements Audit
|
|||||||
// Enable/Disable audit application
|
// Enable/Disable audit application
|
||||||
if (auditApp.getIsEnabled() && !auditApplication.isEnabled())
|
if (auditApp.getIsEnabled() && !auditApplication.isEnabled())
|
||||||
{
|
{
|
||||||
auditService.enableAudit(auditApplication.getName(), auditApplication.getKey());
|
auditService.enableAudit(auditApplication.getName(), null);
|
||||||
}
|
}
|
||||||
else if (!auditApp.getIsEnabled() && auditApplication.isEnabled())
|
else if (!auditApp.getIsEnabled() && auditApplication.isEnabled())
|
||||||
{
|
{
|
||||||
auditService.disableAudit(auditApplication.getName(), auditApplication.getKey());
|
auditService.disableAudit(auditApplication.getName(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new AuditApp(auditApplication.getKey().substring(1), auditApplication.getName(), auditApp.getIsEnabled());
|
return new AuditApp(auditApplication.getKey().substring(1), auditApplication.getName(), auditApp.getIsEnabled());
|
||||||
|
@@ -249,9 +249,10 @@ public class AuditAppTest extends AbstractSingleNetworkSiteTest
|
|||||||
|
|
||||||
setRequestContext(networkOne.getId(), networkAdmin, DEFAULT_ADMIN_PWD);
|
setRequestContext(networkOne.getId(), networkAdmin, DEFAULT_ADMIN_PWD);
|
||||||
|
|
||||||
//Get one of the audit app ids (default tagging)
|
//Get one of the audit app ids ( fail test if there are no audit apps in the system )
|
||||||
ListResponse<AuditApp> apps = publicApiClient.auditApps().getAuditApps(null, "Getting audit apps error ", HttpServletResponse.SC_OK);
|
ListResponse<AuditApp> apps = publicApiClient.auditApps().getAuditApps(null, "Getting audit apps error ", HttpServletResponse.SC_OK);
|
||||||
appId = (apps.getList().size()>0) ? apps.getList().get(0).getId() : "tagging";
|
if (apps.getList().size() == 0) fail("There are no audit applications to run this test against.");
|
||||||
|
appId = apps.getList().get(0).getId();
|
||||||
|
|
||||||
// +ve
|
// +ve
|
||||||
// Disable audit app
|
// Disable audit app
|
||||||
@@ -281,7 +282,7 @@ public class AuditAppTest extends AbstractSingleNetworkSiteTest
|
|||||||
// 501
|
// 501
|
||||||
AuthenticationUtil.setFullyAuthenticatedUser(networkAdmin);
|
AuthenticationUtil.setFullyAuthenticatedUser(networkAdmin);
|
||||||
disableSystemAudit();
|
disableSystemAudit();
|
||||||
responseAuditApp = publicApiClient.auditApps().updateAuditApp(appId,requestAuditApp,null, HttpServletResponse.SC_NOT_IMPLEMENTED);
|
publicApiClient.auditApps().updateAuditApp(appId,requestAuditApp,null, HttpServletResponse.SC_NOT_IMPLEMENTED);
|
||||||
enableSystemAudit();
|
enableSystemAudit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2480,7 +2480,7 @@ public class PublicApiClient
|
|||||||
|
|
||||||
public AuditApp updateAuditApp(String applicationId, AuditApp auditApp, Map<String, String> params, int expectedStatus) throws PublicApiException
|
public AuditApp updateAuditApp(String applicationId, AuditApp auditApp, Map<String, String> params, int expectedStatus) throws PublicApiException
|
||||||
{
|
{
|
||||||
HttpResponse response = update("audit-applications", applicationId,null,null, auditApp.toJSON().toString(), params, "Eriks test failed", expectedStatus);
|
HttpResponse response = update("audit-applications", applicationId,null,null, auditApp.toJSON().toString(), params, "Failed to update Audit Application", expectedStatus);
|
||||||
|
|
||||||
if (response != null && response.getJsonResponse() != null)
|
if (response != null && response.getJsonResponse() != null)
|
||||||
{
|
{
|
||||||
@@ -2490,7 +2490,6 @@ public class PublicApiClient
|
|||||||
return AuditApp.parseAuditApp(jsonEntry);
|
return AuditApp.parseAuditApp(jsonEntry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user