@Test public void testValidate() { final HttpCredential credential = new HttpCredential(); Configuration configuration = new Configuration(); List<Throwable> errors = new ArrayList<>(); credential.validate(errors, configuration); assertEquals(1, errors.size()); errors.clear(); credential.validate(errors, configuration); assertEquals(1, errors.size()); credential.setUsername("username"); errors.clear(); credential.validate(errors, configuration); assertEquals(0, errors.size()); }
@Override public void validate(final List<Throwable> validationErrors, final Configuration configuration) { if (this.username == null) { validationErrors.add(new IllegalStateException("The parameter 'username' is required.")); } }
HttpCredential implements ConfigurationObject { @Override public void validate(final List<Throwable> validationErrors, final Configuration configuration) { if (this.username == null) { validationErrors.add(new IllegalStateException("The parameter 'username' is required.")); } } }
HttpCredential implements ConfigurationObject { @Override public void validate(final List<Throwable> validationErrors, final Configuration configuration) { if (this.username == null) { validationErrors.add(new IllegalStateException("The parameter 'username' is required.")); } }  }
HttpCredential implements ConfigurationObject { @Override public void validate(final List<Throwable> validationErrors, final Configuration configuration) { if (this.username == null) { validationErrors.add(new IllegalStateException("The parameter 'username' is required.")); } }  void setMatchers(final List<? extends URIMatcher> matchers); void setUsername(final String username); void setPassword(final String password); @Override void validate(final List<Throwable> validationErrors, final Configuration configuration); boolean matches(final MatchInfo matchInfo); @Nullable final Credentials toCredentials(final AuthScope authscope); }
HttpCredential implements ConfigurationObject { @Override public void validate(final List<Throwable> validationErrors, final Configuration configuration) { if (this.username == null) { validationErrors.add(new IllegalStateException("The parameter 'username' is required.")); } }  void setMatchers(final List<? extends URIMatcher> matchers); void setUsername(final String username); void setPassword(final String password); @Override void validate(final List<Throwable> validationErrors, final Configuration configuration); boolean matches(final MatchInfo matchInfo); @Nullable final Credentials toCredentials(final AuthScope authscope);  }