diff --git a/projects/android/koin-android-test/src/main/java/org/koin/android/test/verify/AndroidVerify.kt b/projects/android/koin-android-test/src/main/java/org/koin/android/test/verify/AndroidVerify.kt index 244efb475..93658605a 100644 --- a/projects/android/koin-android-test/src/main/java/org/koin/android/test/verify/AndroidVerify.kt +++ b/projects/android/koin-android-test/src/main/java/org/koin/android/test/verify/AndroidVerify.kt @@ -21,8 +21,8 @@ import kotlin.reflect.KClass * @param extraTypes - allow to declare extra type, to be bound above the existing definitions * @throws MissingKoinDefinitionException */ -fun Module.verify(extraTypes: List> = listOf(), injections: List? = null) { - org.koin.test.verify.Verify.verify(this,extraTypes + androidTypes, injections) +fun Module.verify(extraTypes: List> = emptyList(), injections: List? = null) { + org.koin.test.verify.Verify.verify(this, extraTypes + androidTypes, injections) } /** @@ -36,8 +36,8 @@ fun Module.verify(extraTypes: List> = listOf(), injections: List> = listOf(), injections: List? = null) { - org.koin.test.verify.Verify.verify(this,extraTypes + androidTypes, injections) +fun Module.androidVerify(extraTypes: List> = emptyList(), injections: List? = null) { + org.koin.test.verify.Verify.verify(this, extraTypes + androidTypes, injections) } object AndroidVerify { @@ -49,4 +49,4 @@ object AndroidVerify { SavedStateHandle::class, WorkerParameters::class ) -} \ No newline at end of file +} diff --git a/projects/core/koin-core/src/commonMain/kotlin/org/koin/core/definition/BeanDefinition.kt b/projects/core/koin-core/src/commonMain/kotlin/org/koin/core/definition/BeanDefinition.kt index 44c3be34e..4e83412bd 100644 --- a/projects/core/koin-core/src/commonMain/kotlin/org/koin/core/definition/BeanDefinition.kt +++ b/projects/core/koin-core/src/commonMain/kotlin/org/koin/core/definition/BeanDefinition.kt @@ -36,7 +36,7 @@ class BeanDefinition( var qualifier: Qualifier? = null, val definition: Definition, val kind: Kind, - var secondaryTypes: List> = listOf(), + var secondaryTypes: List> = emptyList(), ) { var callbacks: Callbacks = Callbacks() diff --git a/projects/core/koin-test/src/jvmMain/kotlin/org/koin/test/verify/Verification.kt b/projects/core/koin-test/src/jvmMain/kotlin/org/koin/test/verify/Verification.kt index e14dd0ee9..fbe7311c5 100644 --- a/projects/core/koin-test/src/jvmMain/kotlin/org/koin/test/verify/Verification.kt +++ b/projects/core/koin-test/src/jvmMain/kotlin/org/koin/test/verify/Verification.kt @@ -90,7 +90,7 @@ class Verification(val module: Module, extraTypes: List>, injections: return verificationByStatus[VerificationStatus.OK]?.map { println("|- dependency '${it.name}' - ${it.type.qualifiedName} found!") it.type - } ?: emptyList() + }.orEmpty() } private fun generateFixDefinition(first: VerifiedParameter): String { @@ -172,4 +172,4 @@ data class VerifiedParameter(val name : String, val type : KClass<*>, val status enum class VerificationStatus { OK, MISSING, CIRCULAR -} \ No newline at end of file +} diff --git a/projects/core/koin-test/src/jvmMain/kotlin/org/koin/test/verify/VerifyModule.kt b/projects/core/koin-test/src/jvmMain/kotlin/org/koin/test/verify/VerifyModule.kt index 3c5bd4752..0474c0bed 100644 --- a/projects/core/koin-test/src/jvmMain/kotlin/org/koin/test/verify/VerifyModule.kt +++ b/projects/core/koin-test/src/jvmMain/kotlin/org/koin/test/verify/VerifyModule.kt @@ -27,15 +27,15 @@ import kotlin.time.measureTime * @param injections - Experimental - defines parameters injection types to allow (normally used in parametersOf) * @throws MissingKoinDefinitionException */ -fun Module.verify(extraTypes: List> = listOf(), injections: List? = emptyList()) = Verify.verify(this, extraTypes,injections) +fun Module.verify(extraTypes: List> = emptyList(), injections: List? = emptyList()) = Verify.verify(this, extraTypes, injections) /** * Verify a list of Modules * * @see Module.verify */ -fun List.verifyAll(extraTypes: List> = listOf(), injections: List? = emptyList()) { - forEach { module -> module.verify(extraTypes,injections) } +fun List.verifyAll(extraTypes: List> = emptyList(), injections: List? = emptyList()) { + forEach { module -> module.verify(extraTypes, injections) } } /** @@ -72,7 +72,7 @@ object Verify { * @param extraTypes allow to declare extra type, to be bound above the existing definitions * @throws MissingKoinDefinitionException */ - fun verify(module: Module, extraTypes: List> = listOf(), injections: List? = null) { + fun verify(module: Module, extraTypes: List> = emptyList(), injections: List? = null) { val verification = Verification(module, extraTypes, injections) println("Verifying module '$module' ...")