@Test public void testExtractNoEntityBecauseOfIdMiss() { Mockito.when(mockEntity.getEntityId()).thenReturn("parent2"); Mockito.when(mockRepo.findEach(Mockito.eq(EntityNames.PARENT), Mockito.eq(new NeutralQuery()))).thenReturn( Arrays.asList(mockEntity).iterator()); Mockito.when(mockMap.getExtractFileForEdOrg("LEA")).thenReturn(mockFile); extractor.extractEntities(mockParentCache); Mockito.verify(mockExtractor, Mockito.never()).extractEntity(Mockito.eq(mockEntity), Mockito.eq(mockFile), Mockito.eq(EntityNames.PARENT)); }
@Override public void extractEntities(EntityToEdOrgCache entityToEdorgCache) { edOrgExtractHelper.logSecurityEvent(map.getEdOrgs(), EntityNames.PARENT, this.getClass().getName()); Iterator<Entity> parents = repo.findEach(EntityNames.PARENT, new NeutralQuery()); Set<String> validParents = entityToEdorgCache.getEntityIds(); while (parents.hasNext()) { Entity parent = parents.next(); if (!validParents.contains(parent.getEntityId())) { continue; } for (String edOrg : entityToEdorgCache.getEntriesById(parent.getEntityId())) { extractor.extractEntity(parent, map.getExtractFileForEdOrg(edOrg), EntityNames.PARENT); } } }
ParentExtractor implements EntityExtract { @Override public void extractEntities(EntityToEdOrgCache entityToEdorgCache) { edOrgExtractHelper.logSecurityEvent(map.getEdOrgs(), EntityNames.PARENT, this.getClass().getName()); Iterator<Entity> parents = repo.findEach(EntityNames.PARENT, new NeutralQuery()); Set<String> validParents = entityToEdorgCache.getEntityIds(); while (parents.hasNext()) { Entity parent = parents.next(); if (!validParents.contains(parent.getEntityId())) { continue; } for (String edOrg : entityToEdorgCache.getEntriesById(parent.getEntityId())) { extractor.extractEntity(parent, map.getExtractFileForEdOrg(edOrg), EntityNames.PARENT); } } } }
ParentExtractor implements EntityExtract { @Override public void extractEntities(EntityToEdOrgCache entityToEdorgCache) { edOrgExtractHelper.logSecurityEvent(map.getEdOrgs(), EntityNames.PARENT, this.getClass().getName()); Iterator<Entity> parents = repo.findEach(EntityNames.PARENT, new NeutralQuery()); Set<String> validParents = entityToEdorgCache.getEntityIds(); while (parents.hasNext()) { Entity parent = parents.next(); if (!validParents.contains(parent.getEntityId())) { continue; } for (String edOrg : entityToEdorgCache.getEntriesById(parent.getEntityId())) { extractor.extractEntity(parent, map.getExtractFileForEdOrg(edOrg), EntityNames.PARENT); } } } ParentExtractor(EntityExtractor extractor, ExtractFileMap map, Repository<Entity> repo, EdOrgExtractHelper edOrgExtractHelper); }
ParentExtractor implements EntityExtract { @Override public void extractEntities(EntityToEdOrgCache entityToEdorgCache) { edOrgExtractHelper.logSecurityEvent(map.getEdOrgs(), EntityNames.PARENT, this.getClass().getName()); Iterator<Entity> parents = repo.findEach(EntityNames.PARENT, new NeutralQuery()); Set<String> validParents = entityToEdorgCache.getEntityIds(); while (parents.hasNext()) { Entity parent = parents.next(); if (!validParents.contains(parent.getEntityId())) { continue; } for (String edOrg : entityToEdorgCache.getEntriesById(parent.getEntityId())) { extractor.extractEntity(parent, map.getExtractFileForEdOrg(edOrg), EntityNames.PARENT); } } } ParentExtractor(EntityExtractor extractor, ExtractFileMap map, Repository<Entity> repo, EdOrgExtractHelper edOrgExtractHelper); @Override void extractEntities(EntityToEdOrgCache entityToEdorgCache); }
ParentExtractor implements EntityExtract { @Override public void extractEntities(EntityToEdOrgCache entityToEdorgCache) { edOrgExtractHelper.logSecurityEvent(map.getEdOrgs(), EntityNames.PARENT, this.getClass().getName()); Iterator<Entity> parents = repo.findEach(EntityNames.PARENT, new NeutralQuery()); Set<String> validParents = entityToEdorgCache.getEntityIds(); while (parents.hasNext()) { Entity parent = parents.next(); if (!validParents.contains(parent.getEntityId())) { continue; } for (String edOrg : entityToEdorgCache.getEntriesById(parent.getEntityId())) { extractor.extractEntity(parent, map.getExtractFileForEdOrg(edOrg), EntityNames.PARENT); } } } ParentExtractor(EntityExtractor extractor, ExtractFileMap map, Repository<Entity> repo, EdOrgExtractHelper edOrgExtractHelper); @Override void extractEntities(EntityToEdOrgCache entityToEdorgCache);  }