@Test(expected = AssertionError.class) public void testSetPredicates() { final AndAccessAssertion andAssertion = applicationContext.getBean(AndAccessAssertion.class); andAssertion.setPredicates(AlwaysAllowAssertion.INSTANCE, AlwaysAllowAssertion.INSTANCE); andAssertion.setPredicates(AlwaysAllowAssertion.INSTANCE); }
public void setPredicates(@Nonnull final AccessAssertion... predicates) { if (this.predicates != null) { throw new AssertionError("Predicates can only be set a single time"); } if (predicates.length < 1) { throw new IllegalArgumentException("There must be at least 1 predicate"); } this.predicates = Arrays.asList(predicates); }
AndAccessAssertion implements AccessAssertion { public void setPredicates(@Nonnull final AccessAssertion... predicates) { if (this.predicates != null) { throw new AssertionError("Predicates can only be set a single time"); } if (predicates.length < 1) { throw new IllegalArgumentException("There must be at least 1 predicate"); } this.predicates = Arrays.asList(predicates); } }
AndAccessAssertion implements AccessAssertion { public void setPredicates(@Nonnull final AccessAssertion... predicates) { if (this.predicates != null) { throw new AssertionError("Predicates can only be set a single time"); } if (predicates.length < 1) { throw new IllegalArgumentException("There must be at least 1 predicate"); } this.predicates = Arrays.asList(predicates); }  }
AndAccessAssertion implements AccessAssertion { public void setPredicates(@Nonnull final AccessAssertion... predicates) { if (this.predicates != null) { throw new AssertionError("Predicates can only be set a single time"); } if (predicates.length < 1) { throw new IllegalArgumentException("There must be at least 1 predicate"); } this.predicates = Arrays.asList(predicates); }  void setPredicates(@Nonnull final AccessAssertion... predicates); @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(); }
AndAccessAssertion implements AccessAssertion { public void setPredicates(@Nonnull final AccessAssertion... predicates) { if (this.predicates != null) { throw new AssertionError("Predicates can only be set a single time"); } if (predicates.length < 1) { throw new IllegalArgumentException("There must be at least 1 predicate"); } this.predicates = Arrays.asList(predicates); }  void setPredicates(@Nonnull final AccessAssertion... predicates); @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();  }