mirror of
https://github.com/lightbend/config.git
synced 2025-03-18 21:30:30 +08:00
Add a test for serializing WrongType exception
There's a bug report about this not working... it seems to work here though.
This commit is contained in:
parent
a3c255e50a
commit
a7240387e8
@ -954,6 +954,17 @@ class PublicApiTest extends TestUtils {
|
||||
assertTrue("origin null after deserialize", e.origin() == null)
|
||||
}
|
||||
|
||||
@Test
|
||||
def exceptionSerializableWithWrongType() {
|
||||
val e = intercept[ConfigException.WrongType] {
|
||||
ConfigValueFactory.fromAnyRef(Map("item" -> "uhoh, fail").asJava) match {
|
||||
case o: ConfigObject => o.toConfig.getStringList("item")
|
||||
}
|
||||
}
|
||||
val eCopy = checkSerializableNoMeaningfulEquals(e)
|
||||
assertTrue("messages equal after deserialize", e.getMessage.equals(eCopy.getMessage))
|
||||
}
|
||||
|
||||
@Test
|
||||
def invalidateCaches() {
|
||||
val conf0 = ConfigFactory.load()
|
||||
|
Loading…
Reference in New Issue
Block a user