refactoring: force cast args

This commit is contained in:
2019-06-17 14:13:12 +02:00
parent 00d2fa335d
commit f960e4a66a
4 changed files with 33 additions and 12 deletions

View File

@@ -2,7 +2,7 @@ package fr.postgresjson
import fr.postgresjson.connexion.Connection
import fr.postgresjson.entity.IdEntity
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
@@ -46,4 +46,11 @@ class ConnectionTest(): TestAbstract() {
assertTrue(objs[0].id == 1)
assertTrue(objs[0].test!!.id == 1)
}
@Test
fun callRequestWithArgs() {
val result: ObjTest? = connection.selectOne("select json_build_object('id', 1, 'name', ?::text)", listOf("myName"))
assertNotNull(result)
assertEquals("myName", result!!.name)
}
}