53 lines
1.4 KiB
Kotlin
53 lines
1.4 KiB
Kotlin
package solutions.bitbadger.documents.postgresql
|
|
|
|
import org.junit.jupiter.api.DisplayName
|
|
import solutions.bitbadger.documents.common.Delete
|
|
import kotlin.test.Test
|
|
|
|
/**
|
|
* PostgreSQL integration tests for the `Delete` object / `deleteBy*` connection extension functions
|
|
*/
|
|
@DisplayName("PostgreSQL - Delete")
|
|
class DeleteIT {
|
|
|
|
@Test
|
|
@DisplayName("byId deletes a matching ID")
|
|
fun byIdMatch() =
|
|
PgDB().use(Delete::byIdMatch)
|
|
|
|
@Test
|
|
@DisplayName("byId succeeds when no ID matches")
|
|
fun byIdNoMatch() =
|
|
PgDB().use(Delete::byIdNoMatch)
|
|
|
|
@Test
|
|
@DisplayName("byFields deletes matching documents")
|
|
fun byFieldsMatch() =
|
|
PgDB().use(Delete::byFieldsMatch)
|
|
|
|
@Test
|
|
@DisplayName("byFields succeeds when no documents match")
|
|
fun byFieldsNoMatch() =
|
|
PgDB().use(Delete::byFieldsNoMatch)
|
|
|
|
@Test
|
|
@DisplayName("byContains deletes matching documents")
|
|
fun byContainsMatch() =
|
|
PgDB().use(Delete::byContainsMatch)
|
|
|
|
@Test
|
|
@DisplayName("byContains succeeds when no documents match")
|
|
fun byContainsNoMatch() =
|
|
PgDB().use(Delete::byContainsNoMatch)
|
|
|
|
@Test
|
|
@DisplayName("byJsonPath deletes matching documents")
|
|
fun byJsonPathMatch() =
|
|
PgDB().use(Delete::byJsonPathMatch)
|
|
|
|
@Test
|
|
@DisplayName("byJsonPath succeeds when no documents match")
|
|
fun byJsonPathNoMatch() =
|
|
PgDB().use(Delete::byJsonPathNoMatch)
|
|
}
|