target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test @SuppressWarnings({ "unchecked", "rawtypes" }) public void testAppendOptionalFieldsNoOptionsGiven() { MultivaluedMap map = new MultivaluedMapImpl(); EntityBody body = new EntityBody(); body.put("student", "{\"somekey\":\"somevalue\"}"); List<EntityBody> entities = new ArrayList<EntityBody>(); entities.add(body); ...
@Override public List<EntityBody> add(List<EntityBody> entities, final String resource, MultivaluedMap<String, String> queryParams) { if (factory == null) { return entities; } List<EntityBody> appendedEntities = entities; List<String> optionalFields = new ArrayList<String>(); if (queryParams.get(ParameterConstants.OPTI...
OptionalView implements View { @Override public List<EntityBody> add(List<EntityBody> entities, final String resource, MultivaluedMap<String, String> queryParams) { if (factory == null) { return entities; } List<EntityBody> appendedEntities = entities; List<String> optionalFields = new ArrayList<String>(); if (queryPar...
OptionalView implements View { @Override public List<EntityBody> add(List<EntityBody> entities, final String resource, MultivaluedMap<String, String> queryParams) { if (factory == null) { return entities; } List<EntityBody> appendedEntities = entities; List<String> optionalFields = new ArrayList<String>(); if (queryPar...
OptionalView implements View { @Override public List<EntityBody> add(List<EntityBody> entities, final String resource, MultivaluedMap<String, String> queryParams) { if (factory == null) { return entities; } List<EntityBody> appendedEntities = entities; List<String> optionalFields = new ArrayList<String>(); if (queryPar...
OptionalView implements View { @Override public List<EntityBody> add(List<EntityBody> entities, final String resource, MultivaluedMap<String, String> queryParams) { if (factory == null) { return entities; } List<EntityBody> appendedEntities = entities; List<String> optionalFields = new ArrayList<String>(); if (queryPar...
@Test public void testExtractOptionalFieldParams() { Map<String, String> values = optionalView.extractOptionalFieldParams("attendances.1"); assertEquals("Should match", "attendances", values.get(OptionalFieldAppenderFactory.APPENDER_PREFIX)); assertEquals("Should match", "1", values.get(OptionalFieldAppenderFactory.PAR...
protected Map<String, String> extractOptionalFieldParams(String optionalFieldValue) { Map<String, String> values = new HashMap<String, String>(); String appender = null, params = null; if (optionalFieldValue.contains(".")) { StringTokenizer st = new StringTokenizer(optionalFieldValue, "."); int index = 0; String token ...
OptionalView implements View { protected Map<String, String> extractOptionalFieldParams(String optionalFieldValue) { Map<String, String> values = new HashMap<String, String>(); String appender = null, params = null; if (optionalFieldValue.contains(".")) { StringTokenizer st = new StringTokenizer(optionalFieldValue, "."...
OptionalView implements View { protected Map<String, String> extractOptionalFieldParams(String optionalFieldValue) { Map<String, String> values = new HashMap<String, String>(); String appender = null, params = null; if (optionalFieldValue.contains(".")) { StringTokenizer st = new StringTokenizer(optionalFieldValue, "."...
OptionalView implements View { protected Map<String, String> extractOptionalFieldParams(String optionalFieldValue) { Map<String, String> values = new HashMap<String, String>(); String appender = null, params = null; if (optionalFieldValue.contains(".")) { StringTokenizer st = new StringTokenizer(optionalFieldValue, "."...
OptionalView implements View { protected Map<String, String> extractOptionalFieldParams(String optionalFieldValue) { Map<String, String> values = new HashMap<String, String>(); String appender = null, params = null; if (optionalFieldValue.contains(".")) { StringTokenizer st = new StringTokenizer(optionalFieldValue, "."...
@Test public void testGetViewGenerator() { assertTrue("Should be of type studentassessment", factory.getOptionalFieldAppender(ResourceNames.SECTIONS + "_" + ParameterConstants.OPTIONAL_FIELD_ASSESSMENTS) instanceof StudentAssessmentOptionalFieldAppender); assertTrue("Should be of type studentgradebook", factory.getOpti...
public OptionalFieldAppender getOptionalFieldAppender(String type) { return generators.get(type); }
OptionalFieldAppenderFactory { public OptionalFieldAppender getOptionalFieldAppender(String type) { return generators.get(type); } }
OptionalFieldAppenderFactory { public OptionalFieldAppender getOptionalFieldAppender(String type) { return generators.get(type); } }
OptionalFieldAppenderFactory { public OptionalFieldAppender getOptionalFieldAppender(String type) { return generators.get(type); } OptionalFieldAppender getOptionalFieldAppender(String type); }
OptionalFieldAppenderFactory { public OptionalFieldAppender getOptionalFieldAppender(String type) { return generators.get(type); } OptionalFieldAppender getOptionalFieldAppender(String type); static final String APPENDER_PREFIX; static final String PARAM_PREFIX; }
@Test public void testGetEntityFromList() { EntityBody body = helper.getEntityFromList(createEntityList(true), "field1", "2"); assertEquals("Should match", "2", body.get("field1")); assertEquals("Should match", "2", body.get("field2")); assertEquals("Should match", "2", body.get("id")); body = helper.getEntityFromList(...
public EntityBody getEntityFromList(List<EntityBody> list, String field, String value) { if (list == null || field == null || value == null) { return null; } for (EntityBody e : list) { if (value.equals(e.get(field))) { return e; } } return null; }
OptionalFieldAppenderHelper { public EntityBody getEntityFromList(List<EntityBody> list, String field, String value) { if (list == null || field == null || value == null) { return null; } for (EntityBody e : list) { if (value.equals(e.get(field))) { return e; } } return null; } }
OptionalFieldAppenderHelper { public EntityBody getEntityFromList(List<EntityBody> list, String field, String value) { if (list == null || field == null || value == null) { return null; } for (EntityBody e : list) { if (value.equals(e.get(field))) { return e; } } return null; } }
OptionalFieldAppenderHelper { public EntityBody getEntityFromList(List<EntityBody> list, String field, String value) { if (list == null || field == null || value == null) { return null; } for (EntityBody e : list) { if (value.equals(e.get(field))) { return e; } } return null; } List<EntityBody> queryEntities(String re...
OptionalFieldAppenderHelper { public EntityBody getEntityFromList(List<EntityBody> list, String field, String value) { if (list == null || field == null || value == null) { return null; } for (EntityBody e : list) { if (value.equals(e.get(field))) { return e; } } return null; } List<EntityBody> queryEntities(String re...
@Test public void testGetEntitySubList() { List<EntityBody> list = helper.getEntitySubList(createEntityList(true), "field1", "3"); assertEquals("Should match", 2, list.size()); assertEquals("Should match", "3", list.get(0).get("field1")); assertEquals("Should match", "3", list.get(1).get("field1")); list = helper.getEn...
public List<EntityBody> getEntitySubList(List<EntityBody> list, String field, String value) { List<EntityBody> results = new ArrayList<EntityBody>(); if (list == null || field == null || value == null) { return results; } for (EntityBody e : list) { if (value.equals(e.get(field))) { results.add(e); } } return results; ...
OptionalFieldAppenderHelper { public List<EntityBody> getEntitySubList(List<EntityBody> list, String field, String value) { List<EntityBody> results = new ArrayList<EntityBody>(); if (list == null || field == null || value == null) { return results; } for (EntityBody e : list) { if (value.equals(e.get(field))) { result...
OptionalFieldAppenderHelper { public List<EntityBody> getEntitySubList(List<EntityBody> list, String field, String value) { List<EntityBody> results = new ArrayList<EntityBody>(); if (list == null || field == null || value == null) { return results; } for (EntityBody e : list) { if (value.equals(e.get(field))) { result...
OptionalFieldAppenderHelper { public List<EntityBody> getEntitySubList(List<EntityBody> list, String field, String value) { List<EntityBody> results = new ArrayList<EntityBody>(); if (list == null || field == null || value == null) { return results; } for (EntityBody e : list) { if (value.equals(e.get(field))) { result...
OptionalFieldAppenderHelper { public List<EntityBody> getEntitySubList(List<EntityBody> list, String field, String value) { List<EntityBody> results = new ArrayList<EntityBody>(); if (list == null || field == null || value == null) { return results; } for (EntityBody e : list) { if (value.equals(e.get(field))) { result...
@Test public void testGetIdList() { List<String> list = helper.getIdList(createEntityList(true), "id"); assertEquals("Should match", 4, list.size()); assertTrue("Should contain", list.contains("1")); assertTrue("Should contain", list.contains("2")); assertTrue("Should contain", list.contains("3")); assertTrue("Should c...
public List<String> getIdList(List<EntityBody> list, String field) { List<String> ids = new ArrayList<String>(); if (list == null || field == null) { return ids; } for (EntityBody e : list) { if (e.get(field) != null) { ids.add((String) e.get(field)); } } return ids; }
OptionalFieldAppenderHelper { public List<String> getIdList(List<EntityBody> list, String field) { List<String> ids = new ArrayList<String>(); if (list == null || field == null) { return ids; } for (EntityBody e : list) { if (e.get(field) != null) { ids.add((String) e.get(field)); } } return ids; } }
OptionalFieldAppenderHelper { public List<String> getIdList(List<EntityBody> list, String field) { List<String> ids = new ArrayList<String>(); if (list == null || field == null) { return ids; } for (EntityBody e : list) { if (e.get(field) != null) { ids.add((String) e.get(field)); } } return ids; } }
OptionalFieldAppenderHelper { public List<String> getIdList(List<EntityBody> list, String field) { List<String> ids = new ArrayList<String>(); if (list == null || field == null) { return ids; } for (EntityBody e : list) { if (e.get(field) != null) { ids.add((String) e.get(field)); } } return ids; } List<EntityBody> qu...
OptionalFieldAppenderHelper { public List<String> getIdList(List<EntityBody> list, String field) { List<String> ids = new ArrayList<String>(); if (list == null || field == null) { return ids; } for (EntityBody e : list) { if (e.get(field) != null) { ids.add((String) e.get(field)); } } return ids; } List<EntityBody> qu...
@Test public void testSectionIds() { Set<String> list = helper.getSectionIds(createEntityList(true)); assertEquals("Should match", 4, list.size()); assertTrue("Should be true", list.contains("1")); assertTrue("Should be true", list.contains("2")); assertTrue("Should be true", list.contains("3")); assertTrue("Should be ...
public Set<String> getSectionIds(List<EntityBody> entities) { Set<String> sectionIds = new HashSet<String>(); for (EntityBody e : entities) { List<EntityBody> associations = (List<EntityBody>) e.get("studentSectionAssociation"); if (associations == null) { continue; } for (EntityBody association : associations) { secti...
OptionalFieldAppenderHelper { public Set<String> getSectionIds(List<EntityBody> entities) { Set<String> sectionIds = new HashSet<String>(); for (EntityBody e : entities) { List<EntityBody> associations = (List<EntityBody>) e.get("studentSectionAssociation"); if (associations == null) { continue; } for (EntityBody assoc...
OptionalFieldAppenderHelper { public Set<String> getSectionIds(List<EntityBody> entities) { Set<String> sectionIds = new HashSet<String>(); for (EntityBody e : entities) { List<EntityBody> associations = (List<EntityBody>) e.get("studentSectionAssociation"); if (associations == null) { continue; } for (EntityBody assoc...
OptionalFieldAppenderHelper { public Set<String> getSectionIds(List<EntityBody> entities) { Set<String> sectionIds = new HashSet<String>(); for (EntityBody e : entities) { List<EntityBody> associations = (List<EntityBody>) e.get("studentSectionAssociation"); if (associations == null) { continue; } for (EntityBody assoc...
OptionalFieldAppenderHelper { public Set<String> getSectionIds(List<EntityBody> entities) { Set<String> sectionIds = new HashSet<String>(); for (EntityBody e : entities) { List<EntityBody> associations = (List<EntityBody>) e.get("studentSectionAssociation"); if (associations == null) { continue; } for (EntityBody assoc...
@Test public void testSectionIdsNoAssociation() { Set<String> list = helper.getSectionIds(createEntityList(false)); assertTrue("List should be empty", list.isEmpty()); }
public Set<String> getSectionIds(List<EntityBody> entities) { Set<String> sectionIds = new HashSet<String>(); for (EntityBody e : entities) { List<EntityBody> associations = (List<EntityBody>) e.get("studentSectionAssociation"); if (associations == null) { continue; } for (EntityBody association : associations) { secti...
OptionalFieldAppenderHelper { public Set<String> getSectionIds(List<EntityBody> entities) { Set<String> sectionIds = new HashSet<String>(); for (EntityBody e : entities) { List<EntityBody> associations = (List<EntityBody>) e.get("studentSectionAssociation"); if (associations == null) { continue; } for (EntityBody assoc...
OptionalFieldAppenderHelper { public Set<String> getSectionIds(List<EntityBody> entities) { Set<String> sectionIds = new HashSet<String>(); for (EntityBody e : entities) { List<EntityBody> associations = (List<EntityBody>) e.get("studentSectionAssociation"); if (associations == null) { continue; } for (EntityBody assoc...
OptionalFieldAppenderHelper { public Set<String> getSectionIds(List<EntityBody> entities) { Set<String> sectionIds = new HashSet<String>(); for (EntityBody e : entities) { List<EntityBody> associations = (List<EntityBody>) e.get("studentSectionAssociation"); if (associations == null) { continue; } for (EntityBody assoc...
OptionalFieldAppenderHelper { public Set<String> getSectionIds(List<EntityBody> entities) { Set<String> sectionIds = new HashSet<String>(); for (EntityBody e : entities) { List<EntityBody> associations = (List<EntityBody>) e.get("studentSectionAssociation"); if (associations == null) { continue; } for (EntityBody assoc...
@Test public void testApplyOptionalField() { List<EntityBody> entities = new ArrayList<EntityBody>(); entities.add(new EntityBody(createTestStudentEntityWithSectionAssociation(STUDENT_ID, SECTION_ID))); entities = studentGradebookOptionalFieldAppender.applyOptionalField(entities, null); assertEquals("Should be 1", 1, e...
@Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> sectionIds = new ArrayList<String>(optionalFieldAppenderHelper.getSectionIds(entities)); List<EntityBody> studentGradebookEntries; if (sectionIds.size() != 0) { studentGradebookEntries = optionalFieldAppend...
StudentGradebookOptionalFieldAppender implements OptionalFieldAppender { @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> sectionIds = new ArrayList<String>(optionalFieldAppenderHelper.getSectionIds(entities)); List<EntityBody> studentGradebookEntries; if...
StudentGradebookOptionalFieldAppender implements OptionalFieldAppender { @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> sectionIds = new ArrayList<String>(optionalFieldAppenderHelper.getSectionIds(entities)); List<EntityBody> studentGradebookEntries; if...
StudentGradebookOptionalFieldAppender implements OptionalFieldAppender { @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> sectionIds = new ArrayList<String>(optionalFieldAppenderHelper.getSectionIds(entities)); List<EntityBody> studentGradebookEntries; if...
StudentGradebookOptionalFieldAppender implements OptionalFieldAppender { @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> sectionIds = new ArrayList<String>(optionalFieldAppenderHelper.getSectionIds(entities)); List<EntityBody> studentGradebookEntries; if...
@SuppressWarnings("unchecked") @Test public void testApplyOptionalField() { setupMockForApplyOptionalField(); List<EntityBody> entities = new ArrayList<EntityBody>(); entities.add(makeEntityBody(student1Entity)); entities.add(makeEntityBody(student2Entity)); entities = studentAllAttendanceOptionalFieldAppender.applyOpt...
@SuppressWarnings("unchecked") @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); NeutralQuery neutralQuery = new NeutralQuery(); neutralQuery.setLimit(0); neutralQuery.addCriteria(new Neut...
StudentAllAttendanceOptionalFieldAppender implements OptionalFieldAppender { @SuppressWarnings("unchecked") @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); NeutralQuery neutralQuery = ne...
StudentAllAttendanceOptionalFieldAppender implements OptionalFieldAppender { @SuppressWarnings("unchecked") @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); NeutralQuery neutralQuery = ne...
StudentAllAttendanceOptionalFieldAppender implements OptionalFieldAppender { @SuppressWarnings("unchecked") @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); NeutralQuery neutralQuery = ne...
StudentAllAttendanceOptionalFieldAppender implements OptionalFieldAppender { @SuppressWarnings("unchecked") @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); NeutralQuery neutralQuery = ne...
@Test public void testApplyOptionalField() { List<EntityBody> entities = new ArrayList<EntityBody>(); entities.add(new EntityBody(createTestStudentEntity(STUDENT_ID))); entities = studentAssessmentOptionalFieldAppender.applyOptionalField(entities, null); assertEquals("Should be 1", 1, entities.size()); List<EntityBody>...
@Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); List<EntityBody> studentAssessments = optionalFieldAppenderHelper.queryEntities(ResourceNames.STUDENT_ASSESSMENTS, ParameterConstants.STUD...
StudentAssessmentOptionalFieldAppender implements OptionalFieldAppender { @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); List<EntityBody> studentAssessments = optionalFieldAppenderHelpe...
StudentAssessmentOptionalFieldAppender implements OptionalFieldAppender { @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); List<EntityBody> studentAssessments = optionalFieldAppenderHelpe...
StudentAssessmentOptionalFieldAppender implements OptionalFieldAppender { @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); List<EntityBody> studentAssessments = optionalFieldAppenderHelpe...
StudentAssessmentOptionalFieldAppender implements OptionalFieldAppender { @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); List<EntityBody> studentAssessments = optionalFieldAppenderHelpe...
@Test(expected = MissingArgumentException.class) public void missingPasswordValue() throws ParseException, MissingConfigException { String[] args = new String[] { "-u", "user", "-pass", "-s", "server", "-d", "localDir", "-port", "22" }; propUtils.getUploadProperties(args); }
public UploadProperties getUploadProperties(String[] args) throws ParseException, MissingConfigException { CommandLine cmd = parser.parse(OPTIONS, args); String user = cmd.getOptionValue(FLAG_USER); if (user == null) { throw new MissingConfigException(FLAG_USER); } String password = cmd.getOptionValue(FLAG_PASSWORD); i...
PropertyUtils { public UploadProperties getUploadProperties(String[] args) throws ParseException, MissingConfigException { CommandLine cmd = parser.parse(OPTIONS, args); String user = cmd.getOptionValue(FLAG_USER); if (user == null) { throw new MissingConfigException(FLAG_USER); } String password = cmd.getOptionValue(F...
PropertyUtils { public UploadProperties getUploadProperties(String[] args) throws ParseException, MissingConfigException { CommandLine cmd = parser.parse(OPTIONS, args); String user = cmd.getOptionValue(FLAG_USER); if (user == null) { throw new MissingConfigException(FLAG_USER); } String password = cmd.getOptionValue(F...
PropertyUtils { public UploadProperties getUploadProperties(String[] args) throws ParseException, MissingConfigException { CommandLine cmd = parser.parse(OPTIONS, args); String user = cmd.getOptionValue(FLAG_USER); if (user == null) { throw new MissingConfigException(FLAG_USER); } String password = cmd.getOptionValue(F...
PropertyUtils { public UploadProperties getUploadProperties(String[] args) throws ParseException, MissingConfigException { CommandLine cmd = parser.parse(OPTIONS, args); String user = cmd.getOptionValue(FLAG_USER); if (user == null) { throw new MissingConfigException(FLAG_USER); } String password = cmd.getOptionValue(F...
@Test public void testApplyOptionalField() { List<EntityBody> entities = new ArrayList<EntityBody>(); EntityBody body = new EntityBody(); body.putAll(studentEntity.getBody()); body.put("id", studentEntity.getEntityId()); entities.add(body); entities = studentTranscriptOptionalFieldAppender.applyOptionalField(entities, ...
@Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); List<EntityBody> studentSectionAssociations = optionalFieldAppenderHelper.queryEntities(ResourceNames.STUDENT_SECTION_ASSOCIATIONS, Parame...
StudentTranscriptOptionalFieldAppender implements OptionalFieldAppender { @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); List<EntityBody> studentSectionAssociations = optionalFieldAppen...
StudentTranscriptOptionalFieldAppender implements OptionalFieldAppender { @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); List<EntityBody> studentSectionAssociations = optionalFieldAppen...
StudentTranscriptOptionalFieldAppender implements OptionalFieldAppender { @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); List<EntityBody> studentSectionAssociations = optionalFieldAppen...
StudentTranscriptOptionalFieldAppender implements OptionalFieldAppender { @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); List<EntityBody> studentSectionAssociations = optionalFieldAppen...
@Test public void testApplyOptionalField() { List<EntityBody> entities = new ArrayList<EntityBody>(); entities.add(new EntityBody(createTestStudentEntity(STUDENT_ID))); entities = studentGradeLevelOptionalFieldAppender.applyOptionalField(entities, null); assertEquals("Should be 1", 1, entities.size()); assertEquals("Sh...
@Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); List<EntityBody> studentSchoolAssociationList = optionalFieldAppenderHelper.queryEntities( ResourceNames.STUDENT_SCHOOL_ASSOCIATIONS, Para...
StudentGradeLevelOptionalFieldAppender implements OptionalFieldAppender { @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); List<EntityBody> studentSchoolAssociationList = optionalFieldApp...
StudentGradeLevelOptionalFieldAppender implements OptionalFieldAppender { @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); List<EntityBody> studentSchoolAssociationList = optionalFieldApp...
StudentGradeLevelOptionalFieldAppender implements OptionalFieldAppender { @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); List<EntityBody> studentSchoolAssociationList = optionalFieldApp...
StudentGradeLevelOptionalFieldAppender implements OptionalFieldAppender { @Override public List<EntityBody> applyOptionalField(List<EntityBody> entities, String parameters) { List<String> studentIds = optionalFieldAppenderHelper.getIdList(entities, "id"); List<EntityBody> studentSchoolAssociationList = optionalFieldApp...
@Test public void testRead() { Response res = resource.read(); assertNotNull(res); assertEquals(Status.NOT_FOUND.getStatusCode(), res.getStatus()); Mockito.verify(service).getCustom("TEST-ID"); EntityBody mockBody = Mockito.mock(EntityBody.class); Mockito.when(service.getCustom("TEST-ID")).thenReturn(mockBody); res = r...
@GET @Path("/") public Response read() { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } EntityBody entityBody = entityDefinition.getService().getCustom(entityId); if (entityBody == null) { return Response.status(Status.NOT_FOUND).build(); } return Response.status(Status.OK).entity(e...
CustomEntityResource { @GET @Path("/") public Response read() { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } EntityBody entityBody = entityDefinition.getService().getCustom(entityId); if (entityBody == null) { return Response.status(Status.NOT_FOUND).build(); } return Response.sta...
CustomEntityResource { @GET @Path("/") public Response read() { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } EntityBody entityBody = entityDefinition.getService().getCustom(entityId); if (entityBody == null) { return Response.status(Status.NOT_FOUND).build(); } return Response.sta...
CustomEntityResource { @GET @Path("/") public Response read() { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } EntityBody entityBody = entityDefinition.getService().getCustom(entityId); if (entityBody == null) { return Response.status(Status.NOT_FOUND).build(); } return Response.sta...
CustomEntityResource { @GET @Path("/") public Response read() { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } EntityBody entityBody = entityDefinition.getService().getCustom(entityId); if (entityBody == null) { return Response.status(Status.NOT_FOUND).build(); } return Response.sta...
@Test public void testCreateOrUpdatePUT() { EntityBody test = new EntityBody(); Response res = resource.createOrUpdatePut(test); assertNotNull(res); assertEquals(Status.NO_CONTENT.getStatusCode(), res.getStatus()); Mockito.verify(service).createOrUpdateCustom("TEST-ID", test); }
@PUT @Path("/") public Response createOrUpdatePut(final EntityBody customEntity) { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().createOrUpdateCustom(entityId, customEntity); return Response.status(Status.NO_CONTENT).build(); }
CustomEntityResource { @PUT @Path("/") public Response createOrUpdatePut(final EntityBody customEntity) { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().createOrUpdateCustom(entityId, customEntity); return Response.status(Status.NO_CONTENT).build(); } }
CustomEntityResource { @PUT @Path("/") public Response createOrUpdatePut(final EntityBody customEntity) { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().createOrUpdateCustom(entityId, customEntity); return Response.status(Status.NO_CONTENT).build(); } C...
CustomEntityResource { @PUT @Path("/") public Response createOrUpdatePut(final EntityBody customEntity) { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().createOrUpdateCustom(entityId, customEntity); return Response.status(Status.NO_CONTENT).build(); } C...
CustomEntityResource { @PUT @Path("/") public Response createOrUpdatePut(final EntityBody customEntity) { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().createOrUpdateCustom(entityId, customEntity); return Response.status(Status.NO_CONTENT).build(); } C...
@Test public void testCreateOrUpdatePOST() { EntityBody test = new EntityBody(); UriInfo uriInfo = Mockito.mock(UriInfo.class); final UriBuilder uriBuilder = Mockito.mock(UriBuilder.class); Mockito.when(uriInfo.getBaseUriBuilder()).thenReturn(uriBuilder); final StringBuilder path = new StringBuilder(); Mockito.when(uri...
@POST @Path("/") public Response createOrUpdatePost(@Context final UriInfo uriInfo, final EntityBody customEntity) { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().createOrUpdateCustom(entityId, customEntity); String uri = ResourceUtil.getURI(uriInfo, r...
CustomEntityResource { @POST @Path("/") public Response createOrUpdatePost(@Context final UriInfo uriInfo, final EntityBody customEntity) { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().createOrUpdateCustom(entityId, customEntity); String uri = Resourc...
CustomEntityResource { @POST @Path("/") public Response createOrUpdatePost(@Context final UriInfo uriInfo, final EntityBody customEntity) { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().createOrUpdateCustom(entityId, customEntity); String uri = Resourc...
CustomEntityResource { @POST @Path("/") public Response createOrUpdatePost(@Context final UriInfo uriInfo, final EntityBody customEntity) { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().createOrUpdateCustom(entityId, customEntity); String uri = Resourc...
CustomEntityResource { @POST @Path("/") public Response createOrUpdatePost(@Context final UriInfo uriInfo, final EntityBody customEntity) { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().createOrUpdateCustom(entityId, customEntity); String uri = Resourc...
@Test public void testDelete() { Response res = resource.delete(); assertNotNull(res); assertEquals(Status.NO_CONTENT.getStatusCode(), res.getStatus()); Mockito.verify(service).deleteCustom("TEST-ID"); }
@DELETE @Path("/") public Response delete() { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().deleteCustom(entityId); return Response.status(Status.NO_CONTENT).build(); }
CustomEntityResource { @DELETE @Path("/") public Response delete() { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().deleteCustom(entityId); return Response.status(Status.NO_CONTENT).build(); } }
CustomEntityResource { @DELETE @Path("/") public Response delete() { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().deleteCustom(entityId); return Response.status(Status.NO_CONTENT).build(); } CustomEntityResource(final String entityId, final EntityDefi...
CustomEntityResource { @DELETE @Path("/") public Response delete() { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().deleteCustom(entityId); return Response.status(Status.NO_CONTENT).build(); } CustomEntityResource(final String entityId, final EntityDefi...
CustomEntityResource { @DELETE @Path("/") public Response delete() { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().deleteCustom(entityId); return Response.status(Status.NO_CONTENT).build(); } CustomEntityResource(final String entityId, final EntityDefi...
@Test public void testInvalidURL() throws URISyntaxException { assertFalse("Should not validate", validator.validate(new URI("http: assertFalse("Should not validate", validator.validate(new URI("http: }
@Override public boolean validate(URI url) { String[] schemes = {"http", "https"}; UrlValidator validator = new UrlValidator(schemes); return validator.isValid(url.toString()); }
SimpleURLValidator implements URLValidator { @Override public boolean validate(URI url) { String[] schemes = {"http", "https"}; UrlValidator validator = new UrlValidator(schemes); return validator.isValid(url.toString()); } }
SimpleURLValidator implements URLValidator { @Override public boolean validate(URI url) { String[] schemes = {"http", "https"}; UrlValidator validator = new UrlValidator(schemes); return validator.isValid(url.toString()); } }
SimpleURLValidator implements URLValidator { @Override public boolean validate(URI url) { String[] schemes = {"http", "https"}; UrlValidator validator = new UrlValidator(schemes); return validator.isValid(url.toString()); } @Override boolean validate(URI url); }
SimpleURLValidator implements URLValidator { @Override public boolean validate(URI url) { String[] schemes = {"http", "https"}; UrlValidator validator = new UrlValidator(schemes); return validator.isValid(url.toString()); } @Override boolean validate(URI url); }
@Test public void testValidURL() throws URISyntaxException { assertTrue("Should validate", validator.validate(new URI("http: assertTrue("Should validate", validator.validate(new URI("http: }
@Override public boolean validate(URI url) { String[] schemes = {"http", "https"}; UrlValidator validator = new UrlValidator(schemes); return validator.isValid(url.toString()); }
SimpleURLValidator implements URLValidator { @Override public boolean validate(URI url) { String[] schemes = {"http", "https"}; UrlValidator validator = new UrlValidator(schemes); return validator.isValid(url.toString()); } }
SimpleURLValidator implements URLValidator { @Override public boolean validate(URI url) { String[] schemes = {"http", "https"}; UrlValidator validator = new UrlValidator(schemes); return validator.isValid(url.toString()); } }
SimpleURLValidator implements URLValidator { @Override public boolean validate(URI url) { String[] schemes = {"http", "https"}; UrlValidator validator = new UrlValidator(schemes); return validator.isValid(url.toString()); } @Override boolean validate(URI url); }
SimpleURLValidator implements URLValidator { @Override public boolean validate(URI url) { String[] schemes = {"http", "https"}; UrlValidator validator = new UrlValidator(schemes); return validator.isValid(url.toString()); } @Override boolean validate(URI url); }
@Test public void testInvalidQueryString() throws URISyntaxException { assertFalse("Should not validate", queryStringValidator.validate(new URI("http: }
@Override public boolean validate(URI url) { String queryString = url.getQuery(); if (queryString != null && !queryString.isEmpty()) { queryString = queryString.replaceAll(">", "").replaceAll("<", ""); for (AbstractBlacklistStrategy abstractBlacklistStrategy : validationStrategyList) { if (!abstractBlacklistStrategy.is...
QueryStringValidator implements URLValidator { @Override public boolean validate(URI url) { String queryString = url.getQuery(); if (queryString != null && !queryString.isEmpty()) { queryString = queryString.replaceAll(">", "").replaceAll("<", ""); for (AbstractBlacklistStrategy abstractBlacklistStrategy : validationSt...
QueryStringValidator implements URLValidator { @Override public boolean validate(URI url) { String queryString = url.getQuery(); if (queryString != null && !queryString.isEmpty()) { queryString = queryString.replaceAll(">", "").replaceAll("<", ""); for (AbstractBlacklistStrategy abstractBlacklistStrategy : validationSt...
QueryStringValidator implements URLValidator { @Override public boolean validate(URI url) { String queryString = url.getQuery(); if (queryString != null && !queryString.isEmpty()) { queryString = queryString.replaceAll(">", "").replaceAll("<", ""); for (AbstractBlacklistStrategy abstractBlacklistStrategy : validationSt...
QueryStringValidator implements URLValidator { @Override public boolean validate(URI url) { String queryString = url.getQuery(); if (queryString != null && !queryString.isEmpty()) { queryString = queryString.replaceAll(">", "").replaceAll("<", ""); for (AbstractBlacklistStrategy abstractBlacklistStrategy : validationSt...
@Test public void testValidQueryString() throws URISyntaxException, UnsupportedEncodingException { assertTrue("Should validate", queryStringValidator.validate(new URI("http: assertTrue("Should validate", queryStringValidator.validate(new URI("http: + URLEncoder.encode("key<value", "UTF-8")))); assertTrue("Should valida...
@Override public boolean validate(URI url) { String queryString = url.getQuery(); if (queryString != null && !queryString.isEmpty()) { queryString = queryString.replaceAll(">", "").replaceAll("<", ""); for (AbstractBlacklistStrategy abstractBlacklistStrategy : validationStrategyList) { if (!abstractBlacklistStrategy.is...
QueryStringValidator implements URLValidator { @Override public boolean validate(URI url) { String queryString = url.getQuery(); if (queryString != null && !queryString.isEmpty()) { queryString = queryString.replaceAll(">", "").replaceAll("<", ""); for (AbstractBlacklistStrategy abstractBlacklistStrategy : validationSt...
QueryStringValidator implements URLValidator { @Override public boolean validate(URI url) { String queryString = url.getQuery(); if (queryString != null && !queryString.isEmpty()) { queryString = queryString.replaceAll(">", "").replaceAll("<", ""); for (AbstractBlacklistStrategy abstractBlacklistStrategy : validationSt...
QueryStringValidator implements URLValidator { @Override public boolean validate(URI url) { String queryString = url.getQuery(); if (queryString != null && !queryString.isEmpty()) { queryString = queryString.replaceAll(">", "").replaceAll("<", ""); for (AbstractBlacklistStrategy abstractBlacklistStrategy : validationSt...
QueryStringValidator implements URLValidator { @Override public boolean validate(URI url) { String queryString = url.getQuery(); if (queryString != null && !queryString.isEmpty()) { queryString = queryString.replaceAll(">", "").replaceAll("<", ""); for (AbstractBlacklistStrategy abstractBlacklistStrategy : validationSt...
@Test public void testNonRewrite() { PathSegment segment1 = mock(PathSegment.class); when(segment1.getPath()).thenReturn("v5"); PathSegment segment2 = mock(PathSegment.class); when(segment2.getPath()).thenReturn("students"); List<PathSegment> segments = Arrays.asList(segment1, segment2); when(containerRequest.getPathSe...
@Override public ContainerRequest filter(ContainerRequest containerRequest) { List<PathSegment> segments = containerRequest.getPathSegments(); if (!segments.isEmpty()) { String version = segments.get(0).getPath(); boolean isBulkNonVersion = version.equals("bulk"); SortedSet<String> minorVersions = resourceEndPoint.getN...
VersionFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest containerRequest) { List<PathSegment> segments = containerRequest.getPathSegments(); if (!segments.isEmpty()) { String version = segments.get(0).getPath(); boolean isBulkNonVersion = version.equals("bulk"); Sorte...
VersionFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest containerRequest) { List<PathSegment> segments = containerRequest.getPathSegments(); if (!segments.isEmpty()) { String version = segments.get(0).getPath(); boolean isBulkNonVersion = version.equals("bulk"); Sorte...
VersionFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest containerRequest) { List<PathSegment> segments = containerRequest.getPathSegments(); if (!segments.isEmpty()) { String version = segments.get(0).getPath(); boolean isBulkNonVersion = version.equals("bulk"); Sorte...
VersionFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest containerRequest) { List<PathSegment> segments = containerRequest.getPathSegments(); if (!segments.isEmpty()) { String version = segments.get(0).getPath(); boolean isBulkNonVersion = version.equals("bulk"); Sorte...
@Test public void testRewriteNoQuery() throws URISyntaxException { UriBuilder builder = mock(UriBuilder.class); when(builder.path(anyString())).thenReturn(builder); URI uri = new URI("http: PathSegment segment1 = mock(PathSegment.class); when(segment1.getPath()).thenReturn("v1"); PathSegment segment2 = mock(PathSegment...
@Override public ContainerRequest filter(ContainerRequest containerRequest) { List<PathSegment> segments = containerRequest.getPathSegments(); if (!segments.isEmpty()) { String version = segments.get(0).getPath(); boolean isBulkNonVersion = version.equals("bulk"); SortedSet<String> minorVersions = resourceEndPoint.getN...
VersionFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest containerRequest) { List<PathSegment> segments = containerRequest.getPathSegments(); if (!segments.isEmpty()) { String version = segments.get(0).getPath(); boolean isBulkNonVersion = version.equals("bulk"); Sorte...
VersionFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest containerRequest) { List<PathSegment> segments = containerRequest.getPathSegments(); if (!segments.isEmpty()) { String version = segments.get(0).getPath(); boolean isBulkNonVersion = version.equals("bulk"); Sorte...
VersionFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest containerRequest) { List<PathSegment> segments = containerRequest.getPathSegments(); if (!segments.isEmpty()) { String version = segments.get(0).getPath(); boolean isBulkNonVersion = version.equals("bulk"); Sorte...
VersionFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest containerRequest) { List<PathSegment> segments = containerRequest.getPathSegments(); if (!segments.isEmpty()) { String version = segments.get(0).getPath(); boolean isBulkNonVersion = version.equals("bulk"); Sorte...
@Test public void testRewriteWithQuery() throws URISyntaxException { UriBuilder builder = mock(UriBuilder.class); when(builder.path(anyString())).thenReturn(builder); URI uri = new URI("http: PathSegment segment1 = mock(PathSegment.class); when(segment1.getPath()).thenReturn("v1"); PathSegment segment2 = mock(PathSegme...
@Override public ContainerRequest filter(ContainerRequest containerRequest) { List<PathSegment> segments = containerRequest.getPathSegments(); if (!segments.isEmpty()) { String version = segments.get(0).getPath(); boolean isBulkNonVersion = version.equals("bulk"); SortedSet<String> minorVersions = resourceEndPoint.getN...
VersionFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest containerRequest) { List<PathSegment> segments = containerRequest.getPathSegments(); if (!segments.isEmpty()) { String version = segments.get(0).getPath(); boolean isBulkNonVersion = version.equals("bulk"); Sorte...
VersionFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest containerRequest) { List<PathSegment> segments = containerRequest.getPathSegments(); if (!segments.isEmpty()) { String version = segments.get(0).getPath(); boolean isBulkNonVersion = version.equals("bulk"); Sorte...
VersionFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest containerRequest) { List<PathSegment> segments = containerRequest.getPathSegments(); if (!segments.isEmpty()) { String version = segments.get(0).getPath(); boolean isBulkNonVersion = version.equals("bulk"); Sorte...
VersionFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest containerRequest) { List<PathSegment> segments = containerRequest.getPathSegments(); if (!segments.isEmpty()) { String version = segments.get(0).getPath(); boolean isBulkNonVersion = version.equals("bulk"); Sorte...
@Test(expected = QueryParseException.class) public void shouldDisallowVersionOneZeroSearches() { ContainerRequest request = createRequest("v1.0/sections/1234/studentSectionAssociations", "schoolYears=2011-2012"); filter.filter(request); }
@Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validateNotVersionOneZero(request); validateDateSearchUri(re...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
@Test public void shouldAllowVersionOneZeroNonSearchRequests() { ContainerRequest request = createRequest("v1.0/sections/1234/studentSectionAssociations", ""); filter.filter(request); }
@Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validateNotVersionOneZero(request); validateDateSearchUri(re...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
@Test public void shonuldAllowVersionOneOneSearches() { ContainerRequest request = createRequest("v1.1/sections/1234/studentSectionAssociations", "schoolYears=2011-2012"); filter.filter(request); }
@Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validateNotVersionOneZero(request); validateDateSearchUri(re...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
@Test(expected = QueryParseException.class) public void shouldDisallowExcludedUrisWithId() { String disallowedPath = "v1.1/sections/{id}/studentSectionAssociations"; String requestPath = "v1.1/sections/1234,23234/studentSectionAssociations"; disallowedEndpoints.add(disallowedPath); ContainerRequest request = createRequ...
@Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validateNotVersionOneZero(request); validateDateSearchUri(re...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
@Test(expected = QueryParseException.class) public void shouldDisallowTwoPartUris() { String requestPath = "v1.1/sessions/1234567"; ContainerRequest request = createRequest(requestPath, "schoolYears=2011-2012"); filter.filter(request); }
@Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validateNotVersionOneZero(request); validateDateSearchUri(re...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
@Test public void shouldAllowTwoPartUrisWithoutDates() { String requestPath = "v1.1/sessions/1234567"; ContainerRequest request = createRequest(requestPath, ""); filter.filter(request); }
@Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validateNotVersionOneZero(request); validateDateSearchUri(re...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
@Test(expected = QueryParseException.class) public void shouldDisallowExcludedUrisWithoutId() { String disallowedPath = "v1.1/educationOrganizations"; String requestPath = "v1.1/educationOrganizations"; disallowedEndpoints.add(disallowedPath); ContainerRequest request = createRequest(requestPath, "schoolYears=2011-2012...
@Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validateNotVersionOneZero(request); validateDateSearchUri(re...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validat...
@Test public void shouldCatchInvalidDateRange() { List<String> invalidRanges = Arrays.asList("123-1234", "1234-123", "12345-1234", "1234-12345", "123A-1234", "1234-123A", "12341234", "1234--1234", "2001-2001", "2001-2000"); for (String range : invalidRanges) { try { initRepo(); calc.findDateRange(range); Assert.fail("D...
public SessionDateInfo findDateRange(String schoolYearRange) { Pair<String, String> years = parseDateRange(schoolYearRange); Set<String> edOrgIds = edOrgHelper.getDirectEdorgs(); Iterable<Entity> sessions = getSessions(years, edOrgIds); return findMinMaxDates(sessions); }
SessionRangeCalculator { public SessionDateInfo findDateRange(String schoolYearRange) { Pair<String, String> years = parseDateRange(schoolYearRange); Set<String> edOrgIds = edOrgHelper.getDirectEdorgs(); Iterable<Entity> sessions = getSessions(years, edOrgIds); return findMinMaxDates(sessions); } }
SessionRangeCalculator { public SessionDateInfo findDateRange(String schoolYearRange) { Pair<String, String> years = parseDateRange(schoolYearRange); Set<String> edOrgIds = edOrgHelper.getDirectEdorgs(); Iterable<Entity> sessions = getSessions(years, edOrgIds); return findMinMaxDates(sessions); } }
SessionRangeCalculator { public SessionDateInfo findDateRange(String schoolYearRange) { Pair<String, String> years = parseDateRange(schoolYearRange); Set<String> edOrgIds = edOrgHelper.getDirectEdorgs(); Iterable<Entity> sessions = getSessions(years, edOrgIds); return findMinMaxDates(sessions); } SessionDateInfo findD...
SessionRangeCalculator { public SessionDateInfo findDateRange(String schoolYearRange) { Pair<String, String> years = parseDateRange(schoolYearRange); Set<String> edOrgIds = edOrgHelper.getDirectEdorgs(); Iterable<Entity> sessions = getSessions(years, edOrgIds); return findMinMaxDates(sessions); } SessionDateInfo findD...
@Test public void shouldAllowValidDateRange() { initRepo(); SessionDateInfo result = calc.findDateRange("2009-2010"); Assert.assertEquals("Should match", "2006-08-14", result.getStartDate()); Assert.assertEquals("Should match", "2009-05-22", result.getEndDate()); Assert.assertEquals("Should match", 4, result.getSession...
public SessionDateInfo findDateRange(String schoolYearRange) { Pair<String, String> years = parseDateRange(schoolYearRange); Set<String> edOrgIds = edOrgHelper.getDirectEdorgs(); Iterable<Entity> sessions = getSessions(years, edOrgIds); return findMinMaxDates(sessions); }
SessionRangeCalculator { public SessionDateInfo findDateRange(String schoolYearRange) { Pair<String, String> years = parseDateRange(schoolYearRange); Set<String> edOrgIds = edOrgHelper.getDirectEdorgs(); Iterable<Entity> sessions = getSessions(years, edOrgIds); return findMinMaxDates(sessions); } }
SessionRangeCalculator { public SessionDateInfo findDateRange(String schoolYearRange) { Pair<String, String> years = parseDateRange(schoolYearRange); Set<String> edOrgIds = edOrgHelper.getDirectEdorgs(); Iterable<Entity> sessions = getSessions(years, edOrgIds); return findMinMaxDates(sessions); } }
SessionRangeCalculator { public SessionDateInfo findDateRange(String schoolYearRange) { Pair<String, String> years = parseDateRange(schoolYearRange); Set<String> edOrgIds = edOrgHelper.getDirectEdorgs(); Iterable<Entity> sessions = getSessions(years, edOrgIds); return findMinMaxDates(sessions); } SessionDateInfo findD...
SessionRangeCalculator { public SessionDateInfo findDateRange(String schoolYearRange) { Pair<String, String> years = parseDateRange(schoolYearRange); Set<String> edOrgIds = edOrgHelper.getDirectEdorgs(); Iterable<Entity> sessions = getSessions(years, edOrgIds); return findMinMaxDates(sessions); } SessionDateInfo findD...
@Test public void shouldReturnEmptyRanges() { initRepo(Collections.EMPTY_LIST); SessionDateInfo result = calc.findDateRange("2009-2010"); Assert.assertEquals("Should match", "", result.getStartDate()); Assert.assertEquals("Should match", "", result.getEndDate()); Assert.assertEquals("Should match", 0, result.getSession...
public SessionDateInfo findDateRange(String schoolYearRange) { Pair<String, String> years = parseDateRange(schoolYearRange); Set<String> edOrgIds = edOrgHelper.getDirectEdorgs(); Iterable<Entity> sessions = getSessions(years, edOrgIds); return findMinMaxDates(sessions); }
SessionRangeCalculator { public SessionDateInfo findDateRange(String schoolYearRange) { Pair<String, String> years = parseDateRange(schoolYearRange); Set<String> edOrgIds = edOrgHelper.getDirectEdorgs(); Iterable<Entity> sessions = getSessions(years, edOrgIds); return findMinMaxDates(sessions); } }
SessionRangeCalculator { public SessionDateInfo findDateRange(String schoolYearRange) { Pair<String, String> years = parseDateRange(schoolYearRange); Set<String> edOrgIds = edOrgHelper.getDirectEdorgs(); Iterable<Entity> sessions = getSessions(years, edOrgIds); return findMinMaxDates(sessions); } }
SessionRangeCalculator { public SessionDateInfo findDateRange(String schoolYearRange) { Pair<String, String> years = parseDateRange(schoolYearRange); Set<String> edOrgIds = edOrgHelper.getDirectEdorgs(); Iterable<Entity> sessions = getSessions(years, edOrgIds); return findMinMaxDates(sessions); } SessionDateInfo findD...
SessionRangeCalculator { public SessionDateInfo findDateRange(String schoolYearRange) { Pair<String, String> years = parseDateRange(schoolYearRange); Set<String> edOrgIds = edOrgHelper.getDirectEdorgs(); Iterable<Entity> sessions = getSessions(years, edOrgIds); return findMinMaxDates(sessions); } SessionDateInfo findD...
@Test public void testGenerate() throws Exception { ContainerRequest request = mock(ContainerRequest.class); MultivaluedMap<String,String> parameters = mock(MultivaluedMap.class); List<String> schoolYears = new ArrayList<String>(); schoolYears.add("begin"); schoolYears.add("end"); SessionDateInfo sessionDateInfo = new ...
public void generate(ContainerRequest request) { List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null && schoolYears.size() > 0) { String schoolYearRange = schoolYears.get(0); SessionDateInfo sessionDateInfo = sessionRangeCalculator.findDateRange(schoolYe...
DateFilterCriteriaGenerator { public void generate(ContainerRequest request) { List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null && schoolYears.size() > 0) { String schoolYearRange = schoolYears.get(0); SessionDateInfo sessionDateInfo = sessionRangeCal...
DateFilterCriteriaGenerator { public void generate(ContainerRequest request) { List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null && schoolYears.size() > 0) { String schoolYearRange = schoolYears.get(0); SessionDateInfo sessionDateInfo = sessionRangeCal...
DateFilterCriteriaGenerator { public void generate(ContainerRequest request) { List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null && schoolYears.size() > 0) { String schoolYearRange = schoolYears.get(0); SessionDateInfo sessionDateInfo = sessionRangeCal...
DateFilterCriteriaGenerator { public void generate(ContainerRequest request) { List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null && schoolYears.size() > 0) { String schoolYearRange = schoolYears.get(0); SessionDateInfo sessionDateInfo = sessionRangeCal...
@Test public void testFindEntityWithBeginDate(){ String request = "/educationOrganizations/id/sessions"; EntityDefinition definition = mock(EntityDefinition.class); ClassType sessionClassType = mock(ClassType.class); Attribute attribute = mock(Attribute.class); Mockito.when(entityDefinitionStore.lookupByResourceName(an...
public EntityFilterInfo findEntity(String request) { this.request = request; EntityFilterInfo entityFilterInfo = new EntityFilterInfo(); List<String> resources = Arrays.asList(request.split("/")); String resource = resources.get(resources.size() - 1); EntityDefinition definition = entityDefinitionStore.lookupByResource...
EntityIdentifier { public EntityFilterInfo findEntity(String request) { this.request = request; EntityFilterInfo entityFilterInfo = new EntityFilterInfo(); List<String> resources = Arrays.asList(request.split("/")); String resource = resources.get(resources.size() - 1); EntityDefinition definition = entityDefinitionSto...
EntityIdentifier { public EntityFilterInfo findEntity(String request) { this.request = request; EntityFilterInfo entityFilterInfo = new EntityFilterInfo(); List<String> resources = Arrays.asList(request.split("/")); String resource = resources.get(resources.size() - 1); EntityDefinition definition = entityDefinitionSto...
EntityIdentifier { public EntityFilterInfo findEntity(String request) { this.request = request; EntityFilterInfo entityFilterInfo = new EntityFilterInfo(); List<String> resources = Arrays.asList(request.split("/")); String resource = resources.get(resources.size() - 1); EntityDefinition definition = entityDefinitionSto...
EntityIdentifier { public EntityFilterInfo findEntity(String request) { this.request = request; EntityFilterInfo entityFilterInfo = new EntityFilterInfo(); List<String> resources = Arrays.asList(request.split("/")); String resource = resources.get(resources.size() - 1); EntityDefinition definition = entityDefinitionSto...
@SuppressWarnings({ "unchecked", "rawtypes" }) @Test public void testAppNotExist() throws Exception { final List<Map<String, Object>> apps = new ArrayList<Map<String, Object>>(); Mockito.when(mockRepo.create(Mockito.anyString(), Mockito.anyMap())).thenAnswer(new Answer<Entity>() { @Override public Entity answer(Invocat...
@PostConstruct public void init() { if (bootstrapProperties.isReadable()) { Properties sliProp; try { sliProp = PropertiesLoaderUtils.loadProperties(bootstrapProperties); processTemplates(sliProp); } catch (IOException e) { LOG.error("Could not load boostrap properties.", e); } } else { LOG.warn("Could not find bootstr...
ApplicationInitializer { @PostConstruct public void init() { if (bootstrapProperties.isReadable()) { Properties sliProp; try { sliProp = PropertiesLoaderUtils.loadProperties(bootstrapProperties); processTemplates(sliProp); } catch (IOException e) { LOG.error("Could not load boostrap properties.", e); } } else { LOG.war...
ApplicationInitializer { @PostConstruct public void init() { if (bootstrapProperties.isReadable()) { Properties sliProp; try { sliProp = PropertiesLoaderUtils.loadProperties(bootstrapProperties); processTemplates(sliProp); } catch (IOException e) { LOG.error("Could not load boostrap properties.", e); } } else { LOG.war...
ApplicationInitializer { @PostConstruct public void init() { if (bootstrapProperties.isReadable()) { Properties sliProp; try { sliProp = PropertiesLoaderUtils.loadProperties(bootstrapProperties); processTemplates(sliProp); } catch (IOException e) { LOG.error("Could not load boostrap properties.", e); } } else { LOG.war...
ApplicationInitializer { @PostConstruct public void init() { if (bootstrapProperties.isReadable()) { Properties sliProp; try { sliProp = PropertiesLoaderUtils.loadProperties(bootstrapProperties); processTemplates(sliProp); } catch (IOException e) { LOG.error("Could not load boostrap properties.", e); } } else { LOG.war...
@SuppressWarnings({ "unchecked", "rawtypes" }) @Test public void testExistingApps() throws Exception { final List<Entity> apps = new ArrayList<Entity>(); props.put("bootstrap.app.keys", "admin"); saveProps(); Entity mockEntity = Mockito.mock(Entity.class); Mockito.when(mockRepo.findOne(Mockito.anyString(), Mockito.any(...
@PostConstruct public void init() { if (bootstrapProperties.isReadable()) { Properties sliProp; try { sliProp = PropertiesLoaderUtils.loadProperties(bootstrapProperties); processTemplates(sliProp); } catch (IOException e) { LOG.error("Could not load boostrap properties.", e); } } else { LOG.warn("Could not find bootstr...
ApplicationInitializer { @PostConstruct public void init() { if (bootstrapProperties.isReadable()) { Properties sliProp; try { sliProp = PropertiesLoaderUtils.loadProperties(bootstrapProperties); processTemplates(sliProp); } catch (IOException e) { LOG.error("Could not load boostrap properties.", e); } } else { LOG.war...
ApplicationInitializer { @PostConstruct public void init() { if (bootstrapProperties.isReadable()) { Properties sliProp; try { sliProp = PropertiesLoaderUtils.loadProperties(bootstrapProperties); processTemplates(sliProp); } catch (IOException e) { LOG.error("Could not load boostrap properties.", e); } } else { LOG.war...
ApplicationInitializer { @PostConstruct public void init() { if (bootstrapProperties.isReadable()) { Properties sliProp; try { sliProp = PropertiesLoaderUtils.loadProperties(bootstrapProperties); processTemplates(sliProp); } catch (IOException e) { LOG.error("Could not load boostrap properties.", e); } } else { LOG.war...
ApplicationInitializer { @PostConstruct public void init() { if (bootstrapProperties.isReadable()) { Properties sliProp; try { sliProp = PropertiesLoaderUtils.loadProperties(bootstrapProperties); processTemplates(sliProp); } catch (IOException e) { LOG.error("Could not load boostrap properties.", e); } } else { LOG.war...
@Test(expected = IllegalArgumentException.class) public void testProdModeNoProps() { realmInit.bootstrap(); }
@PostConstruct public void bootstrap() { Map<String, Object> bootstrapAdminRealmBody = createAdminRealmBody(); createOrUpdateRealm(ADMIN_REALM_ID, bootstrapAdminRealmBody); if (!isSandbox) { ensurePropertySet("bootstrap.developer.realm.name", devRealmName); ensurePropertySet("bootstrap.developer.realm.uniqueId", devUni...
RealmInitializer { @PostConstruct public void bootstrap() { Map<String, Object> bootstrapAdminRealmBody = createAdminRealmBody(); createOrUpdateRealm(ADMIN_REALM_ID, bootstrapAdminRealmBody); if (!isSandbox) { ensurePropertySet("bootstrap.developer.realm.name", devRealmName); ensurePropertySet("bootstrap.developer.real...
RealmInitializer { @PostConstruct public void bootstrap() { Map<String, Object> bootstrapAdminRealmBody = createAdminRealmBody(); createOrUpdateRealm(ADMIN_REALM_ID, bootstrapAdminRealmBody); if (!isSandbox) { ensurePropertySet("bootstrap.developer.realm.name", devRealmName); ensurePropertySet("bootstrap.developer.real...
RealmInitializer { @PostConstruct public void bootstrap() { Map<String, Object> bootstrapAdminRealmBody = createAdminRealmBody(); createOrUpdateRealm(ADMIN_REALM_ID, bootstrapAdminRealmBody); if (!isSandbox) { ensurePropertySet("bootstrap.developer.realm.name", devRealmName); ensurePropertySet("bootstrap.developer.real...
RealmInitializer { @PostConstruct public void bootstrap() { Map<String, Object> bootstrapAdminRealmBody = createAdminRealmBody(); createOrUpdateRealm(ADMIN_REALM_ID, bootstrapAdminRealmBody); if (!isSandbox) { ensurePropertySet("bootstrap.developer.realm.name", devRealmName); ensurePropertySet("bootstrap.developer.real...
@Test public void testAllRolesCreated() throws Exception { assertTrue(roleInitializer.buildRoles("myRealmId") == 6); }
public int buildRoles(String realmId) { if (realmId != null) { LOG.info("Building roles for realm: {}", new Object[] { realmId }); Map<String, Object> rolesBody = new HashMap<String, Object>(); List<Map<String, Object>> groups = getDefaultRoles(); rolesBody.put("realmId", realmId); rolesBody.put("roles", groups); roles...
RoleInitializer { public int buildRoles(String realmId) { if (realmId != null) { LOG.info("Building roles for realm: {}", new Object[] { realmId }); Map<String, Object> rolesBody = new HashMap<String, Object>(); List<Map<String, Object>> groups = getDefaultRoles(); rolesBody.put("realmId", realmId); rolesBody.put("role...
RoleInitializer { public int buildRoles(String realmId) { if (realmId != null) { LOG.info("Building roles for realm: {}", new Object[] { realmId }); Map<String, Object> rolesBody = new HashMap<String, Object>(); List<Map<String, Object>> groups = getDefaultRoles(); rolesBody.put("realmId", realmId); rolesBody.put("role...
RoleInitializer { public int buildRoles(String realmId) { if (realmId != null) { LOG.info("Building roles for realm: {}", new Object[] { realmId }); Map<String, Object> rolesBody = new HashMap<String, Object>(); List<Map<String, Object>> groups = getDefaultRoles(); rolesBody.put("realmId", realmId); rolesBody.put("role...
RoleInitializer { public int buildRoles(String realmId) { if (realmId != null) { LOG.info("Building roles for realm: {}", new Object[] { realmId }); Map<String, Object> rolesBody = new HashMap<String, Object>(); List<Map<String, Object>> groups = getDefaultRoles(); rolesBody.put("realmId", realmId); rolesBody.put("role...
@Test public void testCheckFieldAccessAdmin() { securityContextInjector.setAdminContextWithElevatedRights(); NeutralQuery query = new NeutralQuery(); query.addCriteria(new NeutralCriteria("economicDisadvantaged", "=", "true")); NeutralQuery query1 = new NeutralQuery(query); service.checkFieldAccess(query, false); asser...
protected void checkFieldAccess(NeutralQuery query, boolean isSelf) { if (query != null) { Collection<GrantedAuthority> auths = getAuths(isSelf); rightAccessValidator.checkFieldAccess(query, defn.getType(), auths); } }
BasicService implements EntityService, AccessibilityCheck { protected void checkFieldAccess(NeutralQuery query, boolean isSelf) { if (query != null) { Collection<GrantedAuthority> auths = getAuths(isSelf); rightAccessValidator.checkFieldAccess(query, defn.getType(), auths); } } }
BasicService implements EntityService, AccessibilityCheck { protected void checkFieldAccess(NeutralQuery query, boolean isSelf) { if (query != null) { Collection<GrantedAuthority> auths = getAuths(isSelf); rightAccessValidator.checkFieldAccess(query, defn.getType(), auths); } } BasicService(String collectionName, List<...
BasicService implements EntityService, AccessibilityCheck { protected void checkFieldAccess(NeutralQuery query, boolean isSelf) { if (query != null) { Collection<GrantedAuthority> auths = getAuths(isSelf); rightAccessValidator.checkFieldAccess(query, defn.getType(), auths); } } BasicService(String collectionName, List<...
BasicService implements EntityService, AccessibilityCheck { protected void checkFieldAccess(NeutralQuery query, boolean isSelf) { if (query != null) { Collection<GrantedAuthority> auths = getAuths(isSelf); rightAccessValidator.checkFieldAccess(query, defn.getType(), auths); } } BasicService(String collectionName, List<...
@Test public void testHappy() { SamlRequest request = Mockito.mock(SamlRequest.class); Mockito.when(request.getId()).thenReturn("id"); Mockito.when(request.getIdpDestination()).thenReturn("http: Mockito.when(samlDecoder.decode("samlRequest")).thenReturn(request); Request processed = authService.processRequest("samlRequ...
public Request processRequest(String encodedSamlRequest, String realm, String developer) { if (encodedSamlRequest == null) { return null; } SamlRequest request = samlDecoder.decode(encodedSamlRequest); return new Request(realm, developer, request); }
AuthRequestService { public Request processRequest(String encodedSamlRequest, String realm, String developer) { if (encodedSamlRequest == null) { return null; } SamlRequest request = samlDecoder.decode(encodedSamlRequest); return new Request(realm, developer, request); } }
AuthRequestService { public Request processRequest(String encodedSamlRequest, String realm, String developer) { if (encodedSamlRequest == null) { return null; } SamlRequest request = samlDecoder.decode(encodedSamlRequest); return new Request(realm, developer, request); } }
AuthRequestService { public Request processRequest(String encodedSamlRequest, String realm, String developer) { if (encodedSamlRequest == null) { return null; } SamlRequest request = samlDecoder.decode(encodedSamlRequest); return new Request(realm, developer, request); } Request processRequest(String encodedSamlReques...
AuthRequestService { public Request processRequest(String encodedSamlRequest, String realm, String developer) { if (encodedSamlRequest == null) { return null; } SamlRequest request = samlDecoder.decode(encodedSamlRequest); return new Request(realm, developer, request); } Request processRequest(String encodedSamlReques...
@Test (expected = QueryParseException.class) public void testCheckFieldAccessEducator() { securityContextInjector.setEducatorContext(); NeutralQuery query = new NeutralQuery(); query.addCriteria(new NeutralCriteria("economicDisadvantaged", "=", "true")); service.checkFieldAccess(query, false); }
protected void checkFieldAccess(NeutralQuery query, boolean isSelf) { if (query != null) { Collection<GrantedAuthority> auths = getAuths(isSelf); rightAccessValidator.checkFieldAccess(query, defn.getType(), auths); } }
BasicService implements EntityService, AccessibilityCheck { protected void checkFieldAccess(NeutralQuery query, boolean isSelf) { if (query != null) { Collection<GrantedAuthority> auths = getAuths(isSelf); rightAccessValidator.checkFieldAccess(query, defn.getType(), auths); } } }
BasicService implements EntityService, AccessibilityCheck { protected void checkFieldAccess(NeutralQuery query, boolean isSelf) { if (query != null) { Collection<GrantedAuthority> auths = getAuths(isSelf); rightAccessValidator.checkFieldAccess(query, defn.getType(), auths); } } BasicService(String collectionName, List<...
BasicService implements EntityService, AccessibilityCheck { protected void checkFieldAccess(NeutralQuery query, boolean isSelf) { if (query != null) { Collection<GrantedAuthority> auths = getAuths(isSelf); rightAccessValidator.checkFieldAccess(query, defn.getType(), auths); } } BasicService(String collectionName, List<...
BasicService implements EntityService, AccessibilityCheck { protected void checkFieldAccess(NeutralQuery query, boolean isSelf) { if (query != null) { Collection<GrantedAuthority> auths = getAuths(isSelf); rightAccessValidator.checkFieldAccess(query, defn.getType(), auths); } } BasicService(String collectionName, List<...
@Test public void testIsSelf() { BasicService basicService = (BasicService) context.getBean("basicService", "teacher", new ArrayList<Treatment>(), securityRepo); basicService.setDefn(definitionStore.lookupByEntityType("teacher")); securityContextInjector.setEducatorContext("my-id"); assertTrue(basicService.isSelf(new N...
protected boolean isSelf(NeutralQuery query) { List<NeutralCriteria> allTheCriteria = query.getCriteria(); for (NeutralQuery orQuery: query.getOrQueries()) { if(!isSelf(orQuery)) { return false; } } for(NeutralCriteria criteria: allTheCriteria) { if (criteria.getOperator().equals(NeutralCriteria.CRITERIA_IN) && criteri...
BasicService implements EntityService, AccessibilityCheck { protected boolean isSelf(NeutralQuery query) { List<NeutralCriteria> allTheCriteria = query.getCriteria(); for (NeutralQuery orQuery: query.getOrQueries()) { if(!isSelf(orQuery)) { return false; } } for(NeutralCriteria criteria: allTheCriteria) { if (criteria....
BasicService implements EntityService, AccessibilityCheck { protected boolean isSelf(NeutralQuery query) { List<NeutralCriteria> allTheCriteria = query.getCriteria(); for (NeutralQuery orQuery: query.getOrQueries()) { if(!isSelf(orQuery)) { return false; } } for(NeutralCriteria criteria: allTheCriteria) { if (criteria....
BasicService implements EntityService, AccessibilityCheck { protected boolean isSelf(NeutralQuery query) { List<NeutralCriteria> allTheCriteria = query.getCriteria(); for (NeutralQuery orQuery: query.getOrQueries()) { if(!isSelf(orQuery)) { return false; } } for(NeutralCriteria criteria: allTheCriteria) { if (criteria....
BasicService implements EntityService, AccessibilityCheck { protected boolean isSelf(NeutralQuery query) { List<NeutralCriteria> allTheCriteria = query.getCriteria(); for (NeutralQuery orQuery: query.getOrQueries()) { if(!isSelf(orQuery)) { return false; } } for(NeutralCriteria criteria: allTheCriteria) { if (criteria....
@SuppressWarnings("unchecked") @Test public void testList() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException { securityContextInjector.setEducatorContext(); RightAccessValidator mockAccessValidator = Mockito.mock(RightAccessValidator.class); Field rightAccessValidator = B...
@Override public Iterable<EntityBody> list(NeutralQuery neutralQuery) { LOG.debug(">>>BasicService.list(neutralQuery)"); listSecurityCheck(neutralQuery); return listImplementationAfterSecurityChecks(neutralQuery); }
BasicService implements EntityService, AccessibilityCheck { @Override public Iterable<EntityBody> list(NeutralQuery neutralQuery) { LOG.debug(">>>BasicService.list(neutralQuery)"); listSecurityCheck(neutralQuery); return listImplementationAfterSecurityChecks(neutralQuery); } }
BasicService implements EntityService, AccessibilityCheck { @Override public Iterable<EntityBody> list(NeutralQuery neutralQuery) { LOG.debug(">>>BasicService.list(neutralQuery)"); listSecurityCheck(neutralQuery); return listImplementationAfterSecurityChecks(neutralQuery); } BasicService(String collectionName, List<Tre...
BasicService implements EntityService, AccessibilityCheck { @Override public Iterable<EntityBody> list(NeutralQuery neutralQuery) { LOG.debug(">>>BasicService.list(neutralQuery)"); listSecurityCheck(neutralQuery); return listImplementationAfterSecurityChecks(neutralQuery); } BasicService(String collectionName, List<Tre...
BasicService implements EntityService, AccessibilityCheck { @Override public Iterable<EntityBody> list(NeutralQuery neutralQuery) { LOG.debug(">>>BasicService.list(neutralQuery)"); listSecurityCheck(neutralQuery); return listImplementationAfterSecurityChecks(neutralQuery); } BasicService(String collectionName, List<Tre...
@SuppressWarnings("unchecked") @Test public void testListBasedOnContextualRoles() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException { securityContextInjector.setEducatorContext(); SecurityUtil.setUserContext(SecurityUtil.UserContext.TEACHER_CONTEXT); RightAccessValidator m...
@Override public Iterable<EntityBody> listBasedOnContextualRoles(NeutralQuery neutralQuery) { boolean isSelf = isSelf(neutralQuery); boolean noDataInDB = true; Map<String, UserContext> entityContexts = null; injectSecurity(neutralQuery); boolean findSpecial = userHasMultipleContextsOrDifferingRights() && (!EntityNames....
BasicService implements EntityService, AccessibilityCheck { @Override public Iterable<EntityBody> listBasedOnContextualRoles(NeutralQuery neutralQuery) { boolean isSelf = isSelf(neutralQuery); boolean noDataInDB = true; Map<String, UserContext> entityContexts = null; injectSecurity(neutralQuery); boolean findSpecial = ...
BasicService implements EntityService, AccessibilityCheck { @Override public Iterable<EntityBody> listBasedOnContextualRoles(NeutralQuery neutralQuery) { boolean isSelf = isSelf(neutralQuery); boolean noDataInDB = true; Map<String, UserContext> entityContexts = null; injectSecurity(neutralQuery); boolean findSpecial = ...
BasicService implements EntityService, AccessibilityCheck { @Override public Iterable<EntityBody> listBasedOnContextualRoles(NeutralQuery neutralQuery) { boolean isSelf = isSelf(neutralQuery); boolean noDataInDB = true; Map<String, UserContext> entityContexts = null; injectSecurity(neutralQuery); boolean findSpecial = ...
BasicService implements EntityService, AccessibilityCheck { @Override public Iterable<EntityBody> listBasedOnContextualRoles(NeutralQuery neutralQuery) { boolean isSelf = isSelf(neutralQuery); boolean noDataInDB = true; Map<String, UserContext> entityContexts = null; injectSecurity(neutralQuery); boolean findSpecial = ...
@SuppressWarnings("unchecked") @Test public void testCreate() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException { securityContextInjector.setEducatorContext(); try { Thread.currentThread().sleep(5L); } catch (InterruptedException is) { } RightAccessValidator mockAccessVali...
@Override public List<String> create(List<EntityBody> content) { List<String> entityIds = new ArrayList<String>(); for (EntityBody entityBody : content) { entityIds.add(create(entityBody)); } if (entityIds.size() != content.size()) { for (String id : entityIds) { delete(id); } } return entityIds; }
BasicService implements EntityService, AccessibilityCheck { @Override public List<String> create(List<EntityBody> content) { List<String> entityIds = new ArrayList<String>(); for (EntityBody entityBody : content) { entityIds.add(create(entityBody)); } if (entityIds.size() != content.size()) { for (String id : entityIds...
BasicService implements EntityService, AccessibilityCheck { @Override public List<String> create(List<EntityBody> content) { List<String> entityIds = new ArrayList<String>(); for (EntityBody entityBody : content) { entityIds.add(create(entityBody)); } if (entityIds.size() != content.size()) { for (String id : entityIds...
BasicService implements EntityService, AccessibilityCheck { @Override public List<String> create(List<EntityBody> content) { List<String> entityIds = new ArrayList<String>(); for (EntityBody entityBody : content) { entityIds.add(create(entityBody)); } if (entityIds.size() != content.size()) { for (String id : entityIds...
BasicService implements EntityService, AccessibilityCheck { @Override public List<String> create(List<EntityBody> content) { List<String> entityIds = new ArrayList<String>(); for (EntityBody entityBody : content) { entityIds.add(create(entityBody)); } if (entityIds.size() != content.size()) { for (String id : entityIds...
@SuppressWarnings("unchecked") @Test public void testCreateBasedOnContextualRoles() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException { securityContextInjector.setEducatorContext(); RightAccessValidator mockAccessValidator = Mockito.mock(RightAccessValidator.class); Field ...
@Override public List<String> createBasedOnContextualRoles(List<EntityBody> content) { List<String> entityIds = new ArrayList<String>(); for (EntityBody entityBody : content) { entityIds.add(createBasedOnContextualRoles(entityBody)); } if (entityIds.size() != content.size()) { for (String id : entityIds) { delete(id); ...
BasicService implements EntityService, AccessibilityCheck { @Override public List<String> createBasedOnContextualRoles(List<EntityBody> content) { List<String> entityIds = new ArrayList<String>(); for (EntityBody entityBody : content) { entityIds.add(createBasedOnContextualRoles(entityBody)); } if (entityIds.size() != ...
BasicService implements EntityService, AccessibilityCheck { @Override public List<String> createBasedOnContextualRoles(List<EntityBody> content) { List<String> entityIds = new ArrayList<String>(); for (EntityBody entityBody : content) { entityIds.add(createBasedOnContextualRoles(entityBody)); } if (entityIds.size() != ...
BasicService implements EntityService, AccessibilityCheck { @Override public List<String> createBasedOnContextualRoles(List<EntityBody> content) { List<String> entityIds = new ArrayList<String>(); for (EntityBody entityBody : content) { entityIds.add(createBasedOnContextualRoles(entityBody)); } if (entityIds.size() != ...
BasicService implements EntityService, AccessibilityCheck { @Override public List<String> createBasedOnContextualRoles(List<EntityBody> content) { List<String> entityIds = new ArrayList<String>(); for (EntityBody entityBody : content) { entityIds.add(createBasedOnContextualRoles(entityBody)); } if (entityIds.size() != ...
@Test public void testgetEntityContextAuthorities() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException { securityContextInjector.setDualContext(); RightAccessValidator mockAccessValidator = Mockito.mock(RightAccessValidator.class); Field rightAccessVa...
protected Collection<GrantedAuthority> getEntityContextAuthorities(Entity entity, boolean isSelf, boolean isRead) { UserContext context = SecurityUtil.getUserContext(); if (context == UserContext.DUAL_CONTEXT) { Map<String, UserContext> entityContext = getEntityContextMap(Arrays.asList(entity), isRead); if (entityConte...
BasicService implements EntityService, AccessibilityCheck { protected Collection<GrantedAuthority> getEntityContextAuthorities(Entity entity, boolean isSelf, boolean isRead) { UserContext context = SecurityUtil.getUserContext(); if (context == UserContext.DUAL_CONTEXT) { Map<String, UserContext> entityContext = getEnti...
BasicService implements EntityService, AccessibilityCheck { protected Collection<GrantedAuthority> getEntityContextAuthorities(Entity entity, boolean isSelf, boolean isRead) { UserContext context = SecurityUtil.getUserContext(); if (context == UserContext.DUAL_CONTEXT) { Map<String, UserContext> entityContext = getEnti...
BasicService implements EntityService, AccessibilityCheck { protected Collection<GrantedAuthority> getEntityContextAuthorities(Entity entity, boolean isSelf, boolean isRead) { UserContext context = SecurityUtil.getUserContext(); if (context == UserContext.DUAL_CONTEXT) { Map<String, UserContext> entityContext = getEnti...
BasicService implements EntityService, AccessibilityCheck { protected Collection<GrantedAuthority> getEntityContextAuthorities(Entity entity, boolean isSelf, boolean isRead) { UserContext context = SecurityUtil.getUserContext(); if (context == UserContext.DUAL_CONTEXT) { Map<String, UserContext> entityContext = getEnti...
@SuppressWarnings("unchecked") @Test public void testGetResponseEntities() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { securityContextInjector.setDualContext(); SecurityUtil.setUserContext(SecurityUtil.UserContext.D...
protected Collection<Entity> getResponseEntities(NeutralQuery neutralQuery, boolean isSelf) throws AccessDeniedException { LOG.debug(">>>BasicService.getResponseEntities()"); Collection<Entity> responseEntities = new ArrayList<Entity>(); Map<String, UserContext> entityContexts = new HashMap<String, UserContext>(); fina...
BasicService implements EntityService, AccessibilityCheck { protected Collection<Entity> getResponseEntities(NeutralQuery neutralQuery, boolean isSelf) throws AccessDeniedException { LOG.debug(">>>BasicService.getResponseEntities()"); Collection<Entity> responseEntities = new ArrayList<Entity>(); Map<String, UserContex...
BasicService implements EntityService, AccessibilityCheck { protected Collection<Entity> getResponseEntities(NeutralQuery neutralQuery, boolean isSelf) throws AccessDeniedException { LOG.debug(">>>BasicService.getResponseEntities()"); Collection<Entity> responseEntities = new ArrayList<Entity>(); Map<String, UserContex...
BasicService implements EntityService, AccessibilityCheck { protected Collection<Entity> getResponseEntities(NeutralQuery neutralQuery, boolean isSelf) throws AccessDeniedException { LOG.debug(">>>BasicService.getResponseEntities()"); Collection<Entity> responseEntities = new ArrayList<Entity>(); Map<String, UserContex...
BasicService implements EntityService, AccessibilityCheck { protected Collection<Entity> getResponseEntities(NeutralQuery neutralQuery, boolean isSelf) throws AccessDeniedException { LOG.debug(">>>BasicService.getResponseEntities()"); Collection<Entity> responseEntities = new ArrayList<Entity>(); Map<String, UserContex...
@Test(expected = SelectorParseException.class) public void testDollarSignThrowsExceptionWhenNotExpected() { this.selectionConverter.convert(":($)"); }
public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount(); for (int i = 0; i < groups; i++) { String data = m...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
@Test(expected = SelectorParseException.class) public void testNestedDollarSignThrowsExceptionWhenNotExpected() { this.selectionConverter.convert(":(foo:($))"); }
public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount(); for (int i = 0; i < groups; i++) { String data = m...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
@Test public void testForceAuthn() { SamlRequest request = Mockito.mock(SamlRequest.class); Mockito.when(request.getId()).thenReturn("id"); Mockito.when(request.getIdpDestination()).thenReturn("http: Mockito.when(request.isForceAuthn()).thenReturn(true); Mockito.when(samlDecoder.decode("samlRequest")).thenReturn(reques...
public Request processRequest(String encodedSamlRequest, String realm, String developer) { if (encodedSamlRequest == null) { return null; } SamlRequest request = samlDecoder.decode(encodedSamlRequest); return new Request(realm, developer, request); }
AuthRequestService { public Request processRequest(String encodedSamlRequest, String realm, String developer) { if (encodedSamlRequest == null) { return null; } SamlRequest request = samlDecoder.decode(encodedSamlRequest); return new Request(realm, developer, request); } }
AuthRequestService { public Request processRequest(String encodedSamlRequest, String realm, String developer) { if (encodedSamlRequest == null) { return null; } SamlRequest request = samlDecoder.decode(encodedSamlRequest); return new Request(realm, developer, request); } }
AuthRequestService { public Request processRequest(String encodedSamlRequest, String realm, String developer) { if (encodedSamlRequest == null) { return null; } SamlRequest request = samlDecoder.decode(encodedSamlRequest); return new Request(realm, developer, request); } Request processRequest(String encodedSamlReques...
AuthRequestService { public Request processRequest(String encodedSamlRequest, String realm, String developer) { if (encodedSamlRequest == null) { return null; } SamlRequest request = samlDecoder.decode(encodedSamlRequest); return new Request(realm, developer, request); } Request processRequest(String encodedSamlReques...
@Test public void testDollarSignDoesNotThrowExceptionWhenExpected() { SelectionConverter mySelectionConverter = new Selector2MapOfMaps(false); Map<String, Object> expectedResult = new HashMap<String, Object>(); expectedResult.put("$", true); Map<String, Object> convertResult = mySelectionConverter.convert(":($)"); asse...
public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount(); for (int i = 0; i < groups; i++) { String data = m...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
@Test public void testBasicWildcard() throws SelectorParseException { Map<String, Object> expectedResult = new HashMap<String, Object>(); expectedResult.put("*", true); Map<String, Object> convertResult = this.selectionConverter.convert(":( * )".replaceAll(" ", "")); assertTrue(convertResult != null); assertTrue(conver...
public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount(); for (int i = 0; i < groups; i++) { String data = m...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
@Test public void testBasicString() throws SelectorParseException { Map<String, Object> expectedResult = new HashMap<String, Object>(); expectedResult.put("name", true); expectedResult.put("sectionAssociations", true); Map<String, Object> convertResult = this.selectionConverter.convert(":( name, sectionAssociations )"....
public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount(); for (int i = 0; i < groups; i++) { String data = m...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
@Test public void testTwiceNestedString() throws SelectorParseException { Map<String, Object> convertResult = this.selectionConverter.convert(":( name, sectionAssociations : ( studentId , sectionId : ( * ) ) )".replaceAll(" ", "")); Map<String, Object> sectionIdMap = new HashMap<String, Object>(); sectionIdMap.put("*",...
public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount(); for (int i = 0; i < groups; i++) { String data = m...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
@Test public void testExcludingFeaturesFromWildcardSelection() throws SelectorParseException { Map<String, Object> expectedResult = new HashMap<String, Object>(); expectedResult.put("*", true); expectedResult.put("sequenceOfCourse", false); Map<String, Object> convertResult = this.selectionConverter.convert(":( *, sequ...
public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount(); for (int i = 0; i < groups; i++) { String data = m...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
@Test public void veryNestedTest() throws SelectorParseException { String selectorString = ":(foo:(bar),foo2:(bar2:true),foo3:(bar3:false),foo4:(bar4:(*,foobar5:false)))"; Map<String, Object> fooMap = new HashMap<String, Object>(); fooMap.put("bar", true); Map<String, Object> foo2Map = new HashMap<String, Object>(); fo...
public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount(); for (int i = 0; i < groups; i++) { String data = m...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
@Test(expected = SelectorParseException.class) public void testInvalidSyntax() throws SelectorParseException { this.selectionConverter.convert(":("); }
public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount(); for (int i = 0; i < groups; i++) { String data = m...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
@Test(expected = SelectorParseException.class) public void testEmptyStrings() throws SelectorParseException { this.selectionConverter.convert(":(,,)"); }
public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount(); for (int i = 0; i < groups; i++) { String data = m...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
@Test(expected = SelectorParseException.class) public void testUnbalancedParens() throws SelectorParseException { Selector2MapOfMaps.getMatchingClosingParenIndex("((", 0); }
protected static int getMatchingClosingParenIndex(String string, int openParenIndex) throws SelectorParseException { int balance = 0; for (int i = openParenIndex; i < string.length(); i++) { switch(string.charAt(i)) { case '(' : balance++; break; case ')' : balance--; if (balance == 0) { return i; } else if (balance < ...
Selector2MapOfMaps implements SelectionConverter { protected static int getMatchingClosingParenIndex(String string, int openParenIndex) throws SelectorParseException { int balance = 0; for (int i = openParenIndex; i < string.length(); i++) { switch(string.charAt(i)) { case '(' : balance++; break; case ')' : balance--; ...
Selector2MapOfMaps implements SelectionConverter { protected static int getMatchingClosingParenIndex(String string, int openParenIndex) throws SelectorParseException { int balance = 0; for (int i = openParenIndex; i < string.length(); i++) { switch(string.charAt(i)) { case '(' : balance++; break; case ')' : balance--; ...
Selector2MapOfMaps implements SelectionConverter { protected static int getMatchingClosingParenIndex(String string, int openParenIndex) throws SelectorParseException { int balance = 0; for (int i = openParenIndex; i < string.length(); i++) { switch(string.charAt(i)) { case '(' : balance++; break; case ')' : balance--; ...
Selector2MapOfMaps implements SelectionConverter { protected static int getMatchingClosingParenIndex(String string, int openParenIndex) throws SelectorParseException { int balance = 0; for (int i = openParenIndex; i < string.length(); i++) { switch(string.charAt(i)) { case '(' : balance++; break; case ')' : balance--; ...
@Test(expected = SelectorParseException.class) public void testUnbalancedParens2() throws SelectorParseException { Selector2MapOfMaps.getMatchingClosingParenIndex(")", 0); }
protected static int getMatchingClosingParenIndex(String string, int openParenIndex) throws SelectorParseException { int balance = 0; for (int i = openParenIndex; i < string.length(); i++) { switch(string.charAt(i)) { case '(' : balance++; break; case ')' : balance--; if (balance == 0) { return i; } else if (balance < ...
Selector2MapOfMaps implements SelectionConverter { protected static int getMatchingClosingParenIndex(String string, int openParenIndex) throws SelectorParseException { int balance = 0; for (int i = openParenIndex; i < string.length(); i++) { switch(string.charAt(i)) { case '(' : balance++; break; case ')' : balance--; ...
Selector2MapOfMaps implements SelectionConverter { protected static int getMatchingClosingParenIndex(String string, int openParenIndex) throws SelectorParseException { int balance = 0; for (int i = openParenIndex; i < string.length(); i++) { switch(string.charAt(i)) { case '(' : balance++; break; case ')' : balance--; ...
Selector2MapOfMaps implements SelectionConverter { protected static int getMatchingClosingParenIndex(String string, int openParenIndex) throws SelectorParseException { int balance = 0; for (int i = openParenIndex; i < string.length(); i++) { switch(string.charAt(i)) { case '(' : balance++; break; case ')' : balance--; ...
Selector2MapOfMaps implements SelectionConverter { protected static int getMatchingClosingParenIndex(String string, int openParenIndex) throws SelectorParseException { int balance = 0; for (int i = openParenIndex; i < string.length(); i++) { switch(string.charAt(i)) { case '(' : balance++; break; case ')' : balance--; ...
@Test public void testGetAvailableDatasets() { service.setDatasetList("one,List One,two,List Two"); service.initDatasets(); List<Dataset> result = service.getAvailableDatasets(); assertEquals(2, result.size()); assertEquals("List One",result.get(0).getDisplayName()); assertEquals("one",result.get(0).getKey()); assertEq...
public List<Dataset> getAvailableDatasets() { return datasets; }
DefaultUsersService { public List<Dataset> getAvailableDatasets() { return datasets; } }
DefaultUsersService { public List<Dataset> getAvailableDatasets() { return datasets; } }
DefaultUsersService { public List<Dataset> getAvailableDatasets() { return datasets; } @PostConstruct void postConstruct(); List<Dataset> getAvailableDatasets(); List<DefaultUser> getUsers(String dataset); DefaultUser getUser(String dataset, String userId); }
DefaultUsersService { public List<Dataset> getAvailableDatasets() { return datasets; } @PostConstruct void postConstruct(); List<Dataset> getAvailableDatasets(); List<DefaultUser> getUsers(String dataset); DefaultUser getUser(String dataset, String userId); }
@Test(expected = SelectorParseException.class) public void testUnbalancedParens3() throws SelectorParseException { String selectorString = ":(name,sectionAssociations)"; String unbalancedString = selectorString + ")"; this.selectionConverter.convert(unbalancedString); }
public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount(); for (int i = 0; i < groups; i++) { String data = m...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
@Test(expected = SelectorParseException.class) public void testEmptyStringForKey() throws SelectorParseException { String selectorString = ":(:(test))"; this.selectionConverter.convert(selectorString); }
public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount(); for (int i = 0; i < groups; i++) { String data = m...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
@Test(expected = SelectorParseException.class) public void testNonTrueFalseValueParsing() throws SelectorParseException { String selectorString = ":(someField:tru)"; this.selectionConverter.convert(selectorString); }
public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount(); for (int i = 0; i < groups; i++) { String data = m...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
Selector2MapOfMaps implements SelectionConverter { public Map<String, Object> convert(String selectorString) throws SelectorParseException { Map<String, Object> converted = new HashMap<String, Object>(); Matcher matcher = SELECTOR_PATTERN.matcher(selectorString); if (matcher.find()) { int groups = matcher.groupCount();...
@Test public void testNonNullForNull() { assertTrue(QUERY_CONVERTER.convert(null) != null); }
public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
@Test (expected = QueryParseException.class) public void testPreventionOfNegativeLimit() throws URISyntaxException { String queryString = "limit=-1"; URI requestUri = new URI(URI_STRING + "?" + queryString); when(uriInfo.getRequestUri()).thenReturn(requestUri); QUERY_CONVERTER.convert(uriInfo); }
public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
@Test(expected = QueryParseException.class) public void testPreventionOfNegativeOffset() throws URISyntaxException { String queryString = "offset=-1"; URI requestUri = new URI(URI_STRING + "?" + queryString); when(uriInfo.getRequestUri()).thenReturn(requestUri); QUERY_CONVERTER.convert(uriInfo); }
public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
@Test(expected = QueryParseException.class) public void testSelectorShouldFail() throws URISyntaxException { String queryString = "selector=:(students)"; URI requestUri = new URI(URI_STRING + "?" + queryString); when(uriInfo.getRequestUri()).thenReturn(requestUri); QUERY_CONVERTER.convert(uriInfo); }
public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
@Test(expected = QueryParseException.class) public void testInvalidSelector() { try { String queryString = "selector=true"; URI requestUri = new URI(URI_STRING + "?" + queryString); when(uriInfo.getRequestUri()).thenReturn(requestUri); } catch (URISyntaxException urise) { assertTrue(false); } QUERY_CONVERTER.convert(ur...
public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
@Test(expected = QueryParseException.class) public void testInvalidOffset() { try { String queryString = "offset=four"; URI requestUri = new URI(URI_STRING + "?" + queryString); when(uriInfo.getRequestUri()).thenReturn(requestUri); } catch (URISyntaxException urise) { assertTrue(false); } QUERY_CONVERTER.convert(uriInf...
public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
@Test(expected = QueryParseException.class) public void testInvalidLimit() { try { String queryString = "limit=four"; URI requestUri = new URI(URI_STRING + "?" + queryString); when(uriInfo.getRequestUri()).thenReturn(requestUri); } catch (URISyntaxException urise) { assertTrue(false); } QUERY_CONVERTER.convert(uriInfo)...
public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
@Test public void testGetUser() { service.setDatasetList("TestDataset,The Test Dataset"); service.initDatasets(); service.initUserLists(); DefaultUser user = service.getUser("TestDataset", "linda.kim"); assertEquals("linda.kim", user.getUserId()); }
public DefaultUser getUser(String dataset, String userId) { for (DefaultUser user : getUsers(dataset)) { if (user.getUserId().equals(userId)) { return user; } } return null; }
DefaultUsersService { public DefaultUser getUser(String dataset, String userId) { for (DefaultUser user : getUsers(dataset)) { if (user.getUserId().equals(userId)) { return user; } } return null; } }
DefaultUsersService { public DefaultUser getUser(String dataset, String userId) { for (DefaultUser user : getUsers(dataset)) { if (user.getUserId().equals(userId)) { return user; } } return null; } }
DefaultUsersService { public DefaultUser getUser(String dataset, String userId) { for (DefaultUser user : getUsers(dataset)) { if (user.getUserId().equals(userId)) { return user; } } return null; } @PostConstruct void postConstruct(); List<Dataset> getAvailableDatasets(); List<DefaultUser> getUsers(String dataset); De...
DefaultUsersService { public DefaultUser getUser(String dataset, String userId) { for (DefaultUser user : getUsers(dataset)) { if (user.getUserId().equals(userId)) { return user; } } return null; } @PostConstruct void postConstruct(); List<Dataset> getAvailableDatasets(); List<DefaultUser> getUsers(String dataset); De...
@Test(expected = QueryParseException.class) public void testQueryStringMissingKey() { try { String queryString = "=4"; URI requestUri = new URI(URI_STRING + "?" + queryString); when(uriInfo.getRequestUri()).thenReturn(requestUri); } catch (URISyntaxException urise) { assertTrue(false); } QUERY_CONVERTER.convert(uriInfo...
public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
@Test(expected = QueryParseException.class) public void testQueryStringMissingOperator() { try { String queryString = "key4"; URI requestUri = new URI(URI_STRING + "?" + queryString); when(uriInfo.getRequestUri()).thenReturn(requestUri); } catch (URISyntaxException urise) { assertTrue(false); } QUERY_CONVERTER.convert(...
public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
@Test(expected = QueryParseException.class) public void testQueryStringMissingValue() { try { String queryString = "key="; URI requestUri = new URI(URI_STRING + "?" + queryString); when(uriInfo.getRequestUri()).thenReturn(requestUri); } catch (URISyntaxException urise) { assertTrue(false); } QUERY_CONVERTER.convert(uri...
public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); }
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
UriInfoToApiQueryConverter { public ApiQuery convert(ApiQuery apiQuery, URI requestURI) { if (requestURI == null) { return apiQuery; } return convert(apiQuery, requestURI.getQuery()); } UriInfoToApiQueryConverter(); ApiQuery convert(ApiQuery apiQuery, URI requestURI); ApiQuery convert(ApiQuery apiQuery, UriInfo uriInfo...
@Test public void testToString() throws URISyntaxException { List<String> equivalentStrings = new ArrayList<String>(); equivalentStrings.add("offset=0&limit=50"); equivalentStrings.add("offset=0&limit=50"); equivalentStrings.add("offset=0&limit=50"); equivalentStrings.add("offset=0&limit=50"); URI requestUri = new URI(...
@Override public String toString() { StringBuilder stringBuffer = new StringBuilder("offset=" + getOffset() + "&limit=" + getLimit()); if (getIncludeFields() != null) { stringBuffer.append("&includeFields=" + StringUtils.join(getIncludeFields(), ",")); } if (getExcludeFields() != null) { stringBuffer.append("&excludeFi...
ApiQuery extends NeutralQuery { @Override public String toString() { StringBuilder stringBuffer = new StringBuilder("offset=" + getOffset() + "&limit=" + getLimit()); if (getIncludeFields() != null) { stringBuffer.append("&includeFields=" + StringUtils.join(getIncludeFields(), ",")); } if (getExcludeFields() != null) {...
ApiQuery extends NeutralQuery { @Override public String toString() { StringBuilder stringBuffer = new StringBuilder("offset=" + getOffset() + "&limit=" + getLimit()); if (getIncludeFields() != null) { stringBuffer.append("&includeFields=" + StringUtils.join(getIncludeFields(), ",")); } if (getExcludeFields() != null) {...
ApiQuery extends NeutralQuery { @Override public String toString() { StringBuilder stringBuffer = new StringBuilder("offset=" + getOffset() + "&limit=" + getLimit()); if (getIncludeFields() != null) { stringBuffer.append("&includeFields=" + StringUtils.join(getIncludeFields(), ",")); } if (getExcludeFields() != null) {...
ApiQuery extends NeutralQuery { @Override public String toString() { StringBuilder stringBuffer = new StringBuilder("offset=" + getOffset() + "&limit=" + getLimit()); if (getIncludeFields() != null) { stringBuffer.append("&includeFields=" + StringUtils.join(getIncludeFields(), ",")); } if (getExcludeFields() != null) {...
@Test public void testEmptyEntity() { EntityBody emptyCustomEntity = new EntityBody(); List<ValidationError> validationErrors = customEntityValidator.validate(emptyCustomEntity); Assert.assertTrue("There should be no validation errors", validationErrors.isEmpty()); }
public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } List<ValidationError> validate(EntityBody entityBody); }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } List<ValidationError> validate(EntityBody entityBody); }
@Test public void testValidFieldName() { String validCustomEntityId = "validCustomEntity1"; EntityBody validCustomEntity = new EntityBody(); validCustomEntity.put("ID", validCustomEntityId); validCustomEntity.put("goodFieldName", "goodFieldValue"); List<ValidationError> validationErrors = customEntityValidator.validate...
public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } List<ValidationError> validate(EntityBody entityBody); }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } List<ValidationError> validate(EntityBody entityBody); }
@SuppressWarnings("serial") @Test public void testMultipleNestedValidFieldNames() { final String validCustomEntityId = "validCustomEntity2"; EntityBody validCustomEntity = new EntityBody() { { put("ID", validCustomEntityId); put("goodFieldName1", "goodFieldValue"); put("goodFieldName2", new HashMap<String, Object>() { ...
public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } List<ValidationError> validate(EntityBody entityBody); }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } List<ValidationError> validate(EntityBody entityBody); }
@Test public void testInvalidFieldNameConsistingOfNullChar() { String invalidCustomEntityId = "invalidCustomEntity1"; EntityBody invalidCustomEntity = new EntityBody(); invalidCustomEntity.put("ID", invalidCustomEntityId); invalidCustomEntity.put("\u0000", "goodFieldValue"); List<ValidationError> validationErrors = cus...
public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } List<ValidationError> validate(EntityBody entityBody); }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } List<ValidationError> validate(EntityBody entityBody); }
@Test public void testInvalidFieldNameConsistingOfNullString() { String invalidCustomEntityId = "invalidCustomEntity2"; EntityBody invalidCustomEntity = new EntityBody(); invalidCustomEntity.put("ID", invalidCustomEntityId); invalidCustomEntity.put("\\x00", "goodFieldValue"); List<ValidationError> validationErrors = cu...
public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } List<ValidationError> validate(EntityBody entityBody); }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } List<ValidationError> validate(EntityBody entityBody); }
@Test public void testInvalidFieldNameContainingNullChar() { String invalidCustomEntityId = "invalidCustomEntity3"; EntityBody invalidCustomEntity = new EntityBody(); invalidCustomEntity.put("ID", invalidCustomEntityId); invalidCustomEntity.put("bad\u0000FieldName", "goodFieldValue"); List<ValidationError> validationEr...
public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } List<ValidationError> validate(EntityBody entityBody); }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } List<ValidationError> validate(EntityBody entityBody); }
@Test public void testLogoutNoSaml() { ModelAndView mav = loginController.logout(null, null, null, httpSession); Mockito.verify(httpSession, Mockito.times(1)).removeAttribute("user_session_key"); assertEquals("loggedOut", mav.getViewName()); }
@RequestMapping(value = "/logout") public ModelAndView logout(@RequestParam(value="SAMLRequest", required=false) String encodedSamlRequest, @RequestParam(value = "realm", required = false) String realm, @RequestParam(value = "developer", required = false) String developer, HttpSession httpSession) { httpSession.removeA...
Login { @RequestMapping(value = "/logout") public ModelAndView logout(@RequestParam(value="SAMLRequest", required=false) String encodedSamlRequest, @RequestParam(value = "realm", required = false) String realm, @RequestParam(value = "developer", required = false) String developer, HttpSession httpSession) { httpSession...
Login { @RequestMapping(value = "/logout") public ModelAndView logout(@RequestParam(value="SAMLRequest", required=false) String encodedSamlRequest, @RequestParam(value = "realm", required = false) String realm, @RequestParam(value = "developer", required = false) String developer, HttpSession httpSession) { httpSession...
Login { @RequestMapping(value = "/logout") public ModelAndView logout(@RequestParam(value="SAMLRequest", required=false) String encodedSamlRequest, @RequestParam(value = "realm", required = false) String realm, @RequestParam(value = "developer", required = false) String developer, HttpSession httpSession) { httpSession...
Login { @RequestMapping(value = "/logout") public ModelAndView logout(@RequestParam(value="SAMLRequest", required=false) String encodedSamlRequest, @RequestParam(value = "realm", required = false) String realm, @RequestParam(value = "developer", required = false) String developer, HttpSession httpSession) { httpSession...
@Test public void testInvalidFieldNameContainingNullString() { String invalidCustomEntityId = "invalidCustomEntity4"; EntityBody invalidCustomEntity = new EntityBody(); invalidCustomEntity.put("ID", invalidCustomEntityId); invalidCustomEntity.put("bad\\x00FieldName", "goodFieldValue"); List<ValidationError> validationE...
public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } List<ValidationError> validate(EntityBody entityBody); }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } List<ValidationError> validate(EntityBody entityBody); }
@SuppressWarnings("serial") @Test public void testInvalidNestedFieldNameInMap() { final String invalidCustomEntityId = "invalidCustomEntity5"; EntityBody invalidCustomEntity = new EntityBody() { { put("ID", invalidCustomEntityId); put("nestedFieldName", new HashMap<String, Object>() { { put("goodFieldName", "goodFieldV...
public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } List<ValidationError> validate(EntityBody entityBody); }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } List<ValidationError> validate(EntityBody entityBody); }
@SuppressWarnings("serial") @Test public void testMultipleNestedInvalidFieldNames() { final String invalidCustomEntityId = "invalidCustomEntity6"; EntityBody invalidCustomEntity = new EntityBody() { { put("ID", invalidCustomEntityId); put("FSCommand = DEL", "goodFieldValue"); put("nestedField", new HashMap<String, Obje...
public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } List<ValidationError> validate(EntityBody entityBody); }
CustomEntityValidator { public List<ValidationError> validate(EntityBody entityBody) { List<ValidationError> errorList = new ArrayList<ValidationError>(); if (!entityBody.isEmpty()) { validate(entityBody, errorList); } return errorList; } List<ValidationError> validate(EntityBody entityBody); }
@Test public void testGetAllowedEdOrgs() { Mockito.when(secUtil.getTenantId()).thenReturn("TENANT"); Entity user = Mockito.mock(Entity.class); HashMap<String, Object> body = new HashMap<String, Object>(); body.put("stateOrganizationId", "ID"); body.put("organizationCategories", Arrays.asList("State Education Agency"));...
public Set<String> getAllowedEdOrgs(String tenant, String edOrg) { return getAllowedEdOrgs(tenant, edOrg, null, false); }
SuperAdminService { public Set<String> getAllowedEdOrgs(String tenant, String edOrg) { return getAllowedEdOrgs(tenant, edOrg, null, false); } }
SuperAdminService { public Set<String> getAllowedEdOrgs(String tenant, String edOrg) { return getAllowedEdOrgs(tenant, edOrg, null, false); } }
SuperAdminService { public Set<String> getAllowedEdOrgs(String tenant, String edOrg) { return getAllowedEdOrgs(tenant, edOrg, null, false); } Set<String> getAllowedEdOrgs(String tenant, String edOrg); Set<String> getAllowedEdOrgs(final String tenant, final String edOrg, final Collection<String> interestedTypes, boolea...
SuperAdminService { public Set<String> getAllowedEdOrgs(String tenant, String edOrg) { return getAllowedEdOrgs(tenant, edOrg, null, false); } Set<String> getAllowedEdOrgs(String tenant, String edOrg); Set<String> getAllowedEdOrgs(final String tenant, final String edOrg, final Collection<String> interestedTypes, boolea...
@Test public void testGetContextualAuthoritiesStaffOrphan() { String principalId = "SuperTeacher1"; Entity princEntity = new MongoEntity(null, principalId, new HashMap<String,Object>(), new HashMap<String,Object>()); SLIPrincipal principal = new SLIPrincipal(); principal.setEntity(princEntity); principal.setUserType(En...
public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUser()) { if (entity == nu...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
@SuppressWarnings("unchecked") @Test public void testGetContextualAuthoritiesStaffMatchingEdOrgs() { Entity princEntity = new MongoEntity(null, "SuperTeacher2", new HashMap<String,Object>(), new HashMap<String,Object>()); SLIPrincipal principal = new SLIPrincipal(); principal.setEntity(princEntity); principal.setUserTy...
public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUser()) { if (entity == nu...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
@Test public void testGetContextualAuthoritiesStaffNoMatchingEdOrgs() { Map<String, Collection<GrantedAuthority>> edOrgRights = new HashMap<String, Collection<GrantedAuthority>>(); Entity princEntity = new MongoEntity(null, "RegularTeacher1", new HashMap<String,Object>(), new HashMap<String,Object>()); SLIPrincipal pri...
public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUser()) { if (entity == nu...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
@Test public void testGetContextualAuthoritiesNonStaff() { String token = "AQIC5wM2LY4SfczsoqTgHpfSEciO4J34Hc5ThvD0QaM2QUI.*AAJTSQACMDE.*"; Entity princEntity = new MongoEntity(null, "RegularTeacher2", new HashMap<String,Object>(), new HashMap<String,Object>()); SLIPrincipal principal = new SLIPrincipal(); principal.se...
public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUser()) { if (entity == nu...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
@Test public void testGetContextualAuthoritiesNonStaffSelf() { String token = "AQIC5wM2LY4SfczsoqTgHpfSEciO4J34Hc5ThvD0QaM2QUI.*AAJTSQACMDE.*"; Entity princEntity = new MongoEntity(null, "RegularTeacher3", new HashMap<String,Object>(), new HashMap<String,Object>()); SLIPrincipal principal = new SLIPrincipal(); principa...
public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUser()) { if (entity == nu...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
@Test public void testGetContextualAuthoritiesNullEntity() { securityContextInjector.setEducatorContext(); Collection<GrantedAuthority> auths = service.getContextualAuthorities(false, null, SecurityUtil.UserContext.TEACHER_CONTEXT,false); Assert.assertEquals("Expected no rights", NO_AUTHS, auths); }
public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUser()) { if (entity == nu...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
RightAccessValidator { public Collection<GrantedAuthority> getContextualAuthorities(boolean isSelf, Entity entity, SecurityUtil.UserContext context, boolean isRead){ Collection<GrantedAuthority> auths = new HashSet<GrantedAuthority>(); SLIPrincipal principal = SecurityUtil.getSLIPrincipal(); if (SecurityUtil.isStaffUse...
@Test public void testLogoutWithSaml() { ModelAndView mav = loginController.logout("SAMLRequest", "realm", null, httpSession); assertEquals("You are now logged out", mav.getModel().get("msg")); assertEquals("login", mav.getViewName()); Mockito.verify(httpSession, Mockito.times(1)).removeAttribute("user_session_key"); }
@RequestMapping(value = "/logout") public ModelAndView logout(@RequestParam(value="SAMLRequest", required=false) String encodedSamlRequest, @RequestParam(value = "realm", required = false) String realm, @RequestParam(value = "developer", required = false) String developer, HttpSession httpSession) { httpSession.removeA...
Login { @RequestMapping(value = "/logout") public ModelAndView logout(@RequestParam(value="SAMLRequest", required=false) String encodedSamlRequest, @RequestParam(value = "realm", required = false) String realm, @RequestParam(value = "developer", required = false) String developer, HttpSession httpSession) { httpSession...
Login { @RequestMapping(value = "/logout") public ModelAndView logout(@RequestParam(value="SAMLRequest", required=false) String encodedSamlRequest, @RequestParam(value = "realm", required = false) String realm, @RequestParam(value = "developer", required = false) String developer, HttpSession httpSession) { httpSession...
Login { @RequestMapping(value = "/logout") public ModelAndView logout(@RequestParam(value="SAMLRequest", required=false) String encodedSamlRequest, @RequestParam(value = "realm", required = false) String realm, @RequestParam(value = "developer", required = false) String developer, HttpSession httpSession) { httpSession...
Login { @RequestMapping(value = "/logout") public ModelAndView logout(@RequestParam(value="SAMLRequest", required=false) String encodedSamlRequest, @RequestParam(value = "realm", required = false) String realm, @RequestParam(value = "developer", required = false) String developer, HttpSession httpSession) { httpSession...
@SuppressWarnings("unchecked") @Test public void testBuildEntityEdOrgRights() { Set<String> edOrgs = new HashSet<String>(); edOrgs.add("edOrg1"); edOrgs.add("edOrg2"); edOrgs.add("edOrg3"); edOrgs.add("edOrg4"); Entity entity = Mockito.mock(Entity.class); Mockito.when(entity.getType()).thenReturn("student"); Mockito.wh...
public Collection<GrantedAuthority> buildEntityEdOrgRights(final Map<String, Collection<GrantedAuthority>> edOrgRights, final Entity entity, boolean isRead) { Collection<GrantedAuthority> authorities = new HashSet<GrantedAuthority>(); Set<String> edorgs = edOrgOwnershipArbiter.determineHierarchicalEdorgs(Arrays.asList(...
EntityEdOrgRightBuilder { public Collection<GrantedAuthority> buildEntityEdOrgRights(final Map<String, Collection<GrantedAuthority>> edOrgRights, final Entity entity, boolean isRead) { Collection<GrantedAuthority> authorities = new HashSet<GrantedAuthority>(); Set<String> edorgs = edOrgOwnershipArbiter.determineHierarc...
EntityEdOrgRightBuilder { public Collection<GrantedAuthority> buildEntityEdOrgRights(final Map<String, Collection<GrantedAuthority>> edOrgRights, final Entity entity, boolean isRead) { Collection<GrantedAuthority> authorities = new HashSet<GrantedAuthority>(); Set<String> edorgs = edOrgOwnershipArbiter.determineHierarc...
EntityEdOrgRightBuilder { public Collection<GrantedAuthority> buildEntityEdOrgRights(final Map<String, Collection<GrantedAuthority>> edOrgRights, final Entity entity, boolean isRead) { Collection<GrantedAuthority> authorities = new HashSet<GrantedAuthority>(); Set<String> edorgs = edOrgOwnershipArbiter.determineHierarc...
EntityEdOrgRightBuilder { public Collection<GrantedAuthority> buildEntityEdOrgRights(final Map<String, Collection<GrantedAuthority>> edOrgRights, final Entity entity, boolean isRead) { Collection<GrantedAuthority> authorities = new HashSet<GrantedAuthority>(); Set<String> edorgs = edOrgOwnershipArbiter.determineHierarc...
@SuppressWarnings("unchecked") @Test public void testBuildEntityEdOrgDualContextRights() { Set<String> edOrgs = new HashSet<String>(); edOrgs.add("edOrg1"); edOrgs.add("edOrg2"); edOrgs.add("edOrg3"); edOrgs.add("edOrg4"); Entity entity = Mockito.mock(Entity.class); Mockito.when(entity.getType()).thenReturn("student");...
public Collection<GrantedAuthority> buildEntityEdOrgContextRights(final EdOrgContextRightsCache edOrgContextRights, final Entity entity, final SecurityUtil.UserContext context, boolean isRead) { Collection<GrantedAuthority> authorities = new HashSet<GrantedAuthority>(); Set<String> edorgs = edOrgOwnershipArbiter.determ...
EntityEdOrgRightBuilder { public Collection<GrantedAuthority> buildEntityEdOrgContextRights(final EdOrgContextRightsCache edOrgContextRights, final Entity entity, final SecurityUtil.UserContext context, boolean isRead) { Collection<GrantedAuthority> authorities = new HashSet<GrantedAuthority>(); Set<String> edorgs = ed...
EntityEdOrgRightBuilder { public Collection<GrantedAuthority> buildEntityEdOrgContextRights(final EdOrgContextRightsCache edOrgContextRights, final Entity entity, final SecurityUtil.UserContext context, boolean isRead) { Collection<GrantedAuthority> authorities = new HashSet<GrantedAuthority>(); Set<String> edorgs = ed...
EntityEdOrgRightBuilder { public Collection<GrantedAuthority> buildEntityEdOrgContextRights(final EdOrgContextRightsCache edOrgContextRights, final Entity entity, final SecurityUtil.UserContext context, boolean isRead) { Collection<GrantedAuthority> authorities = new HashSet<GrantedAuthority>(); Set<String> edorgs = ed...
EntityEdOrgRightBuilder { public Collection<GrantedAuthority> buildEntityEdOrgContextRights(final EdOrgContextRightsCache edOrgContextRights, final Entity entity, final SecurityUtil.UserContext context, boolean isRead) { Collection<GrantedAuthority> authorities = new HashSet<GrantedAuthority>(); Set<String> edorgs = ed...