@Test public void testSholdExtractEntities() { List<Entity> seaos = new ArrayList<Entity>(); Map<String, Object> body = new HashMap<String, Object>(); body.put(ParameterConstants.BEGIN_DATE, "2001-05-24"); Entity entity1 = new MongoEntity(EntityNames.STUDENT_PROGRAM_ASSOCIATION, body); Map<String, Object> body2 = new HashMap<String, Object>(); body2.put(ParameterConstants.BEGIN_DATE, "2009-01-01"); Entity entity2 = new MongoEntity(EntityNames.STUDENT_PROGRAM_ASSOCIATION, body); seaos.add(entity1); seaos.add(entity2); seaos.add(createSEOA("2002-01-01", "2003-01-01")); seaos.add(createSEOA("2005-01-01", "2008-01-01")); Assert.assertFalse(tsaev.shouldExtract(seaos, DateTime.parse("2001-05-23", DateHelper.getDateTimeFormat()))); Assert.assertTrue(tsaev.shouldExtract(seaos, DateTime.parse("2010-05-23", DateHelper.getDateTimeFormat()))); Assert.assertTrue(tsaev.shouldExtract(seaos, DateTime.parse("2006-05-23", DateHelper.getDateTimeFormat()))); }
@Override public boolean shouldExtract(Entity entity, DateTime upToDate) { Iterable<Entity> seaos = edOrgExtractHelper.retrieveSEOAS((String) entity.getBody().get(ParameterConstants.TEACHER_ID), (String) entity.getBody().get(ParameterConstants.SCHOOL_ID)); return shouldExtract(seaos, upToDate); }
TeacherSchoolAssociationExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { Iterable<Entity> seaos = edOrgExtractHelper.retrieveSEOAS((String) entity.getBody().get(ParameterConstants.TEACHER_ID), (String) entity.getBody().get(ParameterConstants.SCHOOL_ID)); return shouldExtract(seaos, upToDate); } }
TeacherSchoolAssociationExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { Iterable<Entity> seaos = edOrgExtractHelper.retrieveSEOAS((String) entity.getBody().get(ParameterConstants.TEACHER_ID), (String) entity.getBody().get(ParameterConstants.SCHOOL_ID)); return shouldExtract(seaos, upToDate); }  }
TeacherSchoolAssociationExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { Iterable<Entity> seaos = edOrgExtractHelper.retrieveSEOAS((String) entity.getBody().get(ParameterConstants.TEACHER_ID), (String) entity.getBody().get(ParameterConstants.SCHOOL_ID)); return shouldExtract(seaos, upToDate); }  @Override boolean shouldExtract(Entity entity, DateTime upToDate); }
TeacherSchoolAssociationExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { Iterable<Entity> seaos = edOrgExtractHelper.retrieveSEOAS((String) entity.getBody().get(ParameterConstants.TEACHER_ID), (String) entity.getBody().get(ParameterConstants.SCHOOL_ID)); return shouldExtract(seaos, upToDate); }  @Override boolean shouldExtract(Entity entity, DateTime upToDate);  }