@Test public void testValidate() { final HttpProxy httpProxy = new HttpProxy(); List<Throwable> errors = new ArrayList<>(); Configuration configuration = new Configuration(); httpProxy.validate(errors, configuration); assertEquals(1, errors.size()); httpProxy.setHost(LOCALHOST); httpProxy.setPort(PROXY_PORT); errors.clear(); httpProxy.validate(errors, configuration); assertEquals(0, errors.size()); }
@Override public void validate(final List<Throwable> validationErrors, final Configuration configuration) { if (this.host == null) { validationErrors.add(new IllegalStateException("The parameter 'host' is required.")); } }
HttpProxy extends HttpCredential { @Override public void validate(final List<Throwable> validationErrors, final Configuration configuration) { if (this.host == null) { validationErrors.add(new IllegalStateException("The parameter 'host' is required.")); } } }
HttpProxy extends HttpCredential { @Override public void validate(final List<Throwable> validationErrors, final Configuration configuration) { if (this.host == null) { validationErrors.add(new IllegalStateException("The parameter 'host' is required.")); } }  }
HttpProxy extends HttpCredential { @Override public void validate(final List<Throwable> validationErrors, final Configuration configuration) { if (this.host == null) { validationErrors.add(new IllegalStateException("The parameter 'host' is required.")); } }  HttpHost getHttpHost(); void setScheme(final String scheme); void setMatchers(final List<? extends URIMatcher> matchers); void setHost(final String host); void setUsername(final String username); void setPassword(final String password); void setPort(final int port); @Override void validate(final List<Throwable> validationErrors, final Configuration configuration); }
HttpProxy extends HttpCredential { @Override public void validate(final List<Throwable> validationErrors, final Configuration configuration) { if (this.host == null) { validationErrors.add(new IllegalStateException("The parameter 'host' is required.")); } }  HttpHost getHttpHost(); void setScheme(final String scheme); void setMatchers(final List<? extends URIMatcher> matchers); void setHost(final String host); void setUsername(final String username); void setPassword(final String password); void setPort(final int port); @Override void validate(final List<Throwable> validationErrors, final Configuration configuration);  }