### Question:
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);  }### Answer:
@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()))); }
@Test public void testshouldExtractTeacherSchoolAssociation() { Entity mSeoa = Mockito.mock(Entity.class); Map<String, Object> body = new HashMap<String, Object>(); body.put(ParameterConstants.BEGIN_DATE, "2009-09-02"); body.put(ParameterConstants.END_DATE, "2010-05-31"); Mockito.when(mSeoa.getBody()).thenReturn(body); Mockito.when(mSeoa.getType()).thenReturn(EntityNames.STAFF_ED_ORG_ASSOCIATION); Mockito.when(edOrgExtractHelper.retrieveSEOAS(Matchers.eq("Staff1"), Matchers.eq("LEA"))).thenReturn(Arrays.asList(mSeoa)); Map<String, Object> tsaBody = new HashMap<String, Object>(); tsaBody.put(ParameterConstants.TEACHER_ID, "Staff1"); tsaBody.put(ParameterConstants.SCHOOL_ID, "LEA"); Entity tsa = Mockito.mock(Entity.class); Mockito.when(tsa.getBody()).thenReturn(tsaBody); Mockito.when(tsa.getType()).thenReturn(EntityNames.TEACHER_SCHOOL_ASSOCIATION); Assert.assertTrue(tsaev.shouldExtract(tsa, DateTime.parse("2011-05-23", DateHelper.getDateTimeFormat()))); Assert.assertTrue(tsaev.shouldExtract(tsa, DateTime.parse("2009-09-02", DateHelper.getDateTimeFormat()))); Assert.assertTrue(tsaev.shouldExtract(tsa, null)); Assert.assertFalse(tsaev.shouldExtract(tsa, DateTime.parse("2009-09-01", DateHelper.getDateTimeFormat()))); Assert.assertFalse(tsaev.shouldExtract(tsa, DateTime.parse("2008-05-24", DateHelper.getDateTimeFormat()))); }