@Test public void testValidateSecurityZoneForDeleteThrowsError() throws Exception{ RangerSecurityZone suppliedSecurityZone = getRangerSecurityZone(); try{ rangerSecurityZoneValidator.validate(suppliedSecurityZone, RangerValidator.Action.DELETE); }catch(IllegalArgumentException ex){ Assert.assertEquals(ex.getMessage(), "isValid(RangerPolicy, ...) is only supported for create/update"); } }
public void validate(RangerSecurityZone securityZone, Action action) throws Exception { if (LOG.isDebugEnabled()) { LOG.debug(String.format("==> RangerPolicyValidator.validate(%s, %s)", securityZone, action)); } List<ValidationFailureDetails> failures = new ArrayList<>(); boolean valid = isValid(securityZone, action, failures); String message; try { if (!valid) { message = serializeFailures(failures); throw new Exception(message); } } finally { if (LOG.isDebugEnabled()) { LOG.debug(String.format("<== RangerPolicyValidator.validate(%s, %s)", securityZone, action)); } } }
RangerSecurityZoneValidator extends RangerValidator { public void validate(RangerSecurityZone securityZone, Action action) throws Exception { if (LOG.isDebugEnabled()) { LOG.debug(String.format("==> RangerPolicyValidator.validate(%s, %s)", securityZone, action)); } List<ValidationFailureDetails> failures = new ArrayList<>(); boolean valid = isValid(securityZone, action, failures); String message; try { if (!valid) { message = serializeFailures(failures); throw new Exception(message); } } finally { if (LOG.isDebugEnabled()) { LOG.debug(String.format("<== RangerPolicyValidator.validate(%s, %s)", securityZone, action)); } } } }
RangerSecurityZoneValidator extends RangerValidator { public void validate(RangerSecurityZone securityZone, Action action) throws Exception { if (LOG.isDebugEnabled()) { LOG.debug(String.format("==> RangerPolicyValidator.validate(%s, %s)", securityZone, action)); } List<ValidationFailureDetails> failures = new ArrayList<>(); boolean valid = isValid(securityZone, action, failures); String message; try { if (!valid) { message = serializeFailures(failures); throw new Exception(message); } } finally { if (LOG.isDebugEnabled()) { LOG.debug(String.format("<== RangerPolicyValidator.validate(%s, %s)", securityZone, action)); } } } RangerSecurityZoneValidator(ServiceStore store, SecurityZoneStore securityZoneStore); }
RangerSecurityZoneValidator extends RangerValidator { public void validate(RangerSecurityZone securityZone, Action action) throws Exception { if (LOG.isDebugEnabled()) { LOG.debug(String.format("==> RangerPolicyValidator.validate(%s, %s)", securityZone, action)); } List<ValidationFailureDetails> failures = new ArrayList<>(); boolean valid = isValid(securityZone, action, failures); String message; try { if (!valid) { message = serializeFailures(failures); throw new Exception(message); } } finally { if (LOG.isDebugEnabled()) { LOG.debug(String.format("<== RangerPolicyValidator.validate(%s, %s)", securityZone, action)); } } } RangerSecurityZoneValidator(ServiceStore store, SecurityZoneStore securityZoneStore); void validate(RangerSecurityZone securityZone, Action action); }
RangerSecurityZoneValidator extends RangerValidator { public void validate(RangerSecurityZone securityZone, Action action) throws Exception { if (LOG.isDebugEnabled()) { LOG.debug(String.format("==> RangerPolicyValidator.validate(%s, %s)", securityZone, action)); } List<ValidationFailureDetails> failures = new ArrayList<>(); boolean valid = isValid(securityZone, action, failures); String message; try { if (!valid) { message = serializeFailures(failures); throw new Exception(message); } } finally { if (LOG.isDebugEnabled()) { LOG.debug(String.format("<== RangerPolicyValidator.validate(%s, %s)", securityZone, action)); } } } RangerSecurityZoneValidator(ServiceStore store, SecurityZoneStore securityZoneStore); void validate(RangerSecurityZone securityZone, Action action);  }