mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
replaced the todos
This commit is contained in:
@@ -41,6 +41,8 @@ import static org.testng.AssertJUnit.assertTrue;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.rest.rm.community.base.BaseRMRestTest;
|
||||
import org.alfresco.rest.rm.community.model.audit.AuditEntry;
|
||||
@@ -174,8 +176,9 @@ public class AuditAddToHoldTests extends BaseRMRestTest
|
||||
holdsAPI.addItemToHold(rmAdmin.getUsername(), rmAdmin.getPassword(), nodeId, HOLD1);
|
||||
|
||||
STEP("Check the audit log contains the entry for the add to hold event.");
|
||||
rmAuditService.checkAuditLogForEvent(getAdminUser(), ADD_TO_HOLD, rmAdmin, HOLD1, Collections.emptyList());
|
||||
//TODO replace changed values
|
||||
rmAuditService.checkAuditLogForEvent(getAdminUser(), ADD_TO_HOLD, rmAdmin, HOLD1,
|
||||
asList(ImmutableMap.of("new", nodeName, "previous", "", "name", "Name"),
|
||||
ImmutableMap.of("new", HOLD1, "previous", "", "name", "Hold Name")));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -211,7 +214,7 @@ public class AuditAddToHoldTests extends BaseRMRestTest
|
||||
{
|
||||
STEP("Create a new record folder with a record inside");
|
||||
RecordCategoryChild notEmptyRecFolder = createRecordFolder(recordCategory.getId(), PREFIX + "notEmptyRecFolder");
|
||||
createElectronicRecord(notEmptyRecFolder.getId(), PREFIX + "record");
|
||||
Record record = createElectronicRecord(notEmptyRecFolder.getId(), PREFIX + "record");
|
||||
|
||||
rmAuditService.clearAuditLog();
|
||||
|
||||
@@ -221,8 +224,10 @@ public class AuditAddToHoldTests extends BaseRMRestTest
|
||||
auditEntries = rmAuditService.getAuditEntriesFilteredByEvent(getAdminUser(), ADD_TO_HOLD);
|
||||
|
||||
STEP("Check the audit log contains only an entry for add to hold.");
|
||||
assertEquals("The list of events should not contain Add to Hold entry for the record", 1, auditEntries.size());
|
||||
//TODO check content name
|
||||
assertEquals("The list of events should contain only an entry", 1, auditEntries.size());
|
||||
assertTrue("The list of events should not contain Add to Hold entry for the record",
|
||||
auditEntries.stream().noneMatch(entry -> entry.getChangedValues().contains(
|
||||
Collections.singletonList(ImmutableMap.of("new", record.getName(), "previous", "", "name", "Name")))));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -105,7 +105,7 @@ public class AuditCreateHoldTests extends BaseRMRestTest
|
||||
STEP("Check the audit log contains the entry for the created hold with the hold details.");
|
||||
rmAuditService.checkAuditLogForEvent(getAdminUser(), CREATE_HOLD, rmAdmin, HOLD1,
|
||||
asList(ImmutableMap.of("new", HOLD_REASON, "previous", "", "name", "Hold Reason"),
|
||||
ImmutableMap.of("new", HOLD1, "previous", "", "name", "Name")));
|
||||
ImmutableMap.of("new", HOLD1, "previous", "", "name", "Hold Name")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -39,6 +39,8 @@ import static org.testng.AssertJUnit.assertTrue;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import org.alfresco.rest.rm.community.base.BaseRMRestTest;
|
||||
import org.alfresco.rest.rm.community.model.user.UserRoles;
|
||||
import org.alfresco.rest.v0.HoldsAPI;
|
||||
@@ -106,7 +108,8 @@ public class AuditDeleteHoldTests extends BaseRMRestTest
|
||||
holdsAPI.deleteHold(rmAdmin.getUsername(), rmAdmin.getPassword(), HOLD2);
|
||||
|
||||
STEP("Check the audit log contains the entry for the deleted hold with the hold details.");
|
||||
rmAuditService.checkAuditLogForEvent(getAdminUser(), DELETE_HOLD, rmAdmin, HOLD2, Collections.emptyList());
|
||||
rmAuditService.checkAuditLogForEvent(getAdminUser(), DELETE_HOLD, rmAdmin, HOLD2,
|
||||
Collections.singletonList(ImmutableMap.of("new", "", "previous", HOLD2, "name", "Hold Name")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -41,6 +41,8 @@ import static org.testng.AssertJUnit.assertTrue;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.rest.rm.community.base.BaseRMRestTest;
|
||||
import org.alfresco.rest.rm.community.model.audit.AuditEntry;
|
||||
@@ -185,8 +187,9 @@ public class AuditRemoveFromHoldTests extends BaseRMRestTest
|
||||
holdsAPI.removeItemFromHold(rmAdmin.getUsername(), rmAdmin.getPassword(), nodeId, HOLD3);
|
||||
|
||||
STEP("Check the audit log contains the entry for the remove from hold event.");
|
||||
rmAuditService.checkAuditLogForEvent(getAdminUser(), REMOVE_FROM_HOLD, rmAdmin, HOLD3, Collections.emptyList());
|
||||
//TODO replace changed values
|
||||
rmAuditService.checkAuditLogForEvent(getAdminUser(), REMOVE_FROM_HOLD, rmAdmin, HOLD3,
|
||||
asList(ImmutableMap.of("new", "", "previous", nodeName, "name", "Name"),
|
||||
ImmutableMap.of("new", "", "previous", HOLD3, "name", "Hold Name")));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -208,8 +211,8 @@ public class AuditRemoveFromHoldTests extends BaseRMRestTest
|
||||
|
||||
STEP("Check the audit log contains the entry for the remove from hold.");
|
||||
rmAuditService.checkAuditLogForEvent(getAdminUser(), REMOVE_FROM_HOLD, rmAdmin, DELETED_HOLD,
|
||||
Collections.emptyList());
|
||||
//TODO replace changed values
|
||||
asList(ImmutableMap.of("new", "", "previous", heldContent.getName(), "name", "Name"),
|
||||
ImmutableMap.of("new", "", "previous", DELETED_HOLD, "name", "Hold Name")));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -242,7 +245,7 @@ public class AuditRemoveFromHoldTests extends BaseRMRestTest
|
||||
{
|
||||
STEP("Create a new record folder with a record inside");
|
||||
RecordCategoryChild notEmptyRecFolder = createRecordFolder(recordCategory.getId(), PREFIX + "notEmptyRecFolder");
|
||||
createElectronicRecord(notEmptyRecFolder.getId(), PREFIX + "record");
|
||||
Record record = createElectronicRecord(notEmptyRecFolder.getId(), PREFIX + "record");
|
||||
|
||||
STEP("Add the record folder to a hold.");
|
||||
holdsAPI.addItemToHold(rmAdmin.getUsername(), rmAdmin.getPassword(), notEmptyRecFolder.getId(), HOLD1);
|
||||
@@ -256,9 +259,10 @@ public class AuditRemoveFromHoldTests extends BaseRMRestTest
|
||||
auditEntries = rmAuditService.getAuditEntriesFilteredByEvent(getAdminUser(), REMOVE_FROM_HOLD);
|
||||
|
||||
STEP("Check the audit log contains only an entry for remove from hold.");
|
||||
assertEquals("The list of events should not contain Remove from Hold entry for the record", 1,
|
||||
auditEntries.size());
|
||||
//TODO check content name
|
||||
assertEquals("The list of events should contain only an entry", 1, auditEntries.size());
|
||||
assertTrue("The list of events should not contain Remove from Hold entry for the record",
|
||||
auditEntries.stream().noneMatch(entry -> entry.getChangedValues().contains(
|
||||
Collections.singletonList(ImmutableMap.of("new", "", "previous", record.getName(), "name", "Name")))));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user