@Test public void testShouldProcessItemWhenShouldNotProcessEntity() throws SQLException { context.turnOffAuthorisationSystem(); Community community = CommunityBuilder.createCommunity(context).build(); Collection collection = CollectionBuilder.createCollection(context, community).build(); Item item = ItemBuilder.createItem(context, collection).withRelationshipType(otherEntity.getLabel()).build(); context.restoreAuthSystemState(); ExportEventProcessor exportEventProcessor = new ItemEventProcessor(context, request, item); boolean result = exportEventProcessor.shouldProcessItem(item); assertFalse(result); }
protected boolean shouldProcessItem(Item item) throws SQLException { if (item == null) { return false; } if (!item.isArchived()) { return false; } if (itemService.canEdit(context, item)) { return false; } if (!shouldProcessItemType(item)) { return false; } if (!shouldProcessEntityType(item)) { return false; } return true; }
ExportEventProcessor { protected boolean shouldProcessItem(Item item) throws SQLException { if (item == null) { return false; } if (!item.isArchived()) { return false; } if (itemService.canEdit(context, item)) { return false; } if (!shouldProcessItemType(item)) { return false; } if (!shouldProcessEntityType(item)) { return false; } return true; } }
ExportEventProcessor { protected boolean shouldProcessItem(Item item) throws SQLException { if (item == null) { return false; } if (!item.isArchived()) { return false; } if (itemService.canEdit(context, item)) { return false; } if (!shouldProcessItemType(item)) { return false; } if (!shouldProcessEntityType(item)) { return false; } return true; } ExportEventProcessor(Context context, HttpServletRequest request); }
ExportEventProcessor { protected boolean shouldProcessItem(Item item) throws SQLException { if (item == null) { return false; } if (!item.isArchived()) { return false; } if (itemService.canEdit(context, item)) { return false; } if (!shouldProcessItemType(item)) { return false; } if (!shouldProcessEntityType(item)) { return false; } return true; } ExportEventProcessor(Context context, HttpServletRequest request); abstract void processEvent(); }
ExportEventProcessor { protected boolean shouldProcessItem(Item item) throws SQLException { if (item == null) { return false; } if (!item.isArchived()) { return false; } if (itemService.canEdit(context, item)) { return false; } if (!shouldProcessItemType(item)) { return false; } if (!shouldProcessEntityType(item)) { return false; } return true; } ExportEventProcessor(Context context, HttpServletRequest request); abstract void processEvent();  }