mirror of
https://github.com/lightbend/config.git
synced 2025-03-22 23:30:27 +08:00
Add test case for serializing ValidationFailed
This commit is contained in:
parent
9153b39094
commit
032dc70101
@ -97,6 +97,21 @@ class ValidationTest extends TestUtils {
|
|||||||
checkValidationException(e, expecteds)
|
checkValidationException(e, expecteds)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
def validationFailedSerializable(): Unit = {
|
||||||
|
// Reusing a previous test case to generate an error
|
||||||
|
val reference = parseConfig("""{ a : [{},{},{}] }""")
|
||||||
|
val conf = parseConfig("""{ a : 42 }""")
|
||||||
|
val e = intercept[ConfigException.ValidationFailed] {
|
||||||
|
conf.checkValid(reference)
|
||||||
|
}
|
||||||
|
|
||||||
|
val expecteds = Seq(WrongType("a", 1, "list", "number"))
|
||||||
|
|
||||||
|
val actual = checkSerializableNoMeaningfulEquals(e)
|
||||||
|
checkValidationException(actual, expecteds)
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
def validationAllowsListOverriddenWithSameTypeList() {
|
def validationAllowsListOverriddenWithSameTypeList() {
|
||||||
val reference = parseConfig("""{ a : [1,2,3] }""")
|
val reference = parseConfig("""{ a : [1,2,3] }""")
|
||||||
|
Loading…
Reference in New Issue
Block a user