test vararg for ExecutableRaw.execute

This commit is contained in:
2023-04-06 21:41:10 +02:00
parent bd473daa6c
commit 56c67981db
3 changed files with 10 additions and 21 deletions

View File

@@ -109,7 +109,16 @@ class ConnectionTest : TestAbstract() {
@Test
fun `test update Entity`() {
val obj = ObjTest("before", id = UUID.fromString("1e5f5d41-6d14-4007-897b-0ed2616bec96"))
val objUpdated: ObjTest? = connection.execute("select ?::jsonb || jsonb_build_object('name', 'after');", obj.toTypeReference(), obj)
val objUpdated: ObjTest? = connection.execute("select ?::jsonb || jsonb_build_object('name', 'after');", obj.toTypeReference(), listOf(obj))
assertNotNull(objUpdated)
assertEquals(UUID.fromString("1e5f5d41-6d14-4007-897b-0ed2616bec96"), objUpdated.id)
assertEquals("after", objUpdated.name)
}
@Test
fun `test update Entity with vararg`() {
val obj = ObjTest("before", id = UUID.fromString("1e5f5d41-6d14-4007-897b-0ed2616bec96"))
val objUpdated: ObjTest? = connection.execute("select :obj::jsonb || jsonb_build_object('name', 'after');", obj.toTypeReference(), "obj" to obj)
assertNotNull(objUpdated)
assertEquals(UUID.fromString("1e5f5d41-6d14-4007-897b-0ed2616bec96"), objUpdated.id)
assertEquals("after", objUpdated.name)