@Test public void testCanNotGetAccessThroughManyStudentsWithOneFailure() throws Exception { for (int i = 0; i < N_TEST_EDORGS/2; ++i) { helper.generateStaffEdorg(STAFF_ID, edorgArray[ i ], NOT_EXPIRED); injector.addToAuthorizingEdOrgs( edorgArray[ i ] ); } Set<String> expected = new HashSet<String>(); for (int i = 0; i < N_TEST_EDORGS/2; ++i) { for (int j = -1; j > -31; --j) { String studentId = helper.generateStudentAndStudentSchoolAssociation(String.valueOf(j), edorgArray[ i ], NOT_EXPIRED); studentIds.add(studentId); expected.add(studentId); } } String anotherEdOrg = helper.generateSchoolEdOrg(null).getEntityId(); String studentId = helper.generateStudentAndStudentSchoolAssociation("-32", anotherEdOrg, NOT_EXPIRED); studentIds.add(studentId); Assert.assertEquals(expected, validator.validate(EntityNames.STUDENT, studentIds)); }
@Override public Set<String> validate(String entityType, Set<String> studentIds) throws IllegalStateException { LOG.debug(">>>StaffToStudentValidator.validate(?)", entityType); LOG.debug(" studentIds: {}", (studentIds==null) ? "null" : studentIds.toString() ); if (!areParametersValid(EntityNames.STUDENT, entityType, studentIds)) { LOG.debug(" !areParametersValid"); return new HashSet<String>(); } return validateStaffToStudentContextThroughSharedEducationOrganization(studentIds); }
StaffToStudentValidator extends AbstractContextValidator { @Override public Set<String> validate(String entityType, Set<String> studentIds) throws IllegalStateException { LOG.debug(">>>StaffToStudentValidator.validate(?)", entityType); LOG.debug(" studentIds: {}", (studentIds==null) ? "null" : studentIds.toString() ); if (!areParametersValid(EntityNames.STUDENT, entityType, studentIds)) { LOG.debug(" !areParametersValid"); return new HashSet<String>(); } return validateStaffToStudentContextThroughSharedEducationOrganization(studentIds); } }
StaffToStudentValidator extends AbstractContextValidator { @Override public Set<String> validate(String entityType, Set<String> studentIds) throws IllegalStateException { LOG.debug(">>>StaffToStudentValidator.validate(?)", entityType); LOG.debug(" studentIds: {}", (studentIds==null) ? "null" : studentIds.toString() ); if (!areParametersValid(EntityNames.STUDENT, entityType, studentIds)) { LOG.debug(" !areParametersValid"); return new HashSet<String>(); } return validateStaffToStudentContextThroughSharedEducationOrganization(studentIds); }  }
StaffToStudentValidator extends AbstractContextValidator { @Override public Set<String> validate(String entityType, Set<String> studentIds) throws IllegalStateException { LOG.debug(">>>StaffToStudentValidator.validate(?)", entityType); LOG.debug(" studentIds: {}", (studentIds==null) ? "null" : studentIds.toString() ); if (!areParametersValid(EntityNames.STUDENT, entityType, studentIds)) { LOG.debug(" !areParametersValid"); return new HashSet<String>(); } return validateStaffToStudentContextThroughSharedEducationOrganization(studentIds); }  @Override boolean canValidate(String entityType, boolean isTransitive); @Override Set<String> getValid(String entityType, Set<String> studentIds); @Override Set<String> validate(String entityType, Set<String> studentIds); void setProgramValidator(GenericToProgramValidator programValidator); void setCohortValidator(GenericToCohortValidator cohortValidator); @Override SecurityUtil.UserContext getContext(); }
StaffToStudentValidator extends AbstractContextValidator { @Override public Set<String> validate(String entityType, Set<String> studentIds) throws IllegalStateException { LOG.debug(">>>StaffToStudentValidator.validate(?)", entityType); LOG.debug(" studentIds: {}", (studentIds==null) ? "null" : studentIds.toString() ); if (!areParametersValid(EntityNames.STUDENT, entityType, studentIds)) { LOG.debug(" !areParametersValid"); return new HashSet<String>(); } return validateStaffToStudentContextThroughSharedEducationOrganization(studentIds); }  @Override boolean canValidate(String entityType, boolean isTransitive); @Override Set<String> getValid(String entityType, Set<String> studentIds); @Override Set<String> validate(String entityType, Set<String> studentIds); void setProgramValidator(GenericToProgramValidator programValidator); void setCohortValidator(GenericToCohortValidator cohortValidator); @Override SecurityUtil.UserContext getContext();  }