Update dependencies and make adjustments based on version migrations
This commit is contained in:
parent
4147ac7afd
commit
472b7591f5
27 changed files with 120 additions and 97 deletions
|
|
@ -83,20 +83,17 @@ afterEvaluate {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
implementation "androidx.core:core-ktx:$androidx_core_version"
|
||||
implementation "androidx.appcompat:appcompat:$androidx_appcompat_version"
|
||||
implementation "com.google.android.material:material:$androidx_material_version"
|
||||
implementation "androidx.constraintlayout:constraintlayout:$androidx_constraintlayout_version"
|
||||
implementation "androidx.lifecycle:lifecycle-livedata-core-ktx:$androidx_livedata_version"
|
||||
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$androidx_livedata_version"
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$androidx_livedata_version"
|
||||
implementation "androidx.swiperefreshlayout:swiperefreshlayout:$androidx_swiperefreshlayout_version"
|
||||
|
||||
// Koin
|
||||
implementation "org.koin:koin-androidx-scope:$koin_version"
|
||||
implementation "org.koin:koin-androidx-viewmodel:$koin_version"
|
||||
implementation "org.koin:koin-androidx-fragment:$koin_version"
|
||||
implementation "io.insert-koin:koin-android:$koin_version"
|
||||
|
||||
implementation "androidx.room:room-runtime:$androidx_room_version"
|
||||
kapt "androidx.room:room-compiler:$androidx_room_version"
|
||||
|
|
@ -113,7 +110,7 @@ dependencies {
|
|||
testImplementation "org.mockito.kotlin:mockito-kotlin:$testing_kotlin_mockito_version"
|
||||
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"
|
||||
testImplementation "com.jraska.livedata:testing-ktx:$testing_livedata_version"
|
||||
testImplementation "org.koin:koin-test:$koin_version"
|
||||
testImplementation "io.insert-koin:koin-test-junit5:$koin_version"
|
||||
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$testing_junit5_version"
|
||||
|
||||
// robolectric specific
|
||||
|
|
@ -130,7 +127,7 @@ dependencies {
|
|||
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:$testing_junit5_version"
|
||||
|
||||
androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"
|
||||
androidTestImplementation "org.koin:koin-test:$koin_version"
|
||||
androidTestImplementation "io.insert-koin:koin-test-junit4:$koin_version"
|
||||
androidTestImplementation "junit:junit:$testing_junit4_version"
|
||||
androidTestImplementation "androidx.test:core:$testing_androidx_code_version"
|
||||
androidTestImplementation "androidx.test:runner:$testing_androidx_code_version"
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ object AndroidTestServerTypeConfiguration : ServerTypeConfiguration, KoinTest {
|
|||
.build()
|
||||
loadKoinModules(
|
||||
module {
|
||||
single(qualifier = sessionless, override = true) { okHttpClientWithCertificate }
|
||||
single(qualifier = sessionless) { okHttpClientWithCertificate }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,16 @@
|
|||
package org.fnives.test.showcase.favourite
|
||||
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.flow.take
|
||||
import kotlinx.coroutines.flow.toList
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.test.TestCoroutineDispatcher
|
||||
import kotlinx.coroutines.test.TestCoroutineScope
|
||||
import kotlinx.coroutines.test.runBlockingTest
|
||||
import org.fnives.test.showcase.core.storage.content.FavouriteContentLocalStorage
|
||||
import org.fnives.test.showcase.model.content.ContentId
|
||||
import org.fnives.test.showcase.storage.database.DatabaseInitialization
|
||||
|
|
@ -20,6 +24,7 @@ import org.koin.test.KoinTest
|
|||
import org.koin.test.inject
|
||||
|
||||
@Suppress("TestFunctionName")
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
internal class FavouriteContentLocalStorageImplTest : KoinTest {
|
||||
|
||||
|
|
@ -39,12 +44,12 @@ internal class FavouriteContentLocalStorageImplTest : KoinTest {
|
|||
|
||||
@Test
|
||||
fun GIVEN_content_id_WHEN_added_to_Favourite_THEN_it_can_be_read_out() = runBlocking {
|
||||
val expected = listOf(ContentId("a"))
|
||||
val expected = listOf(ContentId("a"))
|
||||
|
||||
sut.markAsFavourite(ContentId("a"))
|
||||
val actual = sut.observeFavourites().first()
|
||||
sut.markAsFavourite(ContentId("a"))
|
||||
val actual = sut.observeFavourites().first()
|
||||
|
||||
Assert.assertEquals(expected, actual)
|
||||
Assert.assertEquals(expected, actual)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -63,6 +68,7 @@ internal class FavouriteContentLocalStorageImplTest : KoinTest {
|
|||
runBlocking<Unit> {
|
||||
val expected = listOf(listOf(), listOf(ContentId("a")))
|
||||
|
||||
val testDispatcher = TestCoroutineDispatcher()
|
||||
val actual = async(testDispatcher) {
|
||||
sut.observeFavourites().take(2).toList()
|
||||
}
|
||||
|
|
@ -79,6 +85,7 @@ internal class FavouriteContentLocalStorageImplTest : KoinTest {
|
|||
val expected = listOf(listOf(ContentId("a")), listOf())
|
||||
sut.markAsFavourite(ContentId("a"))
|
||||
|
||||
val testDispatcher = TestCoroutineDispatcher()
|
||||
val actual = async(testDispatcher) {
|
||||
sut.observeFavourites().take(2).toList()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,11 +4,13 @@ import org.fnives.test.showcase.core.login.LoginUseCase
|
|||
import org.fnives.test.showcase.testutils.InstantExecutorExtension
|
||||
import org.fnives.test.showcase.testutils.TestMainDispatcher
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
import org.junit.jupiter.api.Disabled
|
||||
import org.junit.jupiter.api.DisplayName
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.extension.ExtendWith
|
||||
import org.mockito.kotlin.mock
|
||||
|
||||
@Disabled("CodeKata")
|
||||
@ExtendWith(InstantExecutorExtension::class, TestMainDispatcher::class)
|
||||
class CodeKataAuthViewModel {
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import org.fnives.test.showcase.testutils.InstantExecutorExtension
|
|||
import org.fnives.test.showcase.testutils.TestMainDispatcher
|
||||
import org.fnives.test.showcase.ui.shared.Event
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
import org.junit.jupiter.api.Disabled
|
||||
import org.junit.jupiter.api.DisplayName
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.extension.ExtendWith
|
||||
|
|
@ -12,6 +13,7 @@ import org.mockito.kotlin.doReturn
|
|||
import org.mockito.kotlin.mock
|
||||
import org.mockito.kotlin.whenever
|
||||
|
||||
@Disabled("CodeKata")
|
||||
internal class CodeKataSplashViewModelTest {
|
||||
|
||||
@BeforeEach
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
sdk=28
|
||||
shadows=org.fnives.test.showcase.testutils.shadow.ShadowSnackbar
|
||||
instrumentedPackages=androidx.loader.content
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue