@Test public void testValidProxyConfigWithAuth() { ProxyRequest proxyRequest = new ProxyRequest(); proxyRequest.setUserName("user"); proxyRequest.setPassword("pwd"); Assert.assertTrue(underTest.isValid(proxyRequest, null)); }
@Override public boolean isValid(ProxyRequest proxyRequest, ConstraintValidatorContext constraintValidatorContext) { String user = proxyRequest.getUserName(); String password = proxyRequest.getPassword(); return StringUtils.isAllEmpty(user, password) || StringUtils.isNoneBlank(user, password); }
ProxyConfigAuthValidator implements ConstraintValidator<ValidProxyConfigAuthRequest, ProxyRequest> { @Override public boolean isValid(ProxyRequest proxyRequest, ConstraintValidatorContext constraintValidatorContext) { String user = proxyRequest.getUserName(); String password = proxyRequest.getPassword(); return StringUtils.isAllEmpty(user, password) || StringUtils.isNoneBlank(user, password); } }
ProxyConfigAuthValidator implements ConstraintValidator<ValidProxyConfigAuthRequest, ProxyRequest> { @Override public boolean isValid(ProxyRequest proxyRequest, ConstraintValidatorContext constraintValidatorContext) { String user = proxyRequest.getUserName(); String password = proxyRequest.getPassword(); return StringUtils.isAllEmpty(user, password) || StringUtils.isNoneBlank(user, password); }  }
ProxyConfigAuthValidator implements ConstraintValidator<ValidProxyConfigAuthRequest, ProxyRequest> { @Override public boolean isValid(ProxyRequest proxyRequest, ConstraintValidatorContext constraintValidatorContext) { String user = proxyRequest.getUserName(); String password = proxyRequest.getPassword(); return StringUtils.isAllEmpty(user, password) || StringUtils.isNoneBlank(user, password); }  @Override boolean isValid(ProxyRequest proxyRequest, ConstraintValidatorContext constraintValidatorContext); }
ProxyConfigAuthValidator implements ConstraintValidator<ValidProxyConfigAuthRequest, ProxyRequest> { @Override public boolean isValid(ProxyRequest proxyRequest, ConstraintValidatorContext constraintValidatorContext) { String user = proxyRequest.getUserName(); String password = proxyRequest.getPassword(); return StringUtils.isAllEmpty(user, password) || StringUtils.isNoneBlank(user, password); }  @Override boolean isValid(ProxyRequest proxyRequest, ConstraintValidatorContext constraintValidatorContext);  }