aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/test/java/com/vaadin/data/ValidatorTest.java
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2016-11-01 11:38:17 +0200
committerDenis Anisimov <denis@vaadin.com>2016-11-01 17:14:19 +0200
commite4d132f4cb84a7aafdf70b5e5ca2121b66c87bfa (patch)
treef4a1a5160cafb94482e12d8f0dda8ce9ba82146c /server/src/test/java/com/vaadin/data/ValidatorTest.java
parent855ec0f67951da7f4392ae704796340e1d1a3ff3 (diff)
downloadvaadin-framework-e4d132f4cb84a7aafdf70b5e5ca2121b66c87bfa.tar.gz
vaadin-framework-e4d132f4cb84a7aafdf70b5e5ca2121b66c87bfa.zip
Introduces ValidationResult interface to replace Result in validators.
Fixes vaadin/framework8-issues#414 Change-Id: I2d4e101f29542fadfdd30ce63455a0e078e0e735
Diffstat (limited to 'server/src/test/java/com/vaadin/data/ValidatorTest.java')
-rw-r--r--server/src/test/java/com/vaadin/data/ValidatorTest.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/server/src/test/java/com/vaadin/data/ValidatorTest.java b/server/src/test/java/com/vaadin/data/ValidatorTest.java
index fa533c5010..9640550d95 100644
--- a/server/src/test/java/com/vaadin/data/ValidatorTest.java
+++ b/server/src/test/java/com/vaadin/data/ValidatorTest.java
@@ -33,17 +33,15 @@ public class ValidatorTest extends ValidatorTestBase {
@Test
public void alwaysPass() {
Validator<String> alwaysPass = Validator.alwaysPass();
- Result<String> result = alwaysPass.apply("foo", new ValueContext());
- Assert.assertTrue(result instanceof SimpleResult);
- SimpleResult<String> implRes = (SimpleResult<String>) result;
- Assert.assertFalse(implRes.getMessage().isPresent());
+ ValidationResult result = alwaysPass.apply("foo", new ValueContext());
+ Assert.assertFalse(result.isError());
}
@Test
public void from() {
Validator<String> validator = Validator.from(Objects::nonNull,
"Cannot be null");
- Result<String> result = validator.apply(null, new ValueContext());
+ ValidationResult result = validator.apply(null, new ValueContext());
Assert.assertTrue(result.isError());
result = validator.apply("", new ValueContext());