@Test public void test_validate() { try { _validator.validate(1L, Action.CREATE); Assert.fail("Should have thrown exception!"); } catch (Exception e) { String message = e.getMessage(); Assert.assertTrue(message.contains("internal error")); } }
public void validate(Long id, Action action) throws Exception { if(LOG.isDebugEnabled()) { LOG.debug("==> RangerValidator.validate(" + id + ")"); } List<ValidationFailureDetails> failures = new ArrayList<>(); if (isValid(id, action, failures)) { if(LOG.isDebugEnabled()) { LOG.debug("<== RangerValidator.validate(" + id + "): valid"); } } else { String message = serializeFailures(failures); LOG.debug("<== RangerValidator.validate(" + id + "): invalid, reason[" + message + "]"); throw new Exception(message); } }
RangerValidator { public void validate(Long id, Action action) throws Exception { if(LOG.isDebugEnabled()) { LOG.debug("==> RangerValidator.validate(" + id + ")"); } List<ValidationFailureDetails> failures = new ArrayList<>(); if (isValid(id, action, failures)) { if(LOG.isDebugEnabled()) { LOG.debug("<== RangerValidator.validate(" + id + "): valid"); } } else { String message = serializeFailures(failures); LOG.debug("<== RangerValidator.validate(" + id + "): invalid, reason[" + message + "]"); throw new Exception(message); } } }
RangerValidator { public void validate(Long id, Action action) throws Exception { if(LOG.isDebugEnabled()) { LOG.debug("==> RangerValidator.validate(" + id + ")"); } List<ValidationFailureDetails> failures = new ArrayList<>(); if (isValid(id, action, failures)) { if(LOG.isDebugEnabled()) { LOG.debug("<== RangerValidator.validate(" + id + "): valid"); } } else { String message = serializeFailures(failures); LOG.debug("<== RangerValidator.validate(" + id + "): invalid, reason[" + message + "]"); throw new Exception(message); } } protected  RangerValidator(ServiceStore store); protected  RangerValidator(RoleStore roleStore); }
RangerValidator { public void validate(Long id, Action action) throws Exception { if(LOG.isDebugEnabled()) { LOG.debug("==> RangerValidator.validate(" + id + ")"); } List<ValidationFailureDetails> failures = new ArrayList<>(); if (isValid(id, action, failures)) { if(LOG.isDebugEnabled()) { LOG.debug("<== RangerValidator.validate(" + id + "): valid"); } } else { String message = serializeFailures(failures); LOG.debug("<== RangerValidator.validate(" + id + "): invalid, reason[" + message + "]"); throw new Exception(message); } } protected  RangerValidator(ServiceStore store); protected  RangerValidator(RoleStore roleStore); void validate(Long id, Action action); void validate(String name, Action action); static String serializeFailures(List<ValidationFailureDetails> failures); }
RangerValidator { public void validate(Long id, Action action) throws Exception { if(LOG.isDebugEnabled()) { LOG.debug("==> RangerValidator.validate(" + id + ")"); } List<ValidationFailureDetails> failures = new ArrayList<>(); if (isValid(id, action, failures)) { if(LOG.isDebugEnabled()) { LOG.debug("<== RangerValidator.validate(" + id + "): valid"); } } else { String message = serializeFailures(failures); LOG.debug("<== RangerValidator.validate(" + id + "): invalid, reason[" + message + "]"); throw new Exception(message); } } protected  RangerValidator(ServiceStore store); protected  RangerValidator(RoleStore roleStore); void validate(Long id, Action action); void validate(String name, Action action); static String serializeFailures(List<ValidationFailureDetails> failures);  }