From f94a8aa41610dd9770d93ca9c6a753162941a537 Mon Sep 17 00:00:00 2001 From: matt-ramotar Date: Sun, 17 Nov 2024 16:52:13 -0500 Subject: [PATCH] Move util to test_utils Signed-off-by: matt-ramotar --- .../store/store5/ClearAllStoreTests.kt | 6 ++-- .../store/store5/ClearStoreByKeyTests.kt | 6 ++-- .../store/store5/FallbackTests.kt | 10 +++---- .../store/store5/FetcherResponseTests.kt | 2 +- .../store/store5/FlowStoreTests.kt | 12 ++++---- .../store/store5/HotFlowStoreTests.kt | 2 +- .../store/store5/KeyTrackerTests.kt | 2 +- .../store/store5/LocalOnlyTests.kt | 4 +-- .../store/store5/MapIndexedTests.kt | 2 +- .../store/store5/SourceOfTruthErrorsTests.kt | 8 +++--- .../store5/SourceOfTruthWithBarrierTests.kt | 4 +-- .../store5/StreamWithoutSourceOfTruthTests.kt | 4 +-- .../store/store5/UpdaterTests.kt | 28 +++++++++---------- .../store/store5/ValueFetcherTests.kt | 2 +- .../store5/{util => test_utils}/AsFlowable.kt | 2 +- .../AssertEmitsExactly.kt | 2 +- .../{util => test_utils}/FakeFetcher.kt | 2 +- .../{util => test_utils}/InMemoryPersister.kt | 2 +- .../store5/{util => test_utils}/TestApi.kt | 2 +- .../{util => test_utils}/TestStoreExt.kt | 2 +- .../fake/NoteCollections.kt | 4 +-- .../store5/{util => test_utils}/fake/Notes.kt | 4 +-- .../{util => test_utils}/fake/NotesApi.kt | 12 ++++---- .../fake/NotesBookkeeping.kt | 2 +- .../fake/NotesConverterProvider.kt | 8 +++--- .../fake/NotesDatabase.kt | 6 ++-- .../{util => test_utils}/fake/NotesKey.kt | 2 +- .../fake/NotesUpdaterProvider.kt | 8 +++--- .../fake/NotesValidator.kt | 4 +-- .../fake/fallback/HardcodedPages.kt | 2 +- .../fake/fallback/Page.kt | 2 +- .../fake/fallback/PagesDatabase.kt | 2 +- .../fake/fallback/PrimaryPagesApi.kt | 2 +- .../fake/fallback/SecondaryPagesApi.kt | 2 +- .../{util => test_utils}/model/NoteData.kt | 4 +-- 35 files changed, 84 insertions(+), 84 deletions(-) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/AsFlowable.kt (98%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/AssertEmitsExactly.kt (84%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/FakeFetcher.kt (97%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/InMemoryPersister.kt (96%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/TestApi.kt (83%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/TestStoreExt.kt (93%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/fake/NoteCollections.kt (56%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/fake/Notes.kt (79%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/fake/NotesApi.kt (80%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/fake/NotesBookkeeping.kt (93%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/fake/NotesConverterProvider.kt (68%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/fake/NotesDatabase.kt (80%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/fake/NotesKey.kt (67%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/fake/NotesUpdaterProvider.kt (67%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/fake/NotesValidator.kt (73%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/fake/fallback/HardcodedPages.kt (81%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/fake/fallback/Page.kt (66%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/fake/fallback/PagesDatabase.kt (77%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/fake/fallback/PrimaryPagesApi.kt (86%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/fake/fallback/SecondaryPagesApi.kt (82%) rename store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/{util => test_utils}/model/NoteData.kt (81%) diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/ClearAllStoreTests.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/ClearAllStoreTests.kt index a871a0665..41f7a80a9 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/ClearAllStoreTests.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/ClearAllStoreTests.kt @@ -6,9 +6,9 @@ import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.advanceUntilIdle import kotlinx.coroutines.test.runTest import org.mobilenativefoundation.store.core5.ExperimentalStoreApi -import org.mobilenativefoundation.store.store5.util.InMemoryPersister -import org.mobilenativefoundation.store.store5.util.asSourceOfTruth -import org.mobilenativefoundation.store.store5.util.getData +import org.mobilenativefoundation.store.store5.test_utils.InMemoryPersister +import org.mobilenativefoundation.store.store5.test_utils.asSourceOfTruth +import org.mobilenativefoundation.store.store5.test_utils.getData import kotlin.test.BeforeTest import kotlin.test.Test import kotlin.test.assertEquals diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/ClearStoreByKeyTests.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/ClearStoreByKeyTests.kt index e08556b44..cf6b1b6f2 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/ClearStoreByKeyTests.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/ClearStoreByKeyTests.kt @@ -5,9 +5,9 @@ import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runTest import org.mobilenativefoundation.store.store5.StoreReadResponse.Data -import org.mobilenativefoundation.store.store5.util.InMemoryPersister -import org.mobilenativefoundation.store.store5.util.asSourceOfTruth -import org.mobilenativefoundation.store.store5.util.getData +import org.mobilenativefoundation.store.store5.test_utils.InMemoryPersister +import org.mobilenativefoundation.store.store5.test_utils.asSourceOfTruth +import org.mobilenativefoundation.store.store5.test_utils.getData import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNull diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/FallbackTests.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/FallbackTests.kt index d18cc79db..29cfae8a4 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/FallbackTests.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/FallbackTests.kt @@ -4,11 +4,11 @@ import kotlinx.coroutines.flow.take import kotlinx.coroutines.flow.toList import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runTest -import org.mobilenativefoundation.store.store5.util.fake.fallback.HardcodedPages -import org.mobilenativefoundation.store.store5.util.fake.fallback.Page -import org.mobilenativefoundation.store.store5.util.fake.fallback.PagesDatabase -import org.mobilenativefoundation.store.store5.util.fake.fallback.PrimaryPagesApi -import org.mobilenativefoundation.store.store5.util.fake.fallback.SecondaryPagesApi +import org.mobilenativefoundation.store.store5.test_utils.fake.fallback.HardcodedPages +import org.mobilenativefoundation.store.store5.test_utils.fake.fallback.Page +import org.mobilenativefoundation.store.store5.test_utils.fake.fallback.PagesDatabase +import org.mobilenativefoundation.store.store5.test_utils.fake.fallback.PrimaryPagesApi +import org.mobilenativefoundation.store.store5.test_utils.fake.fallback.SecondaryPagesApi import kotlin.test.BeforeTest import kotlin.test.Test import kotlin.test.assertEquals diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/FetcherResponseTests.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/FetcherResponseTests.kt index 4f009f849..8712f5457 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/FetcherResponseTests.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/FetcherResponseTests.kt @@ -7,7 +7,7 @@ import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.toList import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runTest -import org.mobilenativefoundation.store.store5.util.assertEmitsExactly +import org.mobilenativefoundation.store.store5.test_utils.assertEmitsExactly import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFailsWith diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/FlowStoreTests.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/FlowStoreTests.kt index af2a2f2d7..afd9703e5 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/FlowStoreTests.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/FlowStoreTests.kt @@ -34,12 +34,12 @@ import kotlinx.coroutines.test.runTest import org.mobilenativefoundation.store.store5.StoreReadResponse.Data import org.mobilenativefoundation.store.store5.StoreReadResponse.Loading import org.mobilenativefoundation.store.store5.impl.extensions.fresh -import org.mobilenativefoundation.store.store5.util.FakeFetcher -import org.mobilenativefoundation.store.store5.util.FakeFlowingFetcher -import org.mobilenativefoundation.store.store5.util.InMemoryPersister -import org.mobilenativefoundation.store.store5.util.asFlowable -import org.mobilenativefoundation.store.store5.util.asSourceOfTruth -import org.mobilenativefoundation.store.store5.util.assertEmitsExactly +import org.mobilenativefoundation.store.store5.test_utils.FakeFetcher +import org.mobilenativefoundation.store.store5.test_utils.FakeFlowingFetcher +import org.mobilenativefoundation.store.store5.test_utils.InMemoryPersister +import org.mobilenativefoundation.store.store5.test_utils.asFlowable +import org.mobilenativefoundation.store.store5.test_utils.asSourceOfTruth +import org.mobilenativefoundation.store.store5.test_utils.assertEmitsExactly import kotlin.test.Test import kotlin.test.assertContains import kotlin.test.assertEquals diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/HotFlowStoreTests.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/HotFlowStoreTests.kt index fdc905e74..a258251c8 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/HotFlowStoreTests.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/HotFlowStoreTests.kt @@ -6,7 +6,7 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runTest -import org.mobilenativefoundation.store.store5.util.assertEmitsExactly +import org.mobilenativefoundation.store.store5.test_utils.assertEmitsExactly import kotlin.test.Test import kotlin.test.assertEquals diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/KeyTrackerTests.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/KeyTrackerTests.kt index a38fb4d10..ed343bf0f 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/KeyTrackerTests.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/KeyTrackerTests.kt @@ -10,7 +10,7 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.advanceUntilIdle import kotlinx.coroutines.test.runTest -import org.mobilenativefoundation.store.store5.util.KeyTracker +import org.mobilenativefoundation.store.store5.test_utils.KeyTracker import kotlin.test.Test import kotlin.test.assertEquals diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/LocalOnlyTests.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/LocalOnlyTests.kt index 632478bda..e969b591a 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/LocalOnlyTests.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/LocalOnlyTests.kt @@ -5,8 +5,8 @@ import kotlinx.coroutines.flow.first import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runTest import org.mobilenativefoundation.store.store5.impl.extensions.get -import org.mobilenativefoundation.store.store5.util.InMemoryPersister -import org.mobilenativefoundation.store.store5.util.asSourceOfTruth +import org.mobilenativefoundation.store.store5.test_utils.InMemoryPersister +import org.mobilenativefoundation.store.store5.test_utils.asSourceOfTruth import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertTrue diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/MapIndexedTests.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/MapIndexedTests.kt index a1650e13d..37af42159 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/MapIndexedTests.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/MapIndexedTests.kt @@ -5,7 +5,7 @@ import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runTest import org.mobilenativefoundation.store.store5.impl.operators.mapIndexed -import org.mobilenativefoundation.store.store5.util.assertEmitsExactly +import org.mobilenativefoundation.store.store5.test_utils.assertEmitsExactly import kotlin.test.Test @OptIn(ExperimentalCoroutinesApi::class) diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/SourceOfTruthErrorsTests.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/SourceOfTruthErrorsTests.kt index 200b0ae2c..2fb7ce6db 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/SourceOfTruthErrorsTests.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/SourceOfTruthErrorsTests.kt @@ -12,10 +12,10 @@ import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runTest import org.mobilenativefoundation.store.store5.SourceOfTruth.ReadException import org.mobilenativefoundation.store.store5.SourceOfTruth.WriteException -import org.mobilenativefoundation.store.store5.util.FakeFetcher -import org.mobilenativefoundation.store.store5.util.InMemoryPersister -import org.mobilenativefoundation.store.store5.util.asSourceOfTruth -import org.mobilenativefoundation.store.store5.util.assertEmitsExactly +import org.mobilenativefoundation.store.store5.test_utils.FakeFetcher +import org.mobilenativefoundation.store.store5.test_utils.InMemoryPersister +import org.mobilenativefoundation.store.store5.test_utils.asSourceOfTruth +import org.mobilenativefoundation.store.store5.test_utils.assertEmitsExactly import kotlin.test.Test @OptIn(ExperimentalCoroutinesApi::class) diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/SourceOfTruthWithBarrierTests.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/SourceOfTruthWithBarrierTests.kt index 1cbab5218..a14616d95 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/SourceOfTruthWithBarrierTests.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/SourceOfTruthWithBarrierTests.kt @@ -31,8 +31,8 @@ import org.mobilenativefoundation.store.store5.SourceOfTruth.ReadException import org.mobilenativefoundation.store.store5.SourceOfTruth.WriteException import org.mobilenativefoundation.store.store5.impl.PersistentSourceOfTruth import org.mobilenativefoundation.store.store5.impl.SourceOfTruthWithBarrier -import org.mobilenativefoundation.store.store5.util.InMemoryPersister -import org.mobilenativefoundation.store.store5.util.assertEmitsExactly +import org.mobilenativefoundation.store.store5.test_utils.InMemoryPersister +import org.mobilenativefoundation.store.store5.test_utils.assertEmitsExactly import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNull diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/StreamWithoutSourceOfTruthTests.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/StreamWithoutSourceOfTruthTests.kt index 8610aa233..3674108fe 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/StreamWithoutSourceOfTruthTests.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/StreamWithoutSourceOfTruthTests.kt @@ -8,8 +8,8 @@ import kotlinx.coroutines.flow.take import kotlinx.coroutines.flow.toList import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runTest -import org.mobilenativefoundation.store.store5.util.FakeFetcher -import org.mobilenativefoundation.store.store5.util.assertEmitsExactly +import org.mobilenativefoundation.store.store5.test_utils.FakeFetcher +import org.mobilenativefoundation.store.store5.test_utils.assertEmitsExactly import kotlin.test.Test import kotlin.test.assertEquals diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/UpdaterTests.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/UpdaterTests.kt index 72ae4270b..7135c0561 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/UpdaterTests.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/UpdaterTests.kt @@ -9,20 +9,20 @@ import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runTest import org.mobilenativefoundation.store.core5.ExperimentalStoreApi import org.mobilenativefoundation.store.store5.impl.extensions.inHours -import org.mobilenativefoundation.store.store5.util.assertEmitsExactly -import org.mobilenativefoundation.store.store5.util.fake.Notes -import org.mobilenativefoundation.store.store5.util.fake.NotesApi -import org.mobilenativefoundation.store.store5.util.fake.NotesBookkeeping -import org.mobilenativefoundation.store.store5.util.fake.NotesConverterProvider -import org.mobilenativefoundation.store.store5.util.fake.NotesDatabase -import org.mobilenativefoundation.store.store5.util.fake.NotesKey -import org.mobilenativefoundation.store.store5.util.fake.NotesUpdaterProvider -import org.mobilenativefoundation.store.store5.util.fake.NotesValidator -import org.mobilenativefoundation.store.store5.util.model.InputNote -import org.mobilenativefoundation.store.store5.util.model.NetworkNote -import org.mobilenativefoundation.store.store5.util.model.NoteData -import org.mobilenativefoundation.store.store5.util.model.NotesWriteResponse -import org.mobilenativefoundation.store.store5.util.model.OutputNote +import org.mobilenativefoundation.store.store5.test_utils.assertEmitsExactly +import org.mobilenativefoundation.store.store5.test_utils.fake.Notes +import org.mobilenativefoundation.store.store5.test_utils.fake.NotesApi +import org.mobilenativefoundation.store.store5.test_utils.fake.NotesBookkeeping +import org.mobilenativefoundation.store.store5.test_utils.fake.NotesConverterProvider +import org.mobilenativefoundation.store.store5.test_utils.fake.NotesDatabase +import org.mobilenativefoundation.store.store5.test_utils.fake.NotesKey +import org.mobilenativefoundation.store.store5.test_utils.fake.NotesUpdaterProvider +import org.mobilenativefoundation.store.store5.test_utils.fake.NotesValidator +import org.mobilenativefoundation.store.store5.test_utils.model.InputNote +import org.mobilenativefoundation.store.store5.test_utils.model.NetworkNote +import org.mobilenativefoundation.store.store5.test_utils.model.NoteData +import org.mobilenativefoundation.store.store5.test_utils.model.NotesWriteResponse +import org.mobilenativefoundation.store.store5.test_utils.model.OutputNote import kotlin.test.BeforeTest import kotlin.test.Test import kotlin.test.assertEquals diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/ValueFetcherTests.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/ValueFetcherTests.kt index 3e138597f..a82b3d8ac 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/ValueFetcherTests.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/ValueFetcherTests.kt @@ -6,7 +6,7 @@ import kotlinx.coroutines.flow.flow import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runTest -import org.mobilenativefoundation.store.store5.util.assertEmitsExactly +import org.mobilenativefoundation.store.store5.test_utils.assertEmitsExactly import kotlin.test.Test @ExperimentalCoroutinesApi diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/AsFlowable.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/AsFlowable.kt similarity index 98% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/AsFlowable.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/AsFlowable.kt index 60d8bb9ca..de65efa2b 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/AsFlowable.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/AsFlowable.kt @@ -1,4 +1,4 @@ -package org.mobilenativefoundation.store.store5.util +package org.mobilenativefoundation.store.store5.test_utils import kotlinx.coroutines.NonCancellable import kotlinx.coroutines.channels.BufferOverflow diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/AssertEmitsExactly.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/AssertEmitsExactly.kt similarity index 84% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/AssertEmitsExactly.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/AssertEmitsExactly.kt index c6572c9dc..a0802e46a 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/AssertEmitsExactly.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/AssertEmitsExactly.kt @@ -1,4 +1,4 @@ -package org.mobilenativefoundation.store.store5.util +package org.mobilenativefoundation.store.store5.test_utils import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.take diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/FakeFetcher.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/FakeFetcher.kt similarity index 97% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/FakeFetcher.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/FakeFetcher.kt index dd8c88efe..6c2496b49 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/FakeFetcher.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/FakeFetcher.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.mobilenativefoundation.store.store5.util +package org.mobilenativefoundation.store.store5.test_utils import kotlinx.coroutines.delay import kotlinx.coroutines.flow.Flow diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/InMemoryPersister.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/InMemoryPersister.kt similarity index 96% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/InMemoryPersister.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/InMemoryPersister.kt index 0ba8d1f32..699f5bf1f 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/InMemoryPersister.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/InMemoryPersister.kt @@ -1,4 +1,4 @@ -package org.mobilenativefoundation.store.store5.util +package org.mobilenativefoundation.store.store5.test_utils import org.mobilenativefoundation.store.store5.SourceOfTruth diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/TestApi.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/TestApi.kt similarity index 83% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/TestApi.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/TestApi.kt index 778021e9d..6d654f0dc 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/TestApi.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/TestApi.kt @@ -1,4 +1,4 @@ -package org.mobilenativefoundation.store.store5.util +package org.mobilenativefoundation.store.store5.test_utils internal interface TestApi { fun get( diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/TestStoreExt.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/TestStoreExt.kt similarity index 93% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/TestStoreExt.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/TestStoreExt.kt index 87e3f1679..1e8120b05 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/TestStoreExt.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/TestStoreExt.kt @@ -1,4 +1,4 @@ -package org.mobilenativefoundation.store.store5.util +package org.mobilenativefoundation.store.store5.test_utils import kotlinx.coroutines.flow.filterNot import kotlinx.coroutines.flow.first diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NoteCollections.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NoteCollections.kt similarity index 56% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NoteCollections.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NoteCollections.kt index 8482cff6f..6b217060d 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NoteCollections.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NoteCollections.kt @@ -1,6 +1,6 @@ -package org.mobilenativefoundation.store.store5.util.fake +package org.mobilenativefoundation.store.store5.test_utils.fake -import org.mobilenativefoundation.store.store5.util.model.NoteData +import org.mobilenativefoundation.store.store5.test_utils.model.NoteData internal object NoteCollections { object Keys { diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/Notes.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/Notes.kt similarity index 79% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/Notes.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/Notes.kt index cfc4c6e75..a75d80fb6 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/Notes.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/Notes.kt @@ -1,6 +1,6 @@ -package org.mobilenativefoundation.store.store5.util.fake +package org.mobilenativefoundation.store.store5.test_utils.fake -import org.mobilenativefoundation.store.store5.util.model.Note +import org.mobilenativefoundation.store.store5.test_utils.model.Note internal object Notes { val One = Note("1", "Title-1", "Content-1") diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesApi.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesApi.kt similarity index 80% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesApi.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesApi.kt index f7de9e21b..03448a544 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesApi.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesApi.kt @@ -1,10 +1,10 @@ -package org.mobilenativefoundation.store.store5.util.fake +package org.mobilenativefoundation.store.store5.test_utils.fake -import org.mobilenativefoundation.store.store5.util.TestApi -import org.mobilenativefoundation.store.store5.util.model.InputNote -import org.mobilenativefoundation.store.store5.util.model.NetworkNote -import org.mobilenativefoundation.store.store5.util.model.NoteData -import org.mobilenativefoundation.store.store5.util.model.NotesWriteResponse +import org.mobilenativefoundation.store.store5.test_utils.TestApi +import org.mobilenativefoundation.store.store5.test_utils.model.InputNote +import org.mobilenativefoundation.store.store5.test_utils.model.NetworkNote +import org.mobilenativefoundation.store.store5.test_utils.model.NoteData +import org.mobilenativefoundation.store.store5.test_utils.model.NotesWriteResponse internal class NotesApi : TestApi { internal val db = mutableMapOf() diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesBookkeeping.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesBookkeeping.kt similarity index 93% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesBookkeeping.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesBookkeeping.kt index 61c342820..c9ae244a1 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesBookkeeping.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesBookkeeping.kt @@ -1,4 +1,4 @@ -package org.mobilenativefoundation.store.store5.util.fake +package org.mobilenativefoundation.store.store5.test_utils.fake class NotesBookkeeping { private val log: MutableMap = mutableMapOf() diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesConverterProvider.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesConverterProvider.kt similarity index 68% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesConverterProvider.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesConverterProvider.kt index ee89216da..9841a3f3e 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesConverterProvider.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesConverterProvider.kt @@ -1,10 +1,10 @@ -package org.mobilenativefoundation.store.store5.util.fake +package org.mobilenativefoundation.store.store5.test_utils.fake import org.mobilenativefoundation.store.store5.Converter import org.mobilenativefoundation.store.store5.impl.extensions.inHours -import org.mobilenativefoundation.store.store5.util.model.InputNote -import org.mobilenativefoundation.store.store5.util.model.NetworkNote -import org.mobilenativefoundation.store.store5.util.model.OutputNote +import org.mobilenativefoundation.store.store5.test_utils.model.InputNote +import org.mobilenativefoundation.store.store5.test_utils.model.NetworkNote +import org.mobilenativefoundation.store.store5.test_utils.model.OutputNote internal class NotesConverterProvider { fun provide(): Converter = diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesDatabase.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesDatabase.kt similarity index 80% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesDatabase.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesDatabase.kt index 063a0a3a9..50d453873 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesDatabase.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesDatabase.kt @@ -1,7 +1,7 @@ -package org.mobilenativefoundation.store.store5.util.fake +package org.mobilenativefoundation.store.store5.test_utils.fake -import org.mobilenativefoundation.store.store5.util.model.InputNote -import org.mobilenativefoundation.store.store5.util.model.OutputNote +import org.mobilenativefoundation.store.store5.test_utils.model.InputNote +import org.mobilenativefoundation.store.store5.test_utils.model.OutputNote internal class NotesDatabase { private val db: MutableMap = mutableMapOf() diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesKey.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesKey.kt similarity index 67% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesKey.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesKey.kt index 25058d3b6..29ddd1d98 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesKey.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesKey.kt @@ -1,4 +1,4 @@ -package org.mobilenativefoundation.store.store5.util.fake +package org.mobilenativefoundation.store.store5.test_utils.fake sealed class NotesKey { data class Single(val id: String) : NotesKey() diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesUpdaterProvider.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesUpdaterProvider.kt similarity index 67% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesUpdaterProvider.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesUpdaterProvider.kt index 35529028e..5cc086cc8 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesUpdaterProvider.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesUpdaterProvider.kt @@ -1,10 +1,10 @@ -package org.mobilenativefoundation.store.store5.util.fake +package org.mobilenativefoundation.store.store5.test_utils.fake import org.mobilenativefoundation.store.store5.Updater import org.mobilenativefoundation.store.store5.UpdaterResult -import org.mobilenativefoundation.store.store5.util.model.InputNote -import org.mobilenativefoundation.store.store5.util.model.NotesWriteResponse -import org.mobilenativefoundation.store.store5.util.model.OutputNote +import org.mobilenativefoundation.store.store5.test_utils.model.InputNote +import org.mobilenativefoundation.store.store5.test_utils.model.NotesWriteResponse +import org.mobilenativefoundation.store.store5.test_utils.model.OutputNote internal class NotesUpdaterProvider(private val api: NotesApi) { fun provide(): Updater = diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesValidator.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesValidator.kt similarity index 73% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesValidator.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesValidator.kt index bf7296f22..2b1162b7f 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/NotesValidator.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/NotesValidator.kt @@ -1,8 +1,8 @@ -package org.mobilenativefoundation.store.store5.util.fake +package org.mobilenativefoundation.store.store5.test_utils.fake import org.mobilenativefoundation.store.store5.Validator import org.mobilenativefoundation.store.store5.impl.extensions.now -import org.mobilenativefoundation.store.store5.util.model.OutputNote +import org.mobilenativefoundation.store.store5.test_utils.model.OutputNote internal class NotesValidator(private val expiration: Long = now()) : Validator { override suspend fun isValid(item: OutputNote): Boolean = diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/fallback/HardcodedPages.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/fallback/HardcodedPages.kt similarity index 81% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/fallback/HardcodedPages.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/fallback/HardcodedPages.kt index d7c7c9441..8e7dda33f 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/fallback/HardcodedPages.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/fallback/HardcodedPages.kt @@ -1,4 +1,4 @@ -package org.mobilenativefoundation.store.store5.util.fake.fallback +package org.mobilenativefoundation.store.store5.test_utils.fake.fallback class HardcodedPages { val name = "HardcodedPages" diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/fallback/Page.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/fallback/Page.kt similarity index 66% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/fallback/Page.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/fallback/Page.kt index ccc456277..826940a12 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/fallback/Page.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/fallback/Page.kt @@ -1,4 +1,4 @@ -package org.mobilenativefoundation.store.store5.util.fake.fallback +package org.mobilenativefoundation.store.store5.test_utils.fake.fallback sealed class Page { data class Data( diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/fallback/PagesDatabase.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/fallback/PagesDatabase.kt similarity index 77% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/fallback/PagesDatabase.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/fallback/PagesDatabase.kt index 3c7a0f245..0857961ab 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/fallback/PagesDatabase.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/fallback/PagesDatabase.kt @@ -1,4 +1,4 @@ -package org.mobilenativefoundation.store.store5.util.fake.fallback +package org.mobilenativefoundation.store.store5.test_utils.fake.fallback class PagesDatabase { private val db: MutableMap = mutableMapOf() diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/fallback/PrimaryPagesApi.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/fallback/PrimaryPagesApi.kt similarity index 86% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/fallback/PrimaryPagesApi.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/fallback/PrimaryPagesApi.kt index 7c8126702..0aa79a164 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/fallback/PrimaryPagesApi.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/fallback/PrimaryPagesApi.kt @@ -1,4 +1,4 @@ -package org.mobilenativefoundation.store.store5.util.fake.fallback +package org.mobilenativefoundation.store.store5.test_utils.fake.fallback class PrimaryPagesApi { val name = "PrimaryPagesApi" diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/fallback/SecondaryPagesApi.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/fallback/SecondaryPagesApi.kt similarity index 82% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/fallback/SecondaryPagesApi.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/fallback/SecondaryPagesApi.kt index 59c3fb398..97de292a8 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/fake/fallback/SecondaryPagesApi.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/fake/fallback/SecondaryPagesApi.kt @@ -1,4 +1,4 @@ -package org.mobilenativefoundation.store.store5.util.fake.fallback +package org.mobilenativefoundation.store.store5.test_utils.fake.fallback class SecondaryPagesApi() { val name: String = "SecondaryPagesApi" diff --git a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/model/NoteData.kt b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/model/NoteData.kt similarity index 81% rename from store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/model/NoteData.kt rename to store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/model/NoteData.kt index cce0fc5fa..ca5e231c5 100644 --- a/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/util/model/NoteData.kt +++ b/store/src/commonTest/kotlin/org/mobilenativefoundation/store/store5/test_utils/model/NoteData.kt @@ -1,6 +1,6 @@ -package org.mobilenativefoundation.store.store5.util.model +package org.mobilenativefoundation.store.store5.test_utils.model -import org.mobilenativefoundation.store.store5.util.fake.NotesKey +import org.mobilenativefoundation.store.store5.test_utils.fake.NotesKey internal sealed class NoteData { data class Single(val item: Note) : NoteData()