@Test public void canResolveTeacherAndStaffRelatedEntities() { assertEquals(ParameterConstants.TEACHER_ID, resolver.getReferenceProperty(EntityNames.TEACHER_SCHOOL_ASSOCIATION)); assertEquals(ParameterConstants.TEACHER_ID, resolver.getReferenceProperty(EntityNames.TEACHER_SECTION_ASSOCIATION)); assertEquals(ParameterConstants.STAFF_REFERENCE, resolver.getReferenceProperty(EntityNames.STAFF_ED_ORG_ASSOCIATION)); assertEquals(ParameterConstants.STAFF_ID, resolver.getReferenceProperty(EntityNames.STAFF_COHORT_ASSOCIATION)); assertEquals(ParameterConstants.STAFF_ID, resolver.getReferenceProperty(EntityNames.STAFF_PROGRAM_ASSOCIATION)); assertEquals(null, resolver.getReferenceProperty(EntityNames.STAFF)); assertEquals(null, resolver.getReferenceProperty(EntityNames.TEACHER)); }
@Override protected String getReferenceProperty(String entityType) { if (EntityNames.TEACHER_SCHOOL_ASSOCIATION.equals(entityType) || EntityNames.TEACHER_SECTION_ASSOCIATION.equals(entityType)) { return ParameterConstants.TEACHER_ID; } if (EntityNames.STAFF_ED_ORG_ASSOCIATION.equals(entityType)) { return ParameterConstants.STAFF_REFERENCE; } if (EntityNames.STAFF_COHORT_ASSOCIATION.equals(entityType) || EntityNames.STAFF_PROGRAM_ASSOCIATION.equals(entityType)) { return ParameterConstants.STAFF_ID; } return null; }
StaffTeacherDirectRelatedContextResolver extends RelatedContextResolver { @Override protected String getReferenceProperty(String entityType) { if (EntityNames.TEACHER_SCHOOL_ASSOCIATION.equals(entityType) || EntityNames.TEACHER_SECTION_ASSOCIATION.equals(entityType)) { return ParameterConstants.TEACHER_ID; } if (EntityNames.STAFF_ED_ORG_ASSOCIATION.equals(entityType)) { return ParameterConstants.STAFF_REFERENCE; } if (EntityNames.STAFF_COHORT_ASSOCIATION.equals(entityType) || EntityNames.STAFF_PROGRAM_ASSOCIATION.equals(entityType)) { return ParameterConstants.STAFF_ID; } return null; } }
StaffTeacherDirectRelatedContextResolver extends RelatedContextResolver { @Override protected String getReferenceProperty(String entityType) { if (EntityNames.TEACHER_SCHOOL_ASSOCIATION.equals(entityType) || EntityNames.TEACHER_SECTION_ASSOCIATION.equals(entityType)) { return ParameterConstants.TEACHER_ID; } if (EntityNames.STAFF_ED_ORG_ASSOCIATION.equals(entityType)) { return ParameterConstants.STAFF_REFERENCE; } if (EntityNames.STAFF_COHORT_ASSOCIATION.equals(entityType) || EntityNames.STAFF_PROGRAM_ASSOCIATION.equals(entityType)) { return ParameterConstants.STAFF_ID; } return null; }  }
StaffTeacherDirectRelatedContextResolver extends RelatedContextResolver { @Override protected String getReferenceProperty(String entityType) { if (EntityNames.TEACHER_SCHOOL_ASSOCIATION.equals(entityType) || EntityNames.TEACHER_SECTION_ASSOCIATION.equals(entityType)) { return ParameterConstants.TEACHER_ID; } if (EntityNames.STAFF_ED_ORG_ASSOCIATION.equals(entityType)) { return ParameterConstants.STAFF_REFERENCE; } if (EntityNames.STAFF_COHORT_ASSOCIATION.equals(entityType) || EntityNames.STAFF_PROGRAM_ASSOCIATION.equals(entityType)) { return ParameterConstants.STAFF_ID; } return null; }   }
StaffTeacherDirectRelatedContextResolver extends RelatedContextResolver { @Override protected String getReferenceProperty(String entityType) { if (EntityNames.TEACHER_SCHOOL_ASSOCIATION.equals(entityType) || EntityNames.TEACHER_SECTION_ASSOCIATION.equals(entityType)) { return ParameterConstants.TEACHER_ID; } if (EntityNames.STAFF_ED_ORG_ASSOCIATION.equals(entityType)) { return ParameterConstants.STAFF_REFERENCE; } if (EntityNames.STAFF_COHORT_ASSOCIATION.equals(entityType) || EntityNames.STAFF_PROGRAM_ASSOCIATION.equals(entityType)) { return ParameterConstants.STAFF_ID; } return null; }    }