diff options
author | Allan Wang <me@allanwang.ca> | 2019-06-13 22:53:35 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-06-13 22:53:35 -0700 |
commit | 05403e185adcd5ae9829027fb53a134dec6b7d97 (patch) | |
tree | 9503b7f36324dd6075ad8e4caf6a9cd02b6897dd | |
parent | 246ac8944f9c98eed921e8a120e852882a134021 (diff) | |
download | frost-05403e185adcd5ae9829027fb53a134dec6b7d97.tar.gz frost-05403e185adcd5ae9829027fb53a134dec6b7d97.tar.bz2 frost-05403e185adcd5ae9829027fb53a134dec6b7d97.zip |
Fix test code errors
3 files changed, 5 insertions, 6 deletions
diff --git a/app/src/androidTest/kotlin/com/pitchedapps/frost/db/DatabaseTest.kt b/app/src/androidTest/kotlin/com/pitchedapps/frost/db/DatabaseTest.kt index c79d212e..49d18b31 100644 --- a/app/src/androidTest/kotlin/com/pitchedapps/frost/db/DatabaseTest.kt +++ b/app/src/androidTest/kotlin/com/pitchedapps/frost/db/DatabaseTest.kt @@ -18,8 +18,7 @@ package com.pitchedapps.frost.db import androidx.test.ext.junit.runners.AndroidJUnit4 import org.junit.runner.RunWith -import org.koin.error.NoBeanDefFoundException -import org.koin.standalone.get +import org.koin.core.error.NoBeanDefFoundException import org.koin.test.KoinTest import kotlin.reflect.KClass import kotlin.reflect.full.functions @@ -33,7 +32,7 @@ class DatabaseTest : KoinTest { fun <T : Any> hasKoin(klazz: KClass<T>): Boolean = try { - get<T>(clazz = klazz) + getKoin().get<T>(klazz, qualifier = null, parameters = null) true } catch (e: NoBeanDefFoundException) { false @@ -48,7 +47,7 @@ class DatabaseTest : KoinTest { val members = FrostDatabase::class.java.kotlin.functions.filter { it.name.endsWith("Dao") } .mapNotNull { it.returnType.classifier as? KClass<*> } assertTrue(members.isNotEmpty(), "Failed to find dao interfaces") - val missingKoins = (members + FrostDatabase::class).filter { !hasKoin(it) } + val missingKoins = members.filter { !hasKoin(it) } assertTrue(missingKoins.isEmpty(), "Missing koins: $missingKoins") } } diff --git a/app/src/androidTest/kotlin/com/pitchedapps/frost/db/GenericDbTest.kt b/app/src/androidTest/kotlin/com/pitchedapps/frost/db/GenericDbTest.kt index add9f509..18415e33 100644 --- a/app/src/androidTest/kotlin/com/pitchedapps/frost/db/GenericDbTest.kt +++ b/app/src/androidTest/kotlin/com/pitchedapps/frost/db/GenericDbTest.kt @@ -51,7 +51,7 @@ class GenericDbTest : BaseDbTest() { @Test fun ignoreErrors() { runBlocking { - dao.save(GenericEntity(GenericDao.TYPE_TABS, "${FbItem.ACTIVITY_LOG.name},unknown,${FbItem.EVENTS.name}")) + dao._save(GenericEntity(GenericDao.TYPE_TABS, "${FbItem.ACTIVITY_LOG.name},unknown,${FbItem.EVENTS.name}")) assertEquals( listOf(FbItem.ACTIVITY_LOG, FbItem.EVENTS), dao.getTabs(), diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 40b565b5..7eaa9a4a 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -10,7 +10,7 @@ object Versions { // https://github.com/brianwernick/ExoMedia/releases const val exoMedia = "4.3.0" // https://github.com/InsertKoinIO/koin/blob/master/CHANGELOG.md - const val koin = "2.0.0-rc-2" + const val koin = "2.0.1" // https://github.com/mockk/mockk/releases const val mockk = "1.9.3" // https://mvnrepository.com/artifact/androidx.core/core-ktx?repo=google |