@Test public void testValidateNegativeHeterogeneousList() { injector.setStudentContext(student1); Set<String> idsToValidate = new HashSet<String>(Arrays.asList(attendance1.getEntityId(),attendance2.getEntityId())); assertFalse(validator.validate(EntityNames.ATTENDANCE, idsToValidate).containsAll(idsToValidate)); idsToValidate = new HashSet<String>(Arrays.asList(studentAcademicRecord1.getEntityId(), studentAcademicRecord2.getEntityId())); assertFalse(validator.validate(EntityNames.STUDENT_ACADEMIC_RECORD, idsToValidate).containsAll(idsToValidate)); }
@Override public Set<String> validate(String entityType, Set<String> ids) throws IllegalStateException { if (!areParametersValid(SUB_STUDENT_ENTITIES, entityType, ids)) { return Collections.emptySet(); } Map<String, Set<String>> studentIds = new HashMap<String, Set<String>>(getIdsContainedInFieldOnEntities(entityType, new ArrayList<String>(ids), ParameterConstants.STUDENT_ID)); return getValidIds(getDirectStudentIds(), studentIds); }
StudentToSubStudentValidator extends AbstractContextValidator { @Override public Set<String> validate(String entityType, Set<String> ids) throws IllegalStateException { if (!areParametersValid(SUB_STUDENT_ENTITIES, entityType, ids)) { return Collections.emptySet(); } Map<String, Set<String>> studentIds = new HashMap<String, Set<String>>(getIdsContainedInFieldOnEntities(entityType, new ArrayList<String>(ids), ParameterConstants.STUDENT_ID)); return getValidIds(getDirectStudentIds(), studentIds); } }
StudentToSubStudentValidator extends AbstractContextValidator { @Override public Set<String> validate(String entityType, Set<String> ids) throws IllegalStateException { if (!areParametersValid(SUB_STUDENT_ENTITIES, entityType, ids)) { return Collections.emptySet(); } Map<String, Set<String>> studentIds = new HashMap<String, Set<String>>(getIdsContainedInFieldOnEntities(entityType, new ArrayList<String>(ids), ParameterConstants.STUDENT_ID)); return getValidIds(getDirectStudentIds(), studentIds); }  }
StudentToSubStudentValidator extends AbstractContextValidator { @Override public Set<String> validate(String entityType, Set<String> ids) throws IllegalStateException { if (!areParametersValid(SUB_STUDENT_ENTITIES, entityType, ids)) { return Collections.emptySet(); } Map<String, Set<String>> studentIds = new HashMap<String, Set<String>>(getIdsContainedInFieldOnEntities(entityType, new ArrayList<String>(ids), ParameterConstants.STUDENT_ID)); return getValidIds(getDirectStudentIds(), studentIds); }  @Override boolean canValidate(String entityType, boolean isTransitive); @Override Set<String> validate(String entityType, Set<String> ids); }
StudentToSubStudentValidator extends AbstractContextValidator { @Override public Set<String> validate(String entityType, Set<String> ids) throws IllegalStateException { if (!areParametersValid(SUB_STUDENT_ENTITIES, entityType, ids)) { return Collections.emptySet(); } Map<String, Set<String>> studentIds = new HashMap<String, Set<String>>(getIdsContainedInFieldOnEntities(entityType, new ArrayList<String>(ids), ParameterConstants.STUDENT_ID)); return getValidIds(getDirectStudentIds(), studentIds); }  @Override boolean canValidate(String entityType, boolean isTransitive); @Override Set<String> validate(String entityType, Set<String> ids);  }