diff options
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/androidTest/kotlin/com/pitchedapps/frost/db/DatabaseTest.kt | 7 | ||||
-rw-r--r-- | app/src/androidTest/kotlin/com/pitchedapps/frost/db/GenericDbTest.kt | 2 |
2 files changed, 4 insertions, 5 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(), |