DS-28DS-2895 add unit test to expose the wrong behaviour

slightly renamed the method isAnInprogressSubmission in isInProgressSubmission to make it uniform with DSpace 5 and added to the service interface to allow testing and easy reuse
This commit is contained in:
Andrea Bollini
2016-08-20 15:41:29 +02:00
parent 5ade3cb971
commit 651b49e05a
4 changed files with 145 additions and 11 deletions

View File

@@ -887,7 +887,7 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
// is this collection not yet created, and an item template is created
if (item.getOwningCollection() == null)
{
if (!isAnInprogressSubmission(context, item)) {
if (!isInProgressSubmission(context, item)) {
return true;
}
else {
@@ -905,7 +905,7 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
* @return <code>true</code> if the item is an inprogress submission, i.e. a WorkspaceItem or WorkflowItem
* @throws SQLException
*/
public boolean isAnInprogressSubmission(Context context, Item item) throws SQLException {
public boolean isInProgressSubmission(Context context, Item item) throws SQLException {
return workspaceItemService.findByItem(context, item) != null
|| workflowItemService.findByItem(context, item) != null;
}