Add patch functions
This commit is contained in:
52
src/integration-test/kotlin/postgresql/PatchIT.kt
Normal file
52
src/integration-test/kotlin/postgresql/PatchIT.kt
Normal file
@@ -0,0 +1,52 @@
|
||||
package solutions.bitbadger.documents.postgresql
|
||||
|
||||
import org.junit.jupiter.api.DisplayName
|
||||
import solutions.bitbadger.documents.common.Patch
|
||||
import kotlin.test.Test
|
||||
|
||||
/**
|
||||
* PostgreSQL integration tests for the `Patch` object / `patchBy*` connection extension functions
|
||||
*/
|
||||
@DisplayName("PostgreSQL - Patch")
|
||||
class PatchIT {
|
||||
|
||||
@Test
|
||||
@DisplayName("byId patches an existing document")
|
||||
fun byIdMatch() =
|
||||
PgDB().use(Patch::byIdMatch)
|
||||
|
||||
@Test
|
||||
@DisplayName("byId succeeds for a non-existent document")
|
||||
fun byIdNoMatch() =
|
||||
PgDB().use(Patch::byIdNoMatch)
|
||||
|
||||
@Test
|
||||
@DisplayName("byFields patches matching document")
|
||||
fun byFieldsMatch() =
|
||||
PgDB().use(Patch::byFieldsMatch)
|
||||
|
||||
@Test
|
||||
@DisplayName("byFields succeeds when no documents match")
|
||||
fun byFieldsNoMatch() =
|
||||
PgDB().use(Patch::byFieldsNoMatch)
|
||||
|
||||
@Test
|
||||
@DisplayName("byContains patches matching document")
|
||||
fun byContainsMatch() =
|
||||
PgDB().use(Patch::byContainsMatch)
|
||||
|
||||
@Test
|
||||
@DisplayName("byContains succeeds when no documents match")
|
||||
fun byContainsNoMatch() =
|
||||
PgDB().use(Patch::byContainsNoMatch)
|
||||
|
||||
@Test
|
||||
@DisplayName("byJsonPath patches matching document")
|
||||
fun byJsonPathMatch() =
|
||||
PgDB().use(Patch::byJsonPathMatch)
|
||||
|
||||
@Test
|
||||
@DisplayName("byJsonPath succeeds when no documents match")
|
||||
fun byJsonPathNoMatch() =
|
||||
PgDB().use(Patch::byJsonPathNoMatch)
|
||||
}
|
||||
Reference in New Issue
Block a user