mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 06:53:09 +00:00
Refactor/streamline DOI unit tests. They were ignoring setup already done in AbstractUnitTest, creating a secondary context obj, and sending all new items through workflow approval.
This commit is contained in:
@@ -70,13 +70,11 @@ public class EZIDIdentifierProviderTest
|
||||
throws SQLException, AuthorizeException, IOException
|
||||
{
|
||||
ctx.turnOffAuthorisationSystem();
|
||||
ctx.setCurrentUser(eperson);
|
||||
|
||||
// Create an Item to play with
|
||||
WorkspaceItem wsItem = WorkspaceItem.create(ctx, collection, false);
|
||||
|
||||
// Get it from the workspace and set some metadata
|
||||
Item item = wsItem.getItem();
|
||||
|
||||
//Install a fresh item
|
||||
WorkspaceItem wsItem = WorkspaceItem.create(context, collection, false);
|
||||
Item item = InstallItem.installItem(context, wsItem);
|
||||
|
||||
itemID = item.getID();
|
||||
|
||||
item.addMetadata("dc", "contributor", "author", null, "Author, A. N.");
|
||||
@@ -84,12 +82,6 @@ public class EZIDIdentifierProviderTest
|
||||
item.addMetadata("dc", "publisher", null, null, "DSpace Test Harness");
|
||||
item.update();
|
||||
|
||||
// I think we have to do this?
|
||||
WorkflowItem wfItem = WorkflowManager.startWithoutNotify(ctx, wsItem);
|
||||
WorkflowManager.advance(ctx, wfItem, ctx.getCurrentUser());
|
||||
wfItem.update();
|
||||
wfItem.deleteWrapper();
|
||||
|
||||
// Commit work, clean up
|
||||
ctx.commit();
|
||||
ctx.restoreAuthSystemState();
|
||||
|
Reference in New Issue
Block a user