@Test public void testExtractNoEntityBecauseOfLEAMiss() { Mockito.when(mockRepo.findEach(Mockito.eq(ContainerEntityNames.YEARLY_TRANSCRIPT), Mockito.eq(new NeutralQuery()))) .thenReturn(Arrays.asList(mockEntity).iterator()); Mockito.when(mockMap.getExtractFileForEdOrg("LEA")).thenReturn(null); extractor.extractEntities(mockStudentCache); Mockito.verify(mockExtractor, Mockito.never()).extractEntity(Mockito.eq(mockEntity), Mockito.eq(mockFile), Mockito.eq(ContainerEntityNames.YEARLY_TRANSCRIPT)); }
@Override public void extractEntities(EntityToEdOrgDateCache studentDatedCache) { edOrgExtractHelper.logSecurityEvent(map.getEdOrgs(), ContainerEntityNames.YEARLY_TRANSCRIPT, this.getClass().getName()); Iterator<Entity> yearlyTranscripts = repo.findEach(ContainerEntityNames.YEARLY_TRANSCRIPT, new NeutralQuery()); while (yearlyTranscripts.hasNext()) { Entity yearlyTranscript = yearlyTranscripts.next(); String studentId = (String) yearlyTranscript.getBody().get(ParameterConstants.STUDENT_ID); final Map<String, DateTime> studentEdOrgs = studentDatedCache.getEntriesById(studentId); Set<String> studentAcademicRecords = fetchStudentAcademicRecordsFromYearlyTranscript(yearlyTranscript); for (Map.Entry<String, DateTime> studentEdOrg : studentEdOrgs.entrySet()) { if (shouldExtract(yearlyTranscript, studentEdOrg.getValue())) { extractor.extractEntity(yearlyTranscript, map.getExtractFileForEdOrg(studentEdOrg.getKey()), ContainerEntityNames.YEARLY_TRANSCRIPT); for (String sarId : studentAcademicRecords) { studentAcademicRecordDateCache.addEntry(sarId, studentEdOrg.getKey(), studentEdOrg.getValue()); } } } } }
YearlyTranscriptExtractor implements EntityDatedExtract { @Override public void extractEntities(EntityToEdOrgDateCache studentDatedCache) { edOrgExtractHelper.logSecurityEvent(map.getEdOrgs(), ContainerEntityNames.YEARLY_TRANSCRIPT, this.getClass().getName()); Iterator<Entity> yearlyTranscripts = repo.findEach(ContainerEntityNames.YEARLY_TRANSCRIPT, new NeutralQuery()); while (yearlyTranscripts.hasNext()) { Entity yearlyTranscript = yearlyTranscripts.next(); String studentId = (String) yearlyTranscript.getBody().get(ParameterConstants.STUDENT_ID); final Map<String, DateTime> studentEdOrgs = studentDatedCache.getEntriesById(studentId); Set<String> studentAcademicRecords = fetchStudentAcademicRecordsFromYearlyTranscript(yearlyTranscript); for (Map.Entry<String, DateTime> studentEdOrg : studentEdOrgs.entrySet()) { if (shouldExtract(yearlyTranscript, studentEdOrg.getValue())) { extractor.extractEntity(yearlyTranscript, map.getExtractFileForEdOrg(studentEdOrg.getKey()), ContainerEntityNames.YEARLY_TRANSCRIPT); for (String sarId : studentAcademicRecords) { studentAcademicRecordDateCache.addEntry(sarId, studentEdOrg.getKey(), studentEdOrg.getValue()); } } } } } }
YearlyTranscriptExtractor implements EntityDatedExtract { @Override public void extractEntities(EntityToEdOrgDateCache studentDatedCache) { edOrgExtractHelper.logSecurityEvent(map.getEdOrgs(), ContainerEntityNames.YEARLY_TRANSCRIPT, this.getClass().getName()); Iterator<Entity> yearlyTranscripts = repo.findEach(ContainerEntityNames.YEARLY_TRANSCRIPT, new NeutralQuery()); while (yearlyTranscripts.hasNext()) { Entity yearlyTranscript = yearlyTranscripts.next(); String studentId = (String) yearlyTranscript.getBody().get(ParameterConstants.STUDENT_ID); final Map<String, DateTime> studentEdOrgs = studentDatedCache.getEntriesById(studentId); Set<String> studentAcademicRecords = fetchStudentAcademicRecordsFromYearlyTranscript(yearlyTranscript); for (Map.Entry<String, DateTime> studentEdOrg : studentEdOrgs.entrySet()) { if (shouldExtract(yearlyTranscript, studentEdOrg.getValue())) { extractor.extractEntity(yearlyTranscript, map.getExtractFileForEdOrg(studentEdOrg.getKey()), ContainerEntityNames.YEARLY_TRANSCRIPT); for (String sarId : studentAcademicRecords) { studentAcademicRecordDateCache.addEntry(sarId, studentEdOrg.getKey(), studentEdOrg.getValue()); } } } } } YearlyTranscriptExtractor(EntityExtractor extractor, ExtractFileMap map, Repository<Entity> repo,
            EdOrgExtractHelper edOrgExtractHelper); }
YearlyTranscriptExtractor implements EntityDatedExtract { @Override public void extractEntities(EntityToEdOrgDateCache studentDatedCache) { edOrgExtractHelper.logSecurityEvent(map.getEdOrgs(), ContainerEntityNames.YEARLY_TRANSCRIPT, this.getClass().getName()); Iterator<Entity> yearlyTranscripts = repo.findEach(ContainerEntityNames.YEARLY_TRANSCRIPT, new NeutralQuery()); while (yearlyTranscripts.hasNext()) { Entity yearlyTranscript = yearlyTranscripts.next(); String studentId = (String) yearlyTranscript.getBody().get(ParameterConstants.STUDENT_ID); final Map<String, DateTime> studentEdOrgs = studentDatedCache.getEntriesById(studentId); Set<String> studentAcademicRecords = fetchStudentAcademicRecordsFromYearlyTranscript(yearlyTranscript); for (Map.Entry<String, DateTime> studentEdOrg : studentEdOrgs.entrySet()) { if (shouldExtract(yearlyTranscript, studentEdOrg.getValue())) { extractor.extractEntity(yearlyTranscript, map.getExtractFileForEdOrg(studentEdOrg.getKey()), ContainerEntityNames.YEARLY_TRANSCRIPT); for (String sarId : studentAcademicRecords) { studentAcademicRecordDateCache.addEntry(sarId, studentEdOrg.getKey(), studentEdOrg.getValue()); } } } } } YearlyTranscriptExtractor(EntityExtractor extractor, ExtractFileMap map, Repository<Entity> repo,
            EdOrgExtractHelper edOrgExtractHelper); @Override void extractEntities(EntityToEdOrgDateCache studentDatedCache); EntityToEdOrgDateCache getStudentAcademicRecordDateCache(); }
YearlyTranscriptExtractor implements EntityDatedExtract { @Override public void extractEntities(EntityToEdOrgDateCache studentDatedCache) { edOrgExtractHelper.logSecurityEvent(map.getEdOrgs(), ContainerEntityNames.YEARLY_TRANSCRIPT, this.getClass().getName()); Iterator<Entity> yearlyTranscripts = repo.findEach(ContainerEntityNames.YEARLY_TRANSCRIPT, new NeutralQuery()); while (yearlyTranscripts.hasNext()) { Entity yearlyTranscript = yearlyTranscripts.next(); String studentId = (String) yearlyTranscript.getBody().get(ParameterConstants.STUDENT_ID); final Map<String, DateTime> studentEdOrgs = studentDatedCache.getEntriesById(studentId); Set<String> studentAcademicRecords = fetchStudentAcademicRecordsFromYearlyTranscript(yearlyTranscript); for (Map.Entry<String, DateTime> studentEdOrg : studentEdOrgs.entrySet()) { if (shouldExtract(yearlyTranscript, studentEdOrg.getValue())) { extractor.extractEntity(yearlyTranscript, map.getExtractFileForEdOrg(studentEdOrg.getKey()), ContainerEntityNames.YEARLY_TRANSCRIPT); for (String sarId : studentAcademicRecords) { studentAcademicRecordDateCache.addEntry(sarId, studentEdOrg.getKey(), studentEdOrg.getValue()); } } } } } YearlyTranscriptExtractor(EntityExtractor extractor, ExtractFileMap map, Repository<Entity> repo,
            EdOrgExtractHelper edOrgExtractHelper); @Override void extractEntities(EntityToEdOrgDateCache studentDatedCache); EntityToEdOrgDateCache getStudentAcademicRecordDateCache();  }