diff --git a/e2e-test/java/org/alfresco/rest/audit/DeleteAuditCoreTests.java b/e2e-test/java/org/alfresco/rest/audit/DeleteAuditCoreTests.java index 30dd2b244..493e1b6a7 100644 --- a/e2e-test/java/org/alfresco/rest/audit/DeleteAuditCoreTests.java +++ b/e2e-test/java/org/alfresco/rest/audit/DeleteAuditCoreTests.java @@ -43,10 +43,11 @@ public class DeleteAuditCoreTests extends AuditTest restAuditEntryCollection = restClient.authenticateUser(adminUser).withParams("maxItems=4").withCoreAPI().usingAudit() .listAuditEntriesForAnAuditApplication(restAuditAppModel.getId()); restClient.assertStatusCodeIs(HttpStatus.OK); - String firstId = restAuditEntryCollection.getEntries().get(restAuditEntryCollection.getPagination().getCount() - 1) + + String firstId = restAuditEntryCollection.getEntries().get(0).onModel().getId(); + String secondId = restAuditEntryCollection.getEntries().get(restAuditEntryCollection.getPagination().getCount() - 1) .onModel().getId(); - String secondId = restAuditEntryCollection.getEntries().get(0).onModel().getId(); - + restClient.authenticateUser(userModel).withParams("where=(id BETWEEN ("+firstId+","+secondId+"))").withCoreAPI().usingAudit().deleteAuditEntriesForAnAuditApplication(restAuditAppModel.getId()); restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN);