From 1fed83269b3f2a57f0d8419978d3d025a72ee8e0 Mon Sep 17 00:00:00 2001 From: Hadi Satrio Date: Thu, 16 Nov 2023 23:00:57 +0700 Subject: [PATCH 1/3] root: Change the coordinates for 'kotlin-test' Ever since we upgraded to Kotlin 1.9.x, IntelliJ has been unable to properly resolve 'kotlin.test.Test'. This turned out to be a known bug (KT-62368) set to be fixed in Kotlin 2.0. The recommended workaround for now is to depend on 'kotlin-test-junit' instead. --- app-kmm-journal3/build.gradle.kts | 2 +- lib-kmm-foundation/build.gradle.kts | 2 +- lib-kmm-geography/build.gradle.kts | 2 +- lib-kmm-io/build.gradle.kts | 2 +- lib-kmm-json/build.gradle.kts | 2 +- lib-kmm-paraphrase/build.gradle.kts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app-kmm-journal3/build.gradle.kts b/app-kmm-journal3/build.gradle.kts index 918423dd..f9fd32df 100644 --- a/app-kmm-journal3/build.gradle.kts +++ b/app-kmm-journal3/build.gradle.kts @@ -26,7 +26,7 @@ kotlin { } val commonTest by getting { dependencies { - implementation(kotlin("test")) + implementation(kotlin("test-junit")) implementation(Dependencies.TestUtility.REACTIVE_EXTENSIONS_TEST) implementation(Dependencies.TestUtility.KOTEST_ASSERTIONS) implementation(Dependencies.TestDouble.OKIO_FAKE_FS) diff --git a/lib-kmm-foundation/build.gradle.kts b/lib-kmm-foundation/build.gradle.kts index a5ca56e0..1a52215e 100644 --- a/lib-kmm-foundation/build.gradle.kts +++ b/lib-kmm-foundation/build.gradle.kts @@ -23,7 +23,7 @@ kotlin { } val commonTest by getting { dependencies { - implementation(kotlin("test")) + implementation(kotlin("test-junit")) implementation(Dependencies.TestUtility.REACTIVE_EXTENSIONS_TEST) implementation(Dependencies.TestUtility.KOTEST_ASSERTIONS) implementation(Dependencies.TestDouble.MOCKK) diff --git a/lib-kmm-geography/build.gradle.kts b/lib-kmm-geography/build.gradle.kts index ca58c75f..570da9c0 100644 --- a/lib-kmm-geography/build.gradle.kts +++ b/lib-kmm-geography/build.gradle.kts @@ -25,7 +25,7 @@ kotlin { } val commonTest by getting { dependencies { - implementation(kotlin("test")) + implementation(kotlin("test-junit")) implementation(Dependencies.TestUtility.KOTEST_ASSERTIONS) implementation(Dependencies.TestUtility.ROBOLECTRIC) implementation(Dependencies.TestDouble.MOCKK) diff --git a/lib-kmm-io/build.gradle.kts b/lib-kmm-io/build.gradle.kts index fe3653e7..2fc1e80e 100644 --- a/lib-kmm-io/build.gradle.kts +++ b/lib-kmm-io/build.gradle.kts @@ -22,7 +22,7 @@ kotlin { } val commonTest by getting { dependencies { - implementation(kotlin("test")) + implementation(kotlin("test-junit")) implementation(Dependencies.TestUtility.KOTEST_ASSERTIONS) implementation(Dependencies.TestDouble.OKIO_FAKE_FS) implementation(Dependencies.TestDouble.MOCKK) diff --git a/lib-kmm-json/build.gradle.kts b/lib-kmm-json/build.gradle.kts index f92a7bf7..c8ee348d 100644 --- a/lib-kmm-json/build.gradle.kts +++ b/lib-kmm-json/build.gradle.kts @@ -22,7 +22,7 @@ kotlin { } val commonTest by getting { dependencies { - implementation(kotlin("test")) + implementation(kotlin("test-junit")) implementation(Dependencies.TestUtility.KOTEST_ASSERTIONS) implementation(Dependencies.TestDouble.OKIO_FAKE_FS) } diff --git a/lib-kmm-paraphrase/build.gradle.kts b/lib-kmm-paraphrase/build.gradle.kts index 3396deff..c1797184 100644 --- a/lib-kmm-paraphrase/build.gradle.kts +++ b/lib-kmm-paraphrase/build.gradle.kts @@ -22,7 +22,7 @@ kotlin { } val commonTest by getting { dependencies { - implementation(kotlin("test")) + implementation(kotlin("test-junit")) implementation(Dependencies.TestUtility.KOTEST_ASSERTIONS) implementation(Dependencies.TestDouble.MOCKK) implementation(Dependencies.TestDouble.KTOR_MOCK_ENGINE) From 4e7763959833e76ec0bdd66652910a991d538ff7 Mon Sep 17 00:00:00 2001 From: Hadi Satrio Date: Thu, 16 Nov 2023 23:05:15 +0700 Subject: [PATCH 2/3] root: Clean 'org.junit.*' from the common source sets Common source should not directly depend on a JVM library like JUnit. Though this is effectively a non-issue because we do have JVM as one of the targets, it's still an inappropriate thing to do. --- .../kotlin/journal3/alert/AlertInactivityUseCaseTest.kt | 2 +- .../apps/kotlin/journal3/moment/MergedMemorablesTest.kt | 2 +- .../kotlin/journal3/moment/UpdateDeferringMomentTest.kt | 6 +++--- .../apps/kotlin/journal3/story/ShowStoryUseCaseTest.kt | 2 +- .../apps/kotlin/journal3/story/UpdateDeferringStoryTest.kt | 6 +++--- .../kotlin/foundation/ExecutorDispatchingUseCaseTest.kt | 2 +- .../libs/kotlin/foundation/event/EventSinksTest.kt | 2 +- .../presentation/ExecutorDispatchingPresenterTest.kt | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/alert/AlertInactivityUseCaseTest.kt b/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/alert/AlertInactivityUseCaseTest.kt index 9e6c6fd4..37a6b5b4 100644 --- a/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/alert/AlertInactivityUseCaseTest.kt +++ b/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/alert/AlertInactivityUseCaseTest.kt @@ -31,7 +31,7 @@ import io.kotest.matchers.shouldBe import io.mockk.mockk import io.mockk.verify import kotlinx.datetime.Clock -import org.junit.Test +import kotlin.test.Test import kotlin.time.Duration.Companion.days import kotlin.time.Duration.Companion.hours diff --git a/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/moment/MergedMemorablesTest.kt b/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/moment/MergedMemorablesTest.kt index 66d8e415..cbfee757 100644 --- a/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/moment/MergedMemorablesTest.kt +++ b/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/moment/MergedMemorablesTest.kt @@ -6,7 +6,7 @@ import com.hadisatrio.apps.kotlin.journal3.moment.fake.FakeMemorables import io.kotest.assertions.throwables.shouldThrow import io.kotest.matchers.collections.shouldBeEmpty import io.kotest.matchers.collections.shouldHaveSize -import org.junit.Test +import kotlin.test.Test class MergedMemorablesTest { diff --git a/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/moment/UpdateDeferringMomentTest.kt b/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/moment/UpdateDeferringMomentTest.kt index 72b56cd7..dd9ccb07 100644 --- a/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/moment/UpdateDeferringMomentTest.kt +++ b/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/moment/UpdateDeferringMomentTest.kt @@ -31,15 +31,15 @@ import io.kotest.matchers.equals.shouldBeEqual import io.kotest.matchers.equals.shouldNotBeEqual import io.kotest.matchers.shouldBe import kotlinx.datetime.Instant -import org.junit.Before -import org.junit.Test +import kotlin.test.BeforeTest +import kotlin.test.Test class UpdateDeferringMomentTest { private lateinit var original: EditableMoment private lateinit var updateDeferring: UpdateDeferringMoment - @Before + @BeforeTest fun `Inits subjects`() { val stories = SelfPopulatingStories(noOfStories = 1, noOfMoments = 1, origin = FakeStories()) original = stories.first().moments.first() as EditableMoment diff --git a/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/story/ShowStoryUseCaseTest.kt b/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/story/ShowStoryUseCaseTest.kt index 2d5ff3c6..b1abc6cf 100644 --- a/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/story/ShowStoryUseCaseTest.kt +++ b/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/story/ShowStoryUseCaseTest.kt @@ -32,7 +32,7 @@ import io.kotest.matchers.booleans.shouldBeTrue import io.kotest.matchers.shouldBe import io.mockk.mockk import io.mockk.verify -import org.junit.Test +import kotlin.test.Test class ShowStoryUseCaseTest { diff --git a/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/story/UpdateDeferringStoryTest.kt b/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/story/UpdateDeferringStoryTest.kt index 4e5ae273..aa7f37cf 100644 --- a/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/story/UpdateDeferringStoryTest.kt +++ b/app-kmm-journal3/src/commonTest/kotlin/com/hadisatrio/apps/kotlin/journal3/story/UpdateDeferringStoryTest.kt @@ -23,15 +23,15 @@ import io.kotest.matchers.booleans.shouldBeFalse import io.kotest.matchers.booleans.shouldBeTrue import io.kotest.matchers.equals.shouldBeEqual import io.kotest.matchers.equals.shouldNotBeEqual -import org.junit.Before -import org.junit.Test +import kotlin.test.BeforeTest +import kotlin.test.Test class UpdateDeferringStoryTest { private lateinit var original: EditableStory private lateinit var updateDeferring: UpdateDeferringStory - @Before + @BeforeTest fun `Inits subjects`() { val stories = SelfPopulatingStories(noOfStories = 1, noOfMoments = 1, origin = FakeStories()) original = stories.first() as EditableStory diff --git a/lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/ExecutorDispatchingUseCaseTest.kt b/lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/ExecutorDispatchingUseCaseTest.kt index 21106b37..0b925efa 100644 --- a/lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/ExecutorDispatchingUseCaseTest.kt +++ b/lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/ExecutorDispatchingUseCaseTest.kt @@ -21,8 +21,8 @@ import com.hadisatrio.libs.kotlin.foundation.concurrent.CurrentThreadExecutor import io.mockk.mockk import io.mockk.spyk import io.mockk.verify -import org.junit.Test import java.util.concurrent.Executor +import kotlin.test.Test class ExecutorDispatchingUseCaseTest { diff --git a/lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/event/EventSinksTest.kt b/lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/event/EventSinksTest.kt index 9aa89505..fb22f6f2 100644 --- a/lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/event/EventSinksTest.kt +++ b/lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/event/EventSinksTest.kt @@ -19,7 +19,7 @@ package com.hadisatrio.libs.kotlin.foundation.event import com.hadisatrio.libs.kotlin.foundation.event.fake.FakeEventSink import io.kotest.matchers.shouldBe -import org.junit.Test +import kotlin.test.Test class EventSinksTest { diff --git a/lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/presentation/ExecutorDispatchingPresenterTest.kt b/lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/presentation/ExecutorDispatchingPresenterTest.kt index 6d3a7314..76cec02a 100644 --- a/lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/presentation/ExecutorDispatchingPresenterTest.kt +++ b/lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/presentation/ExecutorDispatchingPresenterTest.kt @@ -21,8 +21,8 @@ import com.hadisatrio.libs.kotlin.foundation.concurrent.CurrentThreadExecutor import io.mockk.mockk import io.mockk.spyk import io.mockk.verify -import org.junit.Test import java.util.concurrent.Executor +import kotlin.test.Test class ExecutorDispatchingPresenterTest { From aeac9b9c2879f451c173803ece418113cf138635 Mon Sep 17 00:00:00 2001 From: Hadi Satrio Date: Thu, 16 Nov 2023 23:14:00 +0700 Subject: [PATCH 3/3] root: Clean 'java.*' from the common source sets Common source should not directly depend on 'java.*' classes. Though this is effectively a non-issue because we do have JVM as one of the targets, it's still an inappropriate thing to do. --- .../apps/android/journal3/RealJournal3Application.kt | 2 +- .../com/hadisatrio/apps/android/journal3/RootActivity.kt | 2 +- .../apps/android/journal3/geography/SelectAPlaceActivity.kt | 4 ++-- .../apps/android/journal3/moment/DeleteAMomentActivity.kt | 4 ++-- .../apps/android/journal3/moment/EditAMomentActivity.kt | 4 ++-- .../apps/android/journal3/story/DeleteAStoryActivity.kt | 4 ++-- .../apps/android/journal3/story/EditAStoryActivity.kt | 4 ++-- .../journal3/story/PositiveReflectionsWidgetProvider.kt | 2 +- .../android/journal3/story/ReflectionStoriesListFragment.kt | 2 +- .../apps/android/journal3/story/StoriesListFragment.kt | 2 +- .../apps/android/journal3/story/UserStoriesListFragment.kt | 2 +- .../apps/android/journal3/story/ViewStoryActivity.kt | 4 ++-- .../journal3/moment/filesystem/FilesystemMemorablePlaces.kt | 3 +-- .../libs/android}/foundation/ExecutorDispatchingUseCase.kt | 3 ++- .../foundation/presentation/ExecutorDispatchingPresenter.kt | 3 ++- .../android}/foundation/ExecutorDispatchingUseCaseTest.kt | 5 +++-- .../android}/foundation/concurrent/CurrentThreadExecutor.kt | 2 +- .../presentation/ExecutorDispatchingPresenterTest.kt | 5 +++-- .../libs/kotlin/foundation/event/ExceptionalEvent.kt | 2 -- .../com/hadisatrio/libs/kotlin/geography/NullIsland.kt | 4 ++-- .../libs/kotlin/geography/LiteralCoordinatesTest.kt | 1 - .../hadisatrio/libs/kotlin/geography/here/HerePlaceTest.kt | 4 ++-- .../com/hadisatrio/libs/kotlin/io/FileSystemSourcesTest.kt | 1 - 23 files changed, 34 insertions(+), 35 deletions(-) rename lib-kmm-foundation/src/{commonMain/kotlin/com/hadisatrio/libs/kotlin => androidMain/kotlin/com/hadisatrio/libs/android}/foundation/ExecutorDispatchingUseCase.kt (90%) rename lib-kmm-foundation/src/{commonMain/kotlin/com/hadisatrio/libs/kotlin => androidMain/kotlin/com/hadisatrio/libs/android}/foundation/presentation/ExecutorDispatchingPresenter.kt (88%) rename lib-kmm-foundation/src/{commonTest/kotlin/com/hadisatrio/libs/kotlin => androidUnitTest/kotlin/com/hadisatrio/libs/android}/foundation/ExecutorDispatchingUseCaseTest.kt (87%) rename lib-kmm-foundation/src/{commonTest/kotlin/com/hadisatrio/libs/kotlin => androidUnitTest/kotlin/com/hadisatrio/libs/android}/foundation/concurrent/CurrentThreadExecutor.kt (93%) rename lib-kmm-foundation/src/{commonTest/kotlin/com/hadisatrio/libs/kotlin => androidUnitTest/kotlin/com/hadisatrio/libs/android}/foundation/presentation/ExecutorDispatchingPresenterTest.kt (86%) diff --git a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/RealJournal3Application.kt b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/RealJournal3Application.kt index c336d7ae..8f266ef0 100644 --- a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/RealJournal3Application.kt +++ b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/RealJournal3Application.kt @@ -48,6 +48,7 @@ import com.hadisatrio.apps.kotlin.journal3.token.TokenableString import com.hadisatrio.libs.android.foundation.activity.CurrentActivity import com.hadisatrio.libs.android.foundation.modal.AlertDialogModalPresenter import com.hadisatrio.libs.android.foundation.os.SystemLog +import com.hadisatrio.libs.android.foundation.presentation.ExecutorDispatchingPresenter import com.hadisatrio.libs.android.geography.LocationManagerCoordinates import com.hadisatrio.libs.android.geography.PermissionAwareCoordinates import com.hadisatrio.libs.android.io.content.ContentResolverSources @@ -56,7 +57,6 @@ import com.hadisatrio.libs.kotlin.foundation.event.EventSink import com.hadisatrio.libs.kotlin.foundation.event.EventSinks import com.hadisatrio.libs.kotlin.foundation.event.EventSource import com.hadisatrio.libs.kotlin.foundation.modal.Modal -import com.hadisatrio.libs.kotlin.foundation.presentation.ExecutorDispatchingPresenter import com.hadisatrio.libs.kotlin.foundation.presentation.Presenter import com.hadisatrio.libs.kotlin.geography.Places import com.hadisatrio.libs.kotlin.geography.here.HereNearbyPlaces diff --git a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/RootActivity.kt b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/RootActivity.kt index 32679deb..7679747d 100644 --- a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/RootActivity.kt +++ b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/RootActivity.kt @@ -27,12 +27,12 @@ import com.badoo.reaktive.scheduler.mainScheduler import com.google.android.material.navigation.NavigationBarView import com.hadisatrio.apps.android.journal3.story.ReflectionStoriesListFragment import com.hadisatrio.apps.android.journal3.story.UserStoriesListFragment +import com.hadisatrio.libs.android.foundation.ExecutorDispatchingUseCase import com.hadisatrio.libs.android.foundation.lifecycle.LifecycleTriggeredEventSource import com.hadisatrio.libs.android.foundation.material.NavigationBarSelectionEventSource import com.hadisatrio.libs.android.foundation.widget.ViewClickEventSource import com.hadisatrio.libs.android.viewpager2.SimpleFragmentPagerAdapter import com.hadisatrio.libs.android.viewpager2.SimpleFragmentPagerAdapter.FragmentFactory -import com.hadisatrio.libs.kotlin.foundation.ExecutorDispatchingUseCase import com.hadisatrio.libs.kotlin.foundation.UseCase import com.hadisatrio.libs.kotlin.foundation.event.CancellationEvent import com.hadisatrio.libs.kotlin.foundation.event.EventSource diff --git a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/geography/SelectAPlaceActivity.kt b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/geography/SelectAPlaceActivity.kt index fbf28f0f..71f8e4d8 100644 --- a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/geography/SelectAPlaceActivity.kt +++ b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/geography/SelectAPlaceActivity.kt @@ -32,15 +32,16 @@ import com.hadisatrio.apps.android.journal3.R import com.hadisatrio.apps.android.journal3.journal3Application import com.hadisatrio.apps.kotlin.journal3.geography.SelectAPlaceUseCase import com.hadisatrio.libs.android.dimensions.dp +import com.hadisatrio.libs.android.foundation.ExecutorDispatchingUseCase import com.hadisatrio.libs.android.foundation.activity.ActivityCompletionEventSink import com.hadisatrio.libs.android.foundation.activity.ActivityResultSettingEventSink import com.hadisatrio.libs.android.foundation.lifecycle.LifecycleTriggeredEventSource +import com.hadisatrio.libs.android.foundation.presentation.ExecutorDispatchingPresenter import com.hadisatrio.libs.android.foundation.widget.BackButtonCancellationEventSource import com.hadisatrio.libs.android.foundation.widget.EditTextInputEventSource import com.hadisatrio.libs.android.foundation.widget.RecyclerViewItemSelectionEventSource import com.hadisatrio.libs.android.foundation.widget.RecyclerViewPresenter import com.hadisatrio.libs.android.foundation.widget.ViewClickEventSource -import com.hadisatrio.libs.kotlin.foundation.ExecutorDispatchingUseCase import com.hadisatrio.libs.kotlin.foundation.UseCase import com.hadisatrio.libs.kotlin.foundation.event.CancellationEvent import com.hadisatrio.libs.kotlin.foundation.event.DebouncingEventSource @@ -51,7 +52,6 @@ import com.hadisatrio.libs.kotlin.foundation.event.EventSources import com.hadisatrio.libs.kotlin.foundation.event.SchedulingEventSource import com.hadisatrio.libs.kotlin.foundation.event.SelectionEvent import com.hadisatrio.libs.kotlin.foundation.presentation.AdaptingPresenter -import com.hadisatrio.libs.kotlin.foundation.presentation.ExecutorDispatchingPresenter import com.hadisatrio.libs.kotlin.foundation.presentation.Presenter import com.hadisatrio.libs.kotlin.geography.Place diff --git a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/moment/DeleteAMomentActivity.kt b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/moment/DeleteAMomentActivity.kt index 9419771a..0950a976 100644 --- a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/moment/DeleteAMomentActivity.kt +++ b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/moment/DeleteAMomentActivity.kt @@ -22,11 +22,11 @@ import androidx.appcompat.app.AppCompatActivity import com.benasher44.uuid.uuidFrom import com.hadisatrio.apps.android.journal3.journal3Application import com.hadisatrio.apps.kotlin.journal3.moment.DeleteMomentUseCase +import com.hadisatrio.libs.android.foundation.ExecutorDispatchingUseCase import com.hadisatrio.libs.android.foundation.activity.ActivityCompletionEventSink -import com.hadisatrio.libs.kotlin.foundation.ExecutorDispatchingUseCase +import com.hadisatrio.libs.android.foundation.presentation.ExecutorDispatchingPresenter import com.hadisatrio.libs.kotlin.foundation.event.EventSinks import com.hadisatrio.libs.kotlin.foundation.event.EventSources -import com.hadisatrio.libs.kotlin.foundation.presentation.ExecutorDispatchingPresenter class DeleteAMomentActivity : AppCompatActivity() { diff --git a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/moment/EditAMomentActivity.kt b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/moment/EditAMomentActivity.kt index b2b740cd..a7305d39 100644 --- a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/moment/EditAMomentActivity.kt +++ b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/moment/EditAMomentActivity.kt @@ -39,10 +39,12 @@ import com.hadisatrio.apps.kotlin.journal3.moment.Moment import com.hadisatrio.apps.kotlin.journal3.moment.SentimentAnalyzingMoment import com.hadisatrio.apps.kotlin.journal3.moment.UpdateDeferringMoment import com.hadisatrio.apps.kotlin.journal3.story.EditableMomentInStory +import com.hadisatrio.libs.android.foundation.ExecutorDispatchingUseCase import com.hadisatrio.libs.android.foundation.activity.ActivityCompletionEventSink import com.hadisatrio.libs.android.foundation.lifecycle.LifecycleTriggeredEventSource import com.hadisatrio.libs.android.foundation.material.SliderFloatPresenter import com.hadisatrio.libs.android.foundation.material.SliderSelectionEventSource +import com.hadisatrio.libs.android.foundation.presentation.ExecutorDispatchingPresenter import com.hadisatrio.libs.android.foundation.widget.BackButtonCancellationEventSource import com.hadisatrio.libs.android.foundation.widget.EditTextInputEventSource import com.hadisatrio.libs.android.foundation.widget.PhotoCaptureEventSource @@ -52,7 +54,6 @@ import com.hadisatrio.libs.android.foundation.widget.SwitchSelectionEventSource import com.hadisatrio.libs.android.foundation.widget.TextViewStringPresenter import com.hadisatrio.libs.android.foundation.widget.ViewClickEventSource import com.hadisatrio.libs.android.io.uri.toAndroidUri -import com.hadisatrio.libs.kotlin.foundation.ExecutorDispatchingUseCase import com.hadisatrio.libs.kotlin.foundation.UseCase import com.hadisatrio.libs.kotlin.foundation.event.CancellationEvent import com.hadisatrio.libs.kotlin.foundation.event.EventSink @@ -62,7 +63,6 @@ import com.hadisatrio.libs.kotlin.foundation.event.EventSources import com.hadisatrio.libs.kotlin.foundation.event.SchedulingEventSource import com.hadisatrio.libs.kotlin.foundation.event.SelectionEvent import com.hadisatrio.libs.kotlin.foundation.presentation.AdaptingPresenter -import com.hadisatrio.libs.kotlin.foundation.presentation.ExecutorDispatchingPresenter import com.hadisatrio.libs.kotlin.foundation.presentation.Presenter import com.hadisatrio.libs.kotlin.foundation.presentation.Presenters diff --git a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/DeleteAStoryActivity.kt b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/DeleteAStoryActivity.kt index 03934d8c..2fbd666e 100644 --- a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/DeleteAStoryActivity.kt +++ b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/DeleteAStoryActivity.kt @@ -22,11 +22,11 @@ import androidx.appcompat.app.AppCompatActivity import com.benasher44.uuid.uuidFrom import com.hadisatrio.apps.android.journal3.journal3Application import com.hadisatrio.apps.kotlin.journal3.story.DeleteStoryUseCase +import com.hadisatrio.libs.android.foundation.ExecutorDispatchingUseCase import com.hadisatrio.libs.android.foundation.activity.ActivityCompletionEventSink -import com.hadisatrio.libs.kotlin.foundation.ExecutorDispatchingUseCase +import com.hadisatrio.libs.android.foundation.presentation.ExecutorDispatchingPresenter import com.hadisatrio.libs.kotlin.foundation.event.EventSinks import com.hadisatrio.libs.kotlin.foundation.event.EventSources -import com.hadisatrio.libs.kotlin.foundation.presentation.ExecutorDispatchingPresenter class DeleteAStoryActivity : AppCompatActivity() { diff --git a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/EditAStoryActivity.kt b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/EditAStoryActivity.kt index 95f97260..0c1816d4 100644 --- a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/EditAStoryActivity.kt +++ b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/EditAStoryActivity.kt @@ -30,13 +30,14 @@ import com.hadisatrio.apps.kotlin.journal3.story.EditAStoryUseCase import com.hadisatrio.apps.kotlin.journal3.story.EditableStoryInStories import com.hadisatrio.apps.kotlin.journal3.story.Story import com.hadisatrio.apps.kotlin.journal3.story.UpdateDeferringStory +import com.hadisatrio.libs.android.foundation.ExecutorDispatchingUseCase import com.hadisatrio.libs.android.foundation.activity.ActivityCompletionEventSink import com.hadisatrio.libs.android.foundation.lifecycle.LifecycleTriggeredEventSource +import com.hadisatrio.libs.android.foundation.presentation.ExecutorDispatchingPresenter import com.hadisatrio.libs.android.foundation.widget.BackButtonCancellationEventSource import com.hadisatrio.libs.android.foundation.widget.EditTextInputEventSource import com.hadisatrio.libs.android.foundation.widget.TextViewStringPresenter import com.hadisatrio.libs.android.foundation.widget.ViewClickEventSource -import com.hadisatrio.libs.kotlin.foundation.ExecutorDispatchingUseCase import com.hadisatrio.libs.kotlin.foundation.UseCase import com.hadisatrio.libs.kotlin.foundation.event.CancellationEvent import com.hadisatrio.libs.kotlin.foundation.event.EventSink @@ -46,7 +47,6 @@ import com.hadisatrio.libs.kotlin.foundation.event.EventSources import com.hadisatrio.libs.kotlin.foundation.event.SchedulingEventSource import com.hadisatrio.libs.kotlin.foundation.event.SelectionEvent import com.hadisatrio.libs.kotlin.foundation.presentation.AdaptingPresenter -import com.hadisatrio.libs.kotlin.foundation.presentation.ExecutorDispatchingPresenter import com.hadisatrio.libs.kotlin.foundation.presentation.Presenter import com.hadisatrio.libs.kotlin.foundation.presentation.Presenters diff --git a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/PositiveReflectionsWidgetProvider.kt b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/PositiveReflectionsWidgetProvider.kt index d7e0af19..88de29df 100644 --- a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/PositiveReflectionsWidgetProvider.kt +++ b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/PositiveReflectionsWidgetProvider.kt @@ -37,9 +37,9 @@ import com.hadisatrio.apps.kotlin.journal3.story.ShowStoriesUseCase import com.hadisatrio.apps.kotlin.journal3.story.Stories import com.hadisatrio.apps.kotlin.journal3.story.fake.FakeStories import com.hadisatrio.apps.kotlin.journal3.token.TokenableString +import com.hadisatrio.libs.android.foundation.ExecutorDispatchingUseCase import com.hadisatrio.libs.android.foundation.widget.RemoteTextViewStringPresenter import com.hadisatrio.libs.android.foundation.widget.RemoteViewsUpdatingPresenter -import com.hadisatrio.libs.kotlin.foundation.ExecutorDispatchingUseCase import com.hadisatrio.libs.kotlin.foundation.event.NoOpEventSource import com.hadisatrio.libs.kotlin.foundation.presentation.AdaptingPresenter import com.hadisatrio.libs.kotlin.foundation.presentation.Presenters diff --git a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/ReflectionStoriesListFragment.kt b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/ReflectionStoriesListFragment.kt index 90b5e6df..d7f9de82 100644 --- a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/ReflectionStoriesListFragment.kt +++ b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/ReflectionStoriesListFragment.kt @@ -40,13 +40,13 @@ import com.hadisatrio.apps.kotlin.journal3.story.cache.CachingStoriesPresenter import com.hadisatrio.libs.android.dimensions.GOLDEN_RATIO import com.hadisatrio.libs.android.dimensions.dp import com.hadisatrio.libs.android.foundation.lifecycle.LifecycleTriggeredEventSource +import com.hadisatrio.libs.android.foundation.presentation.ExecutorDispatchingPresenter import com.hadisatrio.libs.android.foundation.widget.RecyclerViewPresenter import com.hadisatrio.libs.kotlin.foundation.event.CancellationEvent import com.hadisatrio.libs.kotlin.foundation.event.EventSource import com.hadisatrio.libs.kotlin.foundation.event.EventSources import com.hadisatrio.libs.kotlin.foundation.event.SchedulingEventSource import com.hadisatrio.libs.kotlin.foundation.presentation.AdaptingPresenter -import com.hadisatrio.libs.kotlin.foundation.presentation.ExecutorDispatchingPresenter import com.hadisatrio.libs.kotlin.foundation.presentation.Presenter import kotlin.math.roundToInt diff --git a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/StoriesListFragment.kt b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/StoriesListFragment.kt index 9dc56149..83b63528 100644 --- a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/StoriesListFragment.kt +++ b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/StoriesListFragment.kt @@ -31,8 +31,8 @@ import com.hadisatrio.apps.android.journal3.journal3Application import com.hadisatrio.apps.kotlin.journal3.story.ShowStoriesUseCase import com.hadisatrio.apps.kotlin.journal3.story.Stories import com.hadisatrio.libs.android.dimensions.dp +import com.hadisatrio.libs.android.foundation.ExecutorDispatchingUseCase import com.hadisatrio.libs.android.foundation.activity.ActivityCompletionEventSink -import com.hadisatrio.libs.kotlin.foundation.ExecutorDispatchingUseCase import com.hadisatrio.libs.kotlin.foundation.UseCase import com.hadisatrio.libs.kotlin.foundation.event.EventSink import com.hadisatrio.libs.kotlin.foundation.event.EventSinks diff --git a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/UserStoriesListFragment.kt b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/UserStoriesListFragment.kt index a7906dcc..93714144 100644 --- a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/UserStoriesListFragment.kt +++ b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/UserStoriesListFragment.kt @@ -28,6 +28,7 @@ import com.hadisatrio.apps.kotlin.journal3.event.RefreshRequestEvent import com.hadisatrio.apps.kotlin.journal3.story.Stories import com.hadisatrio.apps.kotlin.journal3.story.cache.CachingStoriesPresenter import com.hadisatrio.libs.android.foundation.lifecycle.LifecycleTriggeredEventSource +import com.hadisatrio.libs.android.foundation.presentation.ExecutorDispatchingPresenter import com.hadisatrio.libs.android.foundation.widget.RecyclerViewItemSelectionEventSource import com.hadisatrio.libs.android.foundation.widget.RecyclerViewPresenter import com.hadisatrio.libs.kotlin.foundation.event.CancellationEvent @@ -35,7 +36,6 @@ import com.hadisatrio.libs.kotlin.foundation.event.EventSource import com.hadisatrio.libs.kotlin.foundation.event.EventSources import com.hadisatrio.libs.kotlin.foundation.event.SchedulingEventSource import com.hadisatrio.libs.kotlin.foundation.presentation.AdaptingPresenter -import com.hadisatrio.libs.kotlin.foundation.presentation.ExecutorDispatchingPresenter import com.hadisatrio.libs.kotlin.foundation.presentation.Presenter class UserStoriesListFragment : StoriesListFragment() { diff --git a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/ViewStoryActivity.kt b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/ViewStoryActivity.kt index 8882a43c..b157025d 100644 --- a/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/ViewStoryActivity.kt +++ b/app-android-journal3/src/main/kotlin/com/hadisatrio/apps/android/journal3/story/ViewStoryActivity.kt @@ -39,13 +39,14 @@ import com.hadisatrio.apps.kotlin.journal3.story.ShowStoryUseCase import com.hadisatrio.apps.kotlin.journal3.story.Story import com.hadisatrio.apps.kotlin.journal3.story.cache.CachingStoryPresenter import com.hadisatrio.libs.android.dimensions.dp +import com.hadisatrio.libs.android.foundation.ExecutorDispatchingUseCase import com.hadisatrio.libs.android.foundation.activity.ActivityCompletionEventSink import com.hadisatrio.libs.android.foundation.lifecycle.LifecycleTriggeredEventSource +import com.hadisatrio.libs.android.foundation.presentation.ExecutorDispatchingPresenter import com.hadisatrio.libs.android.foundation.widget.RecyclerViewItemSelectionEventSource import com.hadisatrio.libs.android.foundation.widget.RecyclerViewPresenter import com.hadisatrio.libs.android.foundation.widget.TextViewStringPresenter import com.hadisatrio.libs.android.foundation.widget.ViewClickEventSource -import com.hadisatrio.libs.kotlin.foundation.ExecutorDispatchingUseCase import com.hadisatrio.libs.kotlin.foundation.UseCase import com.hadisatrio.libs.kotlin.foundation.event.CancellationEvent import com.hadisatrio.libs.kotlin.foundation.event.EventSink @@ -55,7 +56,6 @@ import com.hadisatrio.libs.kotlin.foundation.event.EventSources import com.hadisatrio.libs.kotlin.foundation.event.SchedulingEventSource import com.hadisatrio.libs.kotlin.foundation.event.SelectionEvent import com.hadisatrio.libs.kotlin.foundation.presentation.AdaptingPresenter -import com.hadisatrio.libs.kotlin.foundation.presentation.ExecutorDispatchingPresenter import com.hadisatrio.libs.kotlin.foundation.presentation.Presenter import com.hadisatrio.libs.kotlin.foundation.presentation.Presenters diff --git a/app-kmm-journal3/src/commonMain/kotlin/com/hadisatrio/apps/kotlin/journal3/moment/filesystem/FilesystemMemorablePlaces.kt b/app-kmm-journal3/src/commonMain/kotlin/com/hadisatrio/apps/kotlin/journal3/moment/filesystem/FilesystemMemorablePlaces.kt index 04d096e4..29f0af4a 100644 --- a/app-kmm-journal3/src/commonMain/kotlin/com/hadisatrio/apps/kotlin/journal3/moment/filesystem/FilesystemMemorablePlaces.kt +++ b/app-kmm-journal3/src/commonMain/kotlin/com/hadisatrio/apps/kotlin/journal3/moment/filesystem/FilesystemMemorablePlaces.kt @@ -25,7 +25,6 @@ import com.hadisatrio.libs.kotlin.geography.NullIsland import com.hadisatrio.libs.kotlin.geography.Place import okio.FileSystem import okio.Path -import java.util.UUID class FilesystemMemorablePlaces( private val fileSystem: FileSystem, @@ -53,7 +52,7 @@ class FilesystemMemorablePlaces( } } - override fun relevantTo(momentId: UUID): Iterable { + override fun relevantTo(momentId: Uuid): Iterable { return filter { it.relevantTo(momentId) } } diff --git a/lib-kmm-foundation/src/commonMain/kotlin/com/hadisatrio/libs/kotlin/foundation/ExecutorDispatchingUseCase.kt b/lib-kmm-foundation/src/androidMain/kotlin/com/hadisatrio/libs/android/foundation/ExecutorDispatchingUseCase.kt similarity index 90% rename from lib-kmm-foundation/src/commonMain/kotlin/com/hadisatrio/libs/kotlin/foundation/ExecutorDispatchingUseCase.kt rename to lib-kmm-foundation/src/androidMain/kotlin/com/hadisatrio/libs/android/foundation/ExecutorDispatchingUseCase.kt index f0812839..f73bfa35 100644 --- a/lib-kmm-foundation/src/commonMain/kotlin/com/hadisatrio/libs/kotlin/foundation/ExecutorDispatchingUseCase.kt +++ b/lib-kmm-foundation/src/androidMain/kotlin/com/hadisatrio/libs/android/foundation/ExecutorDispatchingUseCase.kt @@ -15,8 +15,9 @@ * along with this program. If not, see . */ -package com.hadisatrio.libs.kotlin.foundation +package com.hadisatrio.libs.android.foundation +import com.hadisatrio.libs.kotlin.foundation.UseCase import java.util.concurrent.Executor class ExecutorDispatchingUseCase( diff --git a/lib-kmm-foundation/src/commonMain/kotlin/com/hadisatrio/libs/kotlin/foundation/presentation/ExecutorDispatchingPresenter.kt b/lib-kmm-foundation/src/androidMain/kotlin/com/hadisatrio/libs/android/foundation/presentation/ExecutorDispatchingPresenter.kt similarity index 88% rename from lib-kmm-foundation/src/commonMain/kotlin/com/hadisatrio/libs/kotlin/foundation/presentation/ExecutorDispatchingPresenter.kt rename to lib-kmm-foundation/src/androidMain/kotlin/com/hadisatrio/libs/android/foundation/presentation/ExecutorDispatchingPresenter.kt index 4c367893..cc180bbb 100644 --- a/lib-kmm-foundation/src/commonMain/kotlin/com/hadisatrio/libs/kotlin/foundation/presentation/ExecutorDispatchingPresenter.kt +++ b/lib-kmm-foundation/src/androidMain/kotlin/com/hadisatrio/libs/android/foundation/presentation/ExecutorDispatchingPresenter.kt @@ -15,8 +15,9 @@ * along with this program. If not, see . */ -package com.hadisatrio.libs.kotlin.foundation.presentation +package com.hadisatrio.libs.android.foundation.presentation +import com.hadisatrio.libs.kotlin.foundation.presentation.Presenter import java.util.concurrent.Executor class ExecutorDispatchingPresenter( diff --git a/lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/ExecutorDispatchingUseCaseTest.kt b/lib-kmm-foundation/src/androidUnitTest/kotlin/com/hadisatrio/libs/android/foundation/ExecutorDispatchingUseCaseTest.kt similarity index 87% rename from lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/ExecutorDispatchingUseCaseTest.kt rename to lib-kmm-foundation/src/androidUnitTest/kotlin/com/hadisatrio/libs/android/foundation/ExecutorDispatchingUseCaseTest.kt index 0b925efa..a1e5a6d1 100644 --- a/lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/ExecutorDispatchingUseCaseTest.kt +++ b/lib-kmm-foundation/src/androidUnitTest/kotlin/com/hadisatrio/libs/android/foundation/ExecutorDispatchingUseCaseTest.kt @@ -15,9 +15,10 @@ * along with this program. If not, see . */ -package com.hadisatrio.libs.kotlin.foundation +package com.hadisatrio.libs.android.foundation -import com.hadisatrio.libs.kotlin.foundation.concurrent.CurrentThreadExecutor +import com.hadisatrio.libs.android.foundation.concurrent.CurrentThreadExecutor +import com.hadisatrio.libs.kotlin.foundation.UseCase import io.mockk.mockk import io.mockk.spyk import io.mockk.verify diff --git a/lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/concurrent/CurrentThreadExecutor.kt b/lib-kmm-foundation/src/androidUnitTest/kotlin/com/hadisatrio/libs/android/foundation/concurrent/CurrentThreadExecutor.kt similarity index 93% rename from lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/concurrent/CurrentThreadExecutor.kt rename to lib-kmm-foundation/src/androidUnitTest/kotlin/com/hadisatrio/libs/android/foundation/concurrent/CurrentThreadExecutor.kt index beda9ab9..4df69eeb 100644 --- a/lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/concurrent/CurrentThreadExecutor.kt +++ b/lib-kmm-foundation/src/androidUnitTest/kotlin/com/hadisatrio/libs/android/foundation/concurrent/CurrentThreadExecutor.kt @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.hadisatrio.libs.kotlin.foundation.concurrent +package com.hadisatrio.libs.android.foundation.concurrent import java.util.concurrent.Executor diff --git a/lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/presentation/ExecutorDispatchingPresenterTest.kt b/lib-kmm-foundation/src/androidUnitTest/kotlin/com/hadisatrio/libs/android/foundation/presentation/ExecutorDispatchingPresenterTest.kt similarity index 86% rename from lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/presentation/ExecutorDispatchingPresenterTest.kt rename to lib-kmm-foundation/src/androidUnitTest/kotlin/com/hadisatrio/libs/android/foundation/presentation/ExecutorDispatchingPresenterTest.kt index 76cec02a..25abf7e4 100644 --- a/lib-kmm-foundation/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/foundation/presentation/ExecutorDispatchingPresenterTest.kt +++ b/lib-kmm-foundation/src/androidUnitTest/kotlin/com/hadisatrio/libs/android/foundation/presentation/ExecutorDispatchingPresenterTest.kt @@ -15,9 +15,10 @@ * along with this program. If not, see . */ -package com.hadisatrio.libs.kotlin.foundation.presentation +package com.hadisatrio.libs.android.foundation.presentation -import com.hadisatrio.libs.kotlin.foundation.concurrent.CurrentThreadExecutor +import com.hadisatrio.libs.android.foundation.concurrent.CurrentThreadExecutor +import com.hadisatrio.libs.kotlin.foundation.presentation.Presenter import io.mockk.mockk import io.mockk.spyk import io.mockk.verify diff --git a/lib-kmm-foundation/src/commonMain/kotlin/com/hadisatrio/libs/kotlin/foundation/event/ExceptionalEvent.kt b/lib-kmm-foundation/src/commonMain/kotlin/com/hadisatrio/libs/kotlin/foundation/event/ExceptionalEvent.kt index 5e842e11..e1bd825d 100644 --- a/lib-kmm-foundation/src/commonMain/kotlin/com/hadisatrio/libs/kotlin/foundation/event/ExceptionalEvent.kt +++ b/lib-kmm-foundation/src/commonMain/kotlin/com/hadisatrio/libs/kotlin/foundation/event/ExceptionalEvent.kt @@ -17,8 +17,6 @@ package com.hadisatrio.libs.kotlin.foundation.event -import java.lang.Exception - class ExceptionalEvent( val exception: Exception ) : Event() { diff --git a/lib-kmm-geography/src/commonMain/kotlin/com/hadisatrio/libs/kotlin/geography/NullIsland.kt b/lib-kmm-geography/src/commonMain/kotlin/com/hadisatrio/libs/kotlin/geography/NullIsland.kt index 11acc834..502d40bf 100644 --- a/lib-kmm-geography/src/commonMain/kotlin/com/hadisatrio/libs/kotlin/geography/NullIsland.kt +++ b/lib-kmm-geography/src/commonMain/kotlin/com/hadisatrio/libs/kotlin/geography/NullIsland.kt @@ -18,11 +18,11 @@ package com.hadisatrio.libs.kotlin.geography import com.benasher44.uuid.Uuid -import java.util.UUID +import com.benasher44.uuid.uuidFrom object NullIsland : Place { - override val id: Uuid = UUID.fromString("00000000-0000-0000-0000-000000000000") + override val id: Uuid = uuidFrom("00000000-0000-0000-0000-000000000000") override val name: String = "Null Island" diff --git a/lib-kmm-geography/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/geography/LiteralCoordinatesTest.kt b/lib-kmm-geography/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/geography/LiteralCoordinatesTest.kt index 190c8a7b..7c98ed8f 100644 --- a/lib-kmm-geography/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/geography/LiteralCoordinatesTest.kt +++ b/lib-kmm-geography/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/geography/LiteralCoordinatesTest.kt @@ -20,7 +20,6 @@ package com.hadisatrio.libs.kotlin.geography import io.kotest.assertions.throwables.shouldThrow import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNotBe -import java.lang.IllegalArgumentException import kotlin.test.Test class LiteralCoordinatesTest { diff --git a/lib-kmm-geography/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/geography/here/HerePlaceTest.kt b/lib-kmm-geography/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/geography/here/HerePlaceTest.kt index 355136b1..82516ba8 100644 --- a/lib-kmm-geography/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/geography/here/HerePlaceTest.kt +++ b/lib-kmm-geography/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/geography/here/HerePlaceTest.kt @@ -17,6 +17,7 @@ package com.hadisatrio.libs.kotlin.geography.here +import com.benasher44.uuid.Uuid import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNotBe import kotlinx.serialization.decodeFromString @@ -24,7 +25,6 @@ import kotlinx.serialization.json.Json import kotlinx.serialization.json.JsonObject import kotlinx.serialization.json.jsonObject import kotlinx.serialization.json.jsonPrimitive -import java.util.UUID import kotlin.test.Test class HerePlaceTest { @@ -60,7 +60,7 @@ class HerePlaceTest { @Test fun `Infers ID from the Here ID consistently`() { val lifemarkStreetJsonId = lifemarkStreetJson["id"]!!.jsonPrimitive.content - lifemarkStreet.id.shouldBe(UUID.nameUUIDFromBytes(lifemarkStreetJsonId.toByteArray())) + lifemarkStreet.id.shouldBe(Uuid.nameUUIDFromBytes(lifemarkStreetJsonId.toByteArray())) lifemarkStreet.id.shouldBe(lifemarkStreet.id) lifemarkStreet.id.shouldBe(otherLifemarkStreet.id) } diff --git a/lib-kmm-io/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/io/FileSystemSourcesTest.kt b/lib-kmm-io/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/io/FileSystemSourcesTest.kt index 2f634b15..6249a67b 100644 --- a/lib-kmm-io/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/io/FileSystemSourcesTest.kt +++ b/lib-kmm-io/src/commonTest/kotlin/com/hadisatrio/libs/kotlin/io/FileSystemSourcesTest.kt @@ -27,7 +27,6 @@ import okio.Path import okio.Path.Companion.toPath import okio.buffer import okio.fakefilesystem.FakeFileSystem -import java.lang.IllegalArgumentException import kotlin.test.AfterTest import kotlin.test.Test