Skip to content

Commit

Permalink
Add test case for serializing ValidationFailed
Browse files Browse the repository at this point in the history
  • Loading branch information
iantabolt committed Oct 6, 2017
1 parent 9153b39 commit 032dc70
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,21 @@ class ValidationTest extends TestUtils {
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
def validationAllowsListOverriddenWithSameTypeList() {
val reference = parseConfig("""{ a : [1,2,3] }""")
Expand Down

0 comments on commit 032dc70

Please sign in to comment.