1 |
|
package liquibase.exception; |
2 |
|
|
3 |
|
import static org.junit.Assert.*; |
4 |
|
import org.junit.Test; |
5 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 2 |
Complexity Density: 0.22 |
|
6 |
|
public class ValidatorErrorsTest { |
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1
PASS
|
|
7 |
1
|
@Test... |
8 |
|
public void hasErrors() { |
9 |
1
|
ValidationErrors errors = new ValidationErrors(); |
10 |
1
|
assertFalse(errors.hasErrors()); |
11 |
|
|
12 |
1
|
errors.addError("test message"); |
13 |
|
|
14 |
1
|
assertTrue(errors.hasErrors()); |
15 |
|
|
16 |
|
} |
17 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1
PASS
|
|
18 |
1
|
@Test... |
19 |
|
public void checkRequiredField_nullValue() { |
20 |
1
|
ValidationErrors errors = new ValidationErrors(); |
21 |
1
|
assertFalse(errors.hasErrors()); |
22 |
|
|
23 |
1
|
errors.checkRequiredField("testField", null); |
24 |
|
|
25 |
1
|
assertTrue(errors.hasErrors()); |
26 |
1
|
assertTrue(errors.getErrorMessages().contains("testField is required")); |
27 |
|
|
28 |
|
} |
29 |
|
} |