@Test @ExpectedException(value = AccessDeniedException.class) public void testInvalidDelete() { existingSection.getBody().put(ParameterConstants.SCHOOL_ID, UN_ASSOCIATED_ED_ORG); when(uriInfo.getPathSegments()).thenReturn(putPath); writeValidator.validateWriteRequest(null, 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);  }