14
14
* limitations under the License.
15
15
*/
16
16
17
- @file:OptIn(ExperimentalFirebaseDataConnect ::class )
18
-
19
17
package com.google.firebase.dataconnect
20
18
21
19
import com.google.firebase.dataconnect.testutil.DataConnectIntegrationTestBase
22
20
import com.google.firebase.dataconnect.testutil.property.arbitrary.dataConnect
21
+ import com.google.firebase.dataconnect.testutil.withNullAppended
23
22
import io.kotest.assertions.assertSoftly
24
23
import io.kotest.assertions.throwables.shouldThrow
25
24
import io.kotest.assertions.withClue
@@ -185,11 +184,6 @@ class EnumIntegrationTest : DataConnectIntegrationTestBase() {
185
184
@Serializable data class Item (val value : N5ekmae3jn )
186
185
}
187
186
188
- @Serializable
189
- private data class GetNonNullableByKeySubsetData (val item : Item ? ) {
190
- @Serializable data class Item (val value : N5ekmae3jnSubset )
191
- }
192
-
193
187
// ////////////////////////////////////////////////////////////////////////////////////////////////
194
188
// Tests for EnumNullable table.
195
189
// ////////////////////////////////////////////////////////////////////////////////////////////////
@@ -234,12 +228,9 @@ class EnumIntegrationTest : DataConnectIntegrationTestBase() {
234
228
val insertVariables = InsertNullableVariables (enumValue)
235
229
val key = dataConnect.mutation(insertVariables).execute().data.key
236
230
val queryVariables = GetNullableByKeyVariables (key)
237
- val queryRef =
238
- dataConnect
239
- .query(queryVariables)
240
- .withDataDeserializer(serializer<GetNullableByKeySubsetData >())
231
+ val queryRef = dataConnect.query(queryVariables)
241
232
val queryResult = queryRef.execute().data
242
- withClue(queryResult) { queryResult.item?.value shouldBe enumValue }
233
+ withClue(queryResult) { queryResult? .item?.value shouldBe enumValue }
243
234
}
244
235
}
245
236
@@ -319,11 +310,6 @@ class EnumIntegrationTest : DataConnectIntegrationTestBase() {
319
310
@Serializable data class Item (val value : N5ekmae3jn ? )
320
311
}
321
312
322
- @Serializable
323
- private data class GetNullableByKeySubsetData (val item : Item ? ) {
324
- @Serializable data class Item (val value : N5ekmae3jnSubset ? )
325
- }
326
-
327
313
// ////////////////////////////////////////////////////////////////////////////////////////////////
328
314
// Tests for EnumNonNullableTableDefault table.
329
315
// ////////////////////////////////////////////////////////////////////////////////////////////////
@@ -420,11 +406,6 @@ class EnumIntegrationTest : DataConnectIntegrationTestBase() {
420
406
@Serializable data class Item (val value : List <N5ekmae3jn ?>)
421
407
}
422
408
423
- @Serializable
424
- private data class GetNonNullableListOfNonNullableByKeySubsetData (val item : Item ? ) {
425
- @Serializable data class Item (val value : List <N5ekmae3jnSubset ?>? )
426
- }
427
-
428
409
// ////////////////////////////////////////////////////////////////////////////////////////////////
429
410
// Tests for EnumNonNullableListOfNullable table.
430
411
// ////////////////////////////////////////////////////////////////////////////////////////////////
@@ -739,13 +720,6 @@ class EnumIntegrationTest : DataConnectIntegrationTestBase() {
739
720
N3HWNCRWBP ,
740
721
}
741
722
742
- @Suppress(" SpellCheckingInspection" )
743
- private enum class N5ekmae3jnSubset {
744
- DPSKD6HR3A ,
745
- XGWGVMYTHJ ,
746
- QJX7C7RD5T
747
- }
748
-
749
723
@Suppress(" SpellCheckingInspection" , " unused" )
750
724
enum class S7yayynb25 {
751
725
XJ27ZAXKD3 ,
@@ -759,20 +733,6 @@ class EnumIntegrationTest : DataConnectIntegrationTestBase() {
759
733
/* * The default number of iterations to use in property-based tests. */
760
734
const val NUM_ITERATIONS = 10
761
735
762
- fun <T > List<T>.withNullAppended (): List <T ?> =
763
- buildList(size + 1 ) {
764
- addAll(this )
765
- add(null )
766
- }
767
-
768
- fun N5ekmae3jn.toN5ekmae3jnSubsetOrNull (): N5ekmae3jnSubset ? =
769
- when (this ) {
770
- N5ekmae3jn .DPSKD6HR3A -> N5ekmae3jnSubset .DPSKD6HR3A
771
- N5ekmae3jn .XGWGVMYTHJ -> N5ekmae3jnSubset .XGWGVMYTHJ
772
- N5ekmae3jn .QJX7C7RD5T -> N5ekmae3jnSubset .QJX7C7RD5T
773
- else -> null
774
- }
775
-
776
736
fun FirebaseDataConnect.mutation (
777
737
variables : InsertNonNullableVariables
778
738
): MutationRef <InsertData , InsertNonNullableVariables > =
0 commit comments