mirror of
https://github.com/InsanusMokrassar/SDI.git
synced 2024-11-27 12:38:55 +00:00
fix test
This commit is contained in:
parent
2d158fe166
commit
376d29046f
@ -25,16 +25,17 @@ class DeserializationTest {
|
|||||||
@Test
|
@Test
|
||||||
fun test_that_simple_config_correctly_work() {
|
fun test_that_simple_config_correctly_work() {
|
||||||
val names = arrayOf("nameOne", "nameTwo")
|
val names = arrayOf("nameOne", "nameTwo")
|
||||||
|
val controllerName = "controller"
|
||||||
val input = """
|
val input = """
|
||||||
{
|
{
|
||||||
"service": [
|
"service": [
|
||||||
"com.insanusmokrassar.sdi.BusinessService",
|
"${BusinessService::class.qualifiedName}",
|
||||||
{
|
{
|
||||||
"names": ${names.joinToString(prefix = "[", postfix = "]") { "\"$it\"" }}
|
"names": ${names.joinToString(prefix = "[", postfix = "]") { "\"$it\"" }}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"controller": [
|
"$controllerName": [
|
||||||
"com.insanusmokrassar.sdi.Controller",
|
"${Controller::class.qualifiedName}",
|
||||||
{
|
{
|
||||||
"service": "service"
|
"service": "service"
|
||||||
}
|
}
|
||||||
@ -42,7 +43,7 @@ class DeserializationTest {
|
|||||||
}
|
}
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
val module = Json.plain.parse(Module.serializer(), input)
|
val module = Json.plain.parse(Module.serializer(), input)
|
||||||
(module["controller"] as ControllerAPI)
|
(module[controllerName] as ControllerAPI)
|
||||||
val controller = (module["controller"] as Controller)
|
val controller = (module["controller"] as Controller)
|
||||||
assertEquals(names.toList(), controller.service.names)
|
assertEquals(names.toList(), controller.service.names)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user