74190: Bugfix IRUS Integration Entities

This commit is contained in:
Yana De Pauw
2020-10-28 17:21:08 +01:00
parent ae02b261fc
commit 38e54ea21f
2 changed files with 23 additions and 0 deletions

View File

@@ -185,6 +185,7 @@ public abstract class ExportEventProcessor {
/**
* 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
* @return whether the item should be processed
@@ -194,6 +195,10 @@ public abstract class ExportEventProcessor {
Entity entity = entityService.findByItemId(context, item.getID());
EntityType type = entityService.getType(context, entity);
if (type == null) {
return true;
}
String[] entityTypeStrings = configurationService.getArrayProperty("irus.statistics.tracker.entity-types");
List<String> entityTypes = new ArrayList<>();

View File

@@ -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
/**