Add tests to prove Workflow Items and Template Items are also not counted/listed

This commit is contained in:
Tim Donohue
2021-07-16 11:57:40 -05:00
parent 025c7a8c78
commit 065514b5f3
2 changed files with 51 additions and 5 deletions

View File

@@ -23,6 +23,7 @@ import org.dspace.core.Context;
import org.dspace.discovery.SearchServiceException;
import org.dspace.eperson.EPerson;
import org.dspace.eperson.Group;
import org.dspace.xmlworkflow.WorkflowConfigurationException;
/**
* Builder to construct Collection objects.
@@ -177,7 +178,7 @@ public class CollectionBuilder extends AbstractDSpaceObjectBuilder<Collection> {
/**
* Generate and populate a workflow group for the Collection. Obsolete:
* the 3-step workflow model has been removed.
* the 3-step workflow model has been removed. Use other withWorkflowGroup() method instead
*
* @param step number of the workflow step.
* @param members make these users members of the group.
@@ -196,6 +197,25 @@ public class CollectionBuilder extends AbstractDSpaceObjectBuilder<Collection> {
return this;
}
/**
* Generate and populate a role-based workflow group for the Collection.
*
* @param roleName the rolename for the group
* @param members make these users members of the group.
* @return this
* @throws SQLException passed through.
* @throws AuthorizeException passed through.
*/
public CollectionBuilder withWorkflowGroup(String roleName, EPerson... members)
throws SQLException, AuthorizeException, IOException, WorkflowConfigurationException {
Group g = workflowService.createWorkflowRoleGroup(context, collection, roleName);
for (EPerson e : members) {
groupService.addMember(context, g, e);
}
groupService.update(context, g);
return this;
}
/**
* Create an admin group for the collection with the specified members
*