mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merge pull request #1385 from Alfresco/feature/APPS-860_ReproduceFilterEventsByLogin
Feature/apps 860 reproduce filter events by login
This commit is contained in:
@@ -42,6 +42,7 @@ public enum AuditEvents
|
||||
ADD_TO_USER_GROUP("Add To User Group", "Add To User Group"),
|
||||
REMOVE_FROM_USER_GROUP("Remove From User Group", "Remove From User Group"),
|
||||
LOGIN_UNSUCCESSFUL("Login.Failure", "Login Unsuccessful"),
|
||||
LOGIN_SUCCESSFUL("Login.Success", "Login Successful"),
|
||||
CREATE_HOLD("Create Hold", "Create Hold"),
|
||||
DELETE_HOLD("Delete Hold", "Delete Hold"),
|
||||
ADD_TO_HOLD("Add To Hold", "Add To Hold"),
|
||||
|
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
package org.alfresco.rest.rm.community.audit;
|
||||
|
||||
import static org.alfresco.rest.rm.community.model.audit.AuditEvents.LOGIN_SUCCESSFUL;
|
||||
import static org.alfresco.rest.rm.community.model.audit.AuditEvents.LOGIN_UNSUCCESSFUL;
|
||||
import static org.alfresco.utility.report.log.Step.STEP;
|
||||
import static org.testng.AssertJUnit.assertTrue;
|
||||
@@ -72,4 +73,24 @@ public class AuditLoginEventsTests extends BaseRMRestTest
|
||||
assertTrue("The list of events is not filtered by " + LOGIN_UNSUCCESSFUL.event,
|
||||
auditEntries.stream().allMatch(auditEntry -> auditEntry.getEvent().equals(LOGIN_UNSUCCESSFUL.eventDisplayName)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Given I have tried to login using valid credentials
|
||||
* When I view the RM audit filtered by Login successful event
|
||||
* Then the audit log contains only the entries for the Login successful event
|
||||
*/
|
||||
@Test
|
||||
public void filterByLoginSuccessful() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(getAdminUser());
|
||||
restClient.withCoreAPI().getSites();
|
||||
|
||||
STEP("Get the list of audit entries for the login successful event.");
|
||||
List<AuditEntry> auditEntries = rmAuditService.getAuditEntriesFilteredByEvent(getAdminUser(),
|
||||
LOGIN_SUCCESSFUL);
|
||||
|
||||
STEP("Check the audit log contains only the entries for the login successful event.");
|
||||
assertTrue("The list of events is not filtered by " + LOGIN_SUCCESSFUL.event,
|
||||
auditEntries.stream().allMatch(auditEntry -> auditEntry.getEvent().equals(LOGIN_SUCCESSFUL.eventDisplayName)));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user