diff --git a/examples/android-coffee-maker/src/test/java/AndroidModuleTest.kt b/examples/android-coffee-maker/src/test/java/AndroidModuleTest.kt index 37b08e0..4ffa8a8 100644 --- a/examples/android-coffee-maker/src/test/java/AndroidModuleTest.kt +++ b/examples/android-coffee-maker/src/test/java/AndroidModuleTest.kt @@ -1,5 +1,6 @@ package org.koin.sample.androidx +import it.example.component.ExampleSingleton import org.junit.Test import org.koin.core.context.startKoin import org.koin.core.context.stopKoin @@ -38,6 +39,9 @@ class AndroidModuleTest { assert(koin.getOrNull() != null) assert(koin.getOrNull() != null) + assert(koin.getOrNull() != null) + + stopKoin() } } \ No newline at end of file diff --git a/examples/android-library/src/main/java/it/example/component/Example.kt b/examples/android-library/src/main/java/it/example/component/Example.kt new file mode 100644 index 0000000..61c6070 --- /dev/null +++ b/examples/android-library/src/main/java/it/example/component/Example.kt @@ -0,0 +1,12 @@ +package it.example.component + +import org.koin.core.annotation.ComponentScan +import org.koin.core.annotation.Module +import org.koin.core.annotation.Single + +@Module +@ComponentScan +class ExampleModule + +@Single +class ExampleSingleton \ No newline at end of file diff --git a/examples/android-library/src/main/java/org/koin/sample/android/library/CommonModule.kt b/examples/android-library/src/main/java/org/koin/sample/android/library/CommonModule.kt index dd4884d..87cc1a8 100644 --- a/examples/android-library/src/main/java/org/koin/sample/android/library/CommonModule.kt +++ b/examples/android-library/src/main/java/org/koin/sample/android/library/CommonModule.kt @@ -1,8 +1,9 @@ package org.koin.sample.android.library +import it.example.component.ExampleModule import org.koin.core.annotation.ComponentScan import org.koin.core.annotation.Module -@Module +@Module(includes = [ExampleModule::class]) @ComponentScan class CommonModule \ No newline at end of file