@Test public void testCanNotGetAccessThroughExpiredProgram() { Entity program = helper.generateStudentProgram("Merp", DERP, true); Mockito.when(mockProgramValidator.validate(Mockito.eq(EntityNames.PROGRAM), Mockito.anySet())).thenReturn(new HashSet<String>(Arrays.asList(program.getEntityId()))); helper.generateStaffEdorg(STAFF_ID, DERP, NOT_EXPIRED); for (int j = -1; j > -31; --j) { String studentId = helper.generateStudentAndStudentSchoolAssociation(String.valueOf(j), ED_ORG_ID, NOT_EXPIRED); studentIds.add(studentId); } studentIds.add("Merp"); assertFalse(validator.validate(EntityNames.STUDENT, studentIds).equals(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();  }