From 1120f817c326cb5445dcd57aa716cd7f518395dc Mon Sep 17 00:00:00 2001 From: Julian Bokelmann Date: Fri, 9 Aug 2024 15:50:20 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20fix=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sipgate/federmappe/common/decoder}/DummyDataNormalizer.kt | 4 +--- .../federmappe/common/decoder/StringMapToObjectDecoder.kt | 2 +- .../de/sipgate/federmappe/realtimedb/DataSnapshotExt.kt | 1 + 3 files changed, 3 insertions(+), 4 deletions(-) rename {realtimedb/src/main/kotlin/de/sipgate/federmappe/realtimedb => common/src/main/kotlin/de/sipgate/federmappe/common/decoder}/DummyDataNormalizer.kt (55%) diff --git a/realtimedb/src/main/kotlin/de/sipgate/federmappe/realtimedb/DummyDataNormalizer.kt b/common/src/main/kotlin/de/sipgate/federmappe/common/decoder/DummyDataNormalizer.kt similarity index 55% rename from realtimedb/src/main/kotlin/de/sipgate/federmappe/realtimedb/DummyDataNormalizer.kt rename to common/src/main/kotlin/de/sipgate/federmappe/common/decoder/DummyDataNormalizer.kt index a147f38..539c57d 100644 --- a/realtimedb/src/main/kotlin/de/sipgate/federmappe/realtimedb/DummyDataNormalizer.kt +++ b/common/src/main/kotlin/de/sipgate/federmappe/common/decoder/DummyDataNormalizer.kt @@ -1,6 +1,4 @@ -package de.sipgate.federmappe.realtimedb - -import de.sipgate.federmappe.common.decoder.DataNormalizer +package de.sipgate.federmappe.common.decoder class DummyDataNormalizer : DataNormalizer { override fun normalize(data: Map): Map = data diff --git a/common/src/main/kotlin/de/sipgate/federmappe/common/decoder/StringMapToObjectDecoder.kt b/common/src/main/kotlin/de/sipgate/federmappe/common/decoder/StringMapToObjectDecoder.kt index 7fb4aa8..255a9d9 100644 --- a/common/src/main/kotlin/de/sipgate/federmappe/common/decoder/StringMapToObjectDecoder.kt +++ b/common/src/main/kotlin/de/sipgate/federmappe/common/decoder/StringMapToObjectDecoder.kt @@ -19,7 +19,7 @@ class StringMapToObjectDecoder( private val data: Map, override val serializersModule: SerializersModule = EmptySerializersModule(), private val ignoreUnknownProperties: Boolean = false, - private val dataNormalizer: DataNormalizer + private val dataNormalizer: DataNormalizer = DummyDataNormalizer() ) : AbstractDecoder(), TypeAwareDecoder { private val keysIterator = data.sortByPrio().keys.iterator() private var index: Int? = null diff --git a/realtimedb/src/main/kotlin/de/sipgate/federmappe/realtimedb/DataSnapshotExt.kt b/realtimedb/src/main/kotlin/de/sipgate/federmappe/realtimedb/DataSnapshotExt.kt index b61c98e..c7fd5f7 100644 --- a/realtimedb/src/main/kotlin/de/sipgate/federmappe/realtimedb/DataSnapshotExt.kt +++ b/realtimedb/src/main/kotlin/de/sipgate/federmappe/realtimedb/DataSnapshotExt.kt @@ -3,6 +3,7 @@ package de.sipgate.federmappe.realtimedb import com.google.firebase.database.DataSnapshot import de.sipgate.federmappe.common.ErrorHandler import de.sipgate.federmappe.common.decoder.DataNormalizer +import de.sipgate.federmappe.common.decoder.DummyDataNormalizer import de.sipgate.federmappe.common.toObjectWithSerializer import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.modules.EmptySerializersModule