use of io.vertx.ext.web.api.validation.ParameterTypeValidator in project vertx-web by vert-x3.
the class SingleValueParameterTypeValidatorTest method nullTest.
@Test(expected = ValidationException.class)
public void nullTest() {
ParameterTypeValidator validator = new MockSingleValueParameterTypeValidator(null);
validator.isValid(null);
}
use of io.vertx.ext.web.api.validation.ParameterTypeValidator in project vertx-web by vert-x3.
the class StringTypeValidatorTest method isValidMaxLength.
@Test
public void isValidMaxLength() {
ParameterTypeValidator validator = new StringTypeValidator(null, null, 3, null);
validator.isValid("aaa");
}
use of io.vertx.ext.web.api.validation.ParameterTypeValidator in project vertx-web by vert-x3.
the class StringTypeValidatorTest method isValidPattern.
@Test
public void isValidPattern() {
ParameterTypeValidator validator = new StringTypeValidator(RegularExpressions.EMAIL);
validator.isValid("admin@vertx.io");
}
use of io.vertx.ext.web.api.validation.ParameterTypeValidator in project vertx-web by vert-x3.
the class StringTypeValidatorTest method isNotValidPattern.
@Test(expected = ValidationException.class)
public void isNotValidPattern() {
ParameterTypeValidator validator = new StringTypeValidator(RegularExpressions.EMAIL);
validator.isValid("admin.vertx.io");
}
use of io.vertx.ext.web.api.validation.ParameterTypeValidator in project vertx-web by vert-x3.
the class StringTypeValidatorTest method isValidMinLength.
@Test
public void isValidMinLength() {
ParameterTypeValidator validator = new StringTypeValidator(null, 2, null, null);
validator.isValid("aaa");
}
Aggregations