@Test public void testValidate() { List<Throwable> errors = new ArrayList<>(); final RoleAccessAssertion assertion = new RoleAccessAssertion(); assertion.validate(errors, null); assertEquals(1, errors.size()); errors.clear(); assertion.setRequiredRoles(Collections.singleton("ROLE_USER")); assertion.validate(errors, null); assertEquals(0, errors.size()); }
@Override public void validate(final List<Throwable> validationErrors, final Configuration configuration) { if (this.requiredRoles == null) { validationErrors.add(new ConfigurationException("requiredRoles must be defined")); } }
RoleAccessAssertion implements AccessAssertion { @Override public void validate(final List<Throwable> validationErrors, final Configuration configuration) { if (this.requiredRoles == null) { validationErrors.add(new ConfigurationException("requiredRoles must be defined")); } } }
RoleAccessAssertion implements AccessAssertion { @Override public void validate(final List<Throwable> validationErrors, final Configuration configuration) { if (this.requiredRoles == null) { validationErrors.add(new ConfigurationException("requiredRoles must be defined")); } }  }
RoleAccessAssertion implements AccessAssertion { @Override public void validate(final List<Throwable> validationErrors, final Configuration configuration) { if (this.requiredRoles == null) { validationErrors.add(new ConfigurationException("requiredRoles must be defined")); } }  @SuppressWarnings("unchecked") AccessAssertion setRequiredRoles(final Collection<String> assertionRequiredRoles); @Override void assertAccess(final String resourceDescription, final Object protectedResource); @Override JSONObject marshal(); @Override void unmarshal(final JSONObject encodedAssertion); @Override void validate(final List<Throwable> validationErrors, final Configuration configuration); @Override boolean equals(final Object o); @Override int hashCode(); @Override AccessAssertion copy(); }
RoleAccessAssertion implements AccessAssertion { @Override public void validate(final List<Throwable> validationErrors, final Configuration configuration) { if (this.requiredRoles == null) { validationErrors.add(new ConfigurationException("requiredRoles must be defined")); } }  @SuppressWarnings("unchecked") AccessAssertion setRequiredRoles(final Collection<String> assertionRequiredRoles); @Override void assertAccess(final String resourceDescription, final Object protectedResource); @Override JSONObject marshal(); @Override void unmarshal(final JSONObject encodedAssertion); @Override void validate(final List<Throwable> validationErrors, final Configuration configuration); @Override boolean equals(final Object o); @Override int hashCode(); @Override AccessAssertion copy();  }