72 lines
2.4 KiB
Kotlin
72 lines
2.4 KiB
Kotlin
package solutions.bitbadger.documents.kotlinx.tests.integration
|
|
|
|
import org.junit.jupiter.api.DisplayName
|
|
import kotlin.test.Test
|
|
|
|
/**
|
|
* PostgreSQL integration tests for the `RemoveFields` object / `removeFieldsBy*` connection extension functions
|
|
*/
|
|
@DisplayName("KotlinX | PostgreSQL: RemoveFields")
|
|
class PostgreSQLRemoveFieldsIT {
|
|
|
|
@Test
|
|
@DisplayName("byId removes fields from an existing document")
|
|
fun byIdMatchFields() =
|
|
PgDB().use(RemoveFieldsFunctions::byIdMatchFields)
|
|
|
|
@Test
|
|
@DisplayName("byId succeeds when fields do not exist on an existing document")
|
|
fun byIdMatchNoFields() =
|
|
PgDB().use(RemoveFieldsFunctions::byIdMatchNoFields)
|
|
|
|
@Test
|
|
@DisplayName("byId succeeds when no document exists")
|
|
fun byIdNoMatch() =
|
|
PgDB().use(RemoveFieldsFunctions::byIdNoMatch)
|
|
|
|
@Test
|
|
@DisplayName("byFields removes fields from matching documents")
|
|
fun byFieldsMatchFields() =
|
|
PgDB().use(RemoveFieldsFunctions::byFieldsMatchFields)
|
|
|
|
@Test
|
|
@DisplayName("byFields succeeds when fields do not exist on matching documents")
|
|
fun byFieldsMatchNoFields() =
|
|
PgDB().use(RemoveFieldsFunctions::byFieldsMatchNoFields)
|
|
|
|
@Test
|
|
@DisplayName("byFields succeeds when no matching documents exist")
|
|
fun byFieldsNoMatch() =
|
|
PgDB().use(RemoveFieldsFunctions::byFieldsNoMatch)
|
|
|
|
@Test
|
|
@DisplayName("byContains removes fields from matching documents")
|
|
fun byContainsMatchFields() =
|
|
PgDB().use(RemoveFieldsFunctions::byContainsMatchFields)
|
|
|
|
@Test
|
|
@DisplayName("byContains succeeds when fields do not exist on matching documents")
|
|
fun byContainsMatchNoFields() =
|
|
PgDB().use(RemoveFieldsFunctions::byContainsMatchNoFields)
|
|
|
|
@Test
|
|
@DisplayName("byContains succeeds when no matching documents exist")
|
|
fun byContainsNoMatch() =
|
|
PgDB().use(RemoveFieldsFunctions::byContainsNoMatch)
|
|
|
|
@Test
|
|
@DisplayName("byJsonPath removes fields from matching documents")
|
|
fun byJsonPathMatchFields() =
|
|
PgDB().use(RemoveFieldsFunctions::byJsonPathMatchFields)
|
|
|
|
@Test
|
|
@DisplayName("byJsonPath succeeds when fields do not exist on matching documents")
|
|
fun byJsonPathMatchNoFields() =
|
|
PgDB().use(RemoveFieldsFunctions::byJsonPathMatchNoFields)
|
|
|
|
@Test
|
|
@DisplayName("byJsonPath succeeds when no matching documents exist")
|
|
fun byJsonPathNoMatch() =
|
|
PgDB().use(RemoveFieldsFunctions::byJsonPathNoMatch)
|
|
}
|