mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-08 10:34:25 +00:00
74190: Bugfix IRUS Integration Entities
This commit is contained in:
@@ -185,6 +185,7 @@ public abstract class ExportEventProcessor {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the item's entity type should be processed
|
* Checks if the item's entity type should be processed
|
||||||
|
* When no entity type is present, the check will not be performed and true will be returned.
|
||||||
*
|
*
|
||||||
* @param item to be checked
|
* @param item to be checked
|
||||||
* @return whether the item should be processed
|
* @return whether the item should be processed
|
||||||
@@ -194,6 +195,10 @@ public abstract class ExportEventProcessor {
|
|||||||
Entity entity = entityService.findByItemId(context, item.getID());
|
Entity entity = entityService.findByItemId(context, item.getID());
|
||||||
EntityType type = entityService.getType(context, entity);
|
EntityType type = entityService.getType(context, entity);
|
||||||
|
|
||||||
|
if (type == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
String[] entityTypeStrings = configurationService.getArrayProperty("irus.statistics.tracker.entity-types");
|
String[] entityTypeStrings = configurationService.getArrayProperty("irus.statistics.tracker.entity-types");
|
||||||
List<String> entityTypes = new ArrayList<>();
|
List<String> entityTypes = new ArrayList<>();
|
||||||
|
|
||||||
|
@@ -241,6 +241,24 @@ public class ExportEventProcessorTest extends AbstractIntegrationTestWithDatabas
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
/**
|
||||||
|
* Test the ShouldProcessEntityType method where no entityType is present
|
||||||
|
*/
|
||||||
|
public void testShouldProcessEntityTypeWhenNotPresent() throws SQLException {
|
||||||
|
context.turnOffAuthorisationSystem();
|
||||||
|
Community community = CommunityBuilder.createCommunity(context).build();
|
||||||
|
Collection collection = CollectionBuilder.createCollection(context, community).build();
|
||||||
|
Item item = ItemBuilder.createItem(context, collection).build();
|
||||||
|
context.restoreAuthSystemState();
|
||||||
|
|
||||||
|
ExportEventProcessor exportEventProcessor = new ItemEventProcessor(context, request, item);
|
||||||
|
|
||||||
|
boolean result = exportEventProcessor.shouldProcessEntityType(item);
|
||||||
|
|
||||||
|
assertTrue(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user