@Test public void testValidWritingInEdOrgHierarchyCreate() { EntityBody entityBody = new EntityBody(); entityBody.put(ParameterConstants.SCHOOL_ID, ED_ORG_B); when(uriInfo.getPathSegments()).thenReturn(postPath); writeValidator.validateWriteRequest(entityBody, uriInfo, principal); }
public void validateWriteRequest(EntityBody entityBody, UriInfo uriInfo, SLIPrincipal principal) { targetEdOrgIds = new HashSet<String>(); if (isWriteValidationEnabled && !isValidForEdOrgWrite(entityBody, uriInfo, principal)) { throw new APIAccessDeniedException("Invalid reference. No association to referenced entity.", targetEdOrgIds); } }
WriteValidator { public void validateWriteRequest(EntityBody entityBody, UriInfo uriInfo, SLIPrincipal principal) { targetEdOrgIds = new HashSet<String>(); if (isWriteValidationEnabled && !isValidForEdOrgWrite(entityBody, uriInfo, principal)) { throw new APIAccessDeniedException("Invalid reference. No association to referenced entity.", targetEdOrgIds); } } }
WriteValidator { public void validateWriteRequest(EntityBody entityBody, UriInfo uriInfo, SLIPrincipal principal) { targetEdOrgIds = new HashSet<String>(); if (isWriteValidationEnabled && !isValidForEdOrgWrite(entityBody, uriInfo, principal)) { throw new APIAccessDeniedException("Invalid reference. No association to referenced entity.", targetEdOrgIds); } }  }
WriteValidator { public void validateWriteRequest(EntityBody entityBody, UriInfo uriInfo, SLIPrincipal principal) { targetEdOrgIds = new HashSet<String>(); if (isWriteValidationEnabled && !isValidForEdOrgWrite(entityBody, uriInfo, principal)) { throw new APIAccessDeniedException("Invalid reference. No association to referenced entity.", targetEdOrgIds); } }  void validateWriteRequest(EntityBody entityBody, UriInfo uriInfo, SLIPrincipal principal); void setRepo(PagingRepositoryDelegate<Entity> repo); }
WriteValidator { public void validateWriteRequest(EntityBody entityBody, UriInfo uriInfo, SLIPrincipal principal) { targetEdOrgIds = new HashSet<String>(); if (isWriteValidationEnabled && !isValidForEdOrgWrite(entityBody, uriInfo, principal)) { throw new APIAccessDeniedException("Invalid reference. No association to referenced entity.", targetEdOrgIds); } }  void validateWriteRequest(EntityBody entityBody, UriInfo uriInfo, SLIPrincipal principal); void setRepo(PagingRepositoryDelegate<Entity> repo);  }