@Test public void testExtractManyEntity() { Mockito.when(mockRepo.findEach(Mockito.eq(EntityNames.STAFF), Mockito.eq(new NeutralQuery()))) .thenReturn(Arrays.asList(mockEntity, mockEntity).iterator()); Mockito.when(mockMap.getExtractFileForEdOrg("LEA")).thenReturn(mockFile); extractor.extractEntities(staffToLeaDateCache); Mockito.verify(mockExtractor, Mockito.times(2)).extractEntity(Mockito.eq(mockEntity), Mockito.eq(mockFile), Mockito.eq(EntityNames.STAFF)); }
@Override public void extractEntities(EntityToEdOrgDateCache staffToEdorgDateCache) { edOrgExtractHelper.logSecurityEvent(map.getEdOrgs(), EntityNames.STAFF, this.getClass().getName()); Iterator<Entity> staffs = repo.findEach(EntityNames.STAFF, new NeutralQuery()); while (staffs.hasNext()) { Entity staff = staffs.next(); Set<String> edOrgs = staffToEdorgDateCache.getEntriesById(staff.getEntityId()).keySet(); for (String edOrg : edOrgs) { extractor.extractEntity(staff, map.getExtractFileForEdOrg(edOrg), EntityNames.STAFF); } } }
StaffExtractor implements EntityDatedExtract { @Override public void extractEntities(EntityToEdOrgDateCache staffToEdorgDateCache) { edOrgExtractHelper.logSecurityEvent(map.getEdOrgs(), EntityNames.STAFF, this.getClass().getName()); Iterator<Entity> staffs = repo.findEach(EntityNames.STAFF, new NeutralQuery()); while (staffs.hasNext()) { Entity staff = staffs.next(); Set<String> edOrgs = staffToEdorgDateCache.getEntriesById(staff.getEntityId()).keySet(); for (String edOrg : edOrgs) { extractor.extractEntity(staff, map.getExtractFileForEdOrg(edOrg), EntityNames.STAFF); } } } }
StaffExtractor implements EntityDatedExtract { @Override public void extractEntities(EntityToEdOrgDateCache staffToEdorgDateCache) { edOrgExtractHelper.logSecurityEvent(map.getEdOrgs(), EntityNames.STAFF, this.getClass().getName()); Iterator<Entity> staffs = repo.findEach(EntityNames.STAFF, new NeutralQuery()); while (staffs.hasNext()) { Entity staff = staffs.next(); Set<String> edOrgs = staffToEdorgDateCache.getEntriesById(staff.getEntityId()).keySet(); for (String edOrg : edOrgs) { extractor.extractEntity(staff, map.getExtractFileForEdOrg(edOrg), EntityNames.STAFF); } } } StaffExtractor(EntityExtractor extractor, ExtractFileMap map, Repository<Entity> repo, EdOrgExtractHelper edOrgExtractHelper); }
StaffExtractor implements EntityDatedExtract { @Override public void extractEntities(EntityToEdOrgDateCache staffToEdorgDateCache) { edOrgExtractHelper.logSecurityEvent(map.getEdOrgs(), EntityNames.STAFF, this.getClass().getName()); Iterator<Entity> staffs = repo.findEach(EntityNames.STAFF, new NeutralQuery()); while (staffs.hasNext()) { Entity staff = staffs.next(); Set<String> edOrgs = staffToEdorgDateCache.getEntriesById(staff.getEntityId()).keySet(); for (String edOrg : edOrgs) { extractor.extractEntity(staff, map.getExtractFileForEdOrg(edOrg), EntityNames.STAFF); } } } StaffExtractor(EntityExtractor extractor, ExtractFileMap map, Repository<Entity> repo, EdOrgExtractHelper edOrgExtractHelper); @Override void extractEntities(EntityToEdOrgDateCache staffToEdorgDateCache); }
StaffExtractor implements EntityDatedExtract { @Override public void extractEntities(EntityToEdOrgDateCache staffToEdorgDateCache) { edOrgExtractHelper.logSecurityEvent(map.getEdOrgs(), EntityNames.STAFF, this.getClass().getName()); Iterator<Entity> staffs = repo.findEach(EntityNames.STAFF, new NeutralQuery()); while (staffs.hasNext()) { Entity staff = staffs.next(); Set<String> edOrgs = staffToEdorgDateCache.getEntriesById(staff.getEntityId()).keySet(); for (String edOrg : edOrgs) { extractor.extractEntity(staff, map.getExtractFileForEdOrg(edOrg), EntityNames.STAFF); } } } StaffExtractor(EntityExtractor extractor, ExtractFileMap map, Repository<Entity> repo, EdOrgExtractHelper edOrgExtractHelper); @Override void extractEntities(EntityToEdOrgDateCache staffToEdorgDateCache);  }