@Test public void testSingleStudent() { Entity disciplineAction = Mockito.mock(Entity.class); Map<String, Object> body = new HashMap<String, Object>(); body.put(ParameterConstants.STUDENT_ID, Arrays.asList("student1")); Mockito.when(disciplineAction.getBody()).thenReturn(body); Mockito.when(studentResolver.findGoverningEdOrgs("student1", disciplineAction)).thenReturn(new HashSet<String>(Arrays.asList("edOrg1"))); Assert.assertEquals(new HashSet<String>(Arrays.asList("edOrg1")), resolver.findGoverningEdOrgs(disciplineAction)); }
@Override public Set<String> findGoverningEdOrgs(Entity entity) { Set<String> edOrgs = new HashSet<String>(); List<String> studentIds = (List<String>) entity.getBody().get(ParameterConstants.STUDENT_ID); for(String studentId: studentIds){ edOrgs.addAll(studentResolver.findGoverningEdOrgs(studentId, entity)); } return edOrgs; }
DisciplineActionContextResolver implements ContextResolver { @Override public Set<String> findGoverningEdOrgs(Entity entity) { Set<String> edOrgs = new HashSet<String>(); List<String> studentIds = (List<String>) entity.getBody().get(ParameterConstants.STUDENT_ID); for(String studentId: studentIds){ edOrgs.addAll(studentResolver.findGoverningEdOrgs(studentId, entity)); } return edOrgs; } }
DisciplineActionContextResolver implements ContextResolver { @Override public Set<String> findGoverningEdOrgs(Entity entity) { Set<String> edOrgs = new HashSet<String>(); List<String> studentIds = (List<String>) entity.getBody().get(ParameterConstants.STUDENT_ID); for(String studentId: studentIds){ edOrgs.addAll(studentResolver.findGoverningEdOrgs(studentId, entity)); } return edOrgs; }  }
DisciplineActionContextResolver implements ContextResolver { @Override public Set<String> findGoverningEdOrgs(Entity entity) { Set<String> edOrgs = new HashSet<String>(); List<String> studentIds = (List<String>) entity.getBody().get(ParameterConstants.STUDENT_ID); for(String studentId: studentIds){ edOrgs.addAll(studentResolver.findGoverningEdOrgs(studentId, entity)); } return edOrgs; }  @Override Set<String> findGoverningEdOrgs(Entity entity); }
DisciplineActionContextResolver implements ContextResolver { @Override public Set<String> findGoverningEdOrgs(Entity entity) { Set<String> edOrgs = new HashSet<String>(); List<String> studentIds = (List<String>) entity.getBody().get(ParameterConstants.STUDENT_ID); for(String studentId: studentIds){ edOrgs.addAll(studentResolver.findGoverningEdOrgs(studentId, entity)); } return edOrgs; }  @Override Set<String> findGoverningEdOrgs(Entity entity);  }