mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor(di): adopt @KoinApplication with startKoin<T>() compiler plugin API (#5152)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
0f900fe7d7
commit
8e5d99410c
5 changed files with 67 additions and 14 deletions
|
|
@ -25,6 +25,7 @@ import androidx.work.WorkerParameters
|
|||
import io.ktor.client.HttpClient
|
||||
import io.ktor.client.engine.HttpClientEngine
|
||||
import kotlinx.coroutines.CoroutineDispatcher
|
||||
import org.koin.plugin.module.dsl.koinApplication
|
||||
import org.koin.test.verify.definition
|
||||
import org.koin.test.verify.injectedParameters
|
||||
import org.koin.test.verify.verify
|
||||
|
|
@ -60,4 +61,19 @@ class KoinVerificationTest {
|
|||
),
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun verifyTypedBootstrapLoadsModuleGraph() {
|
||||
// koinApplication<T>() is a K2 compiler plugin stub. If the plugin fails to
|
||||
// transform it, the stub throws NotImplementedError at runtime. This test
|
||||
// validates that the production bootstrap path is correctly transformed by
|
||||
// successfully creating and closing the generated Koin application.
|
||||
val app = koinApplication<AndroidKoinApp>()
|
||||
try {
|
||||
// No-op: reaching this point proves the typed bootstrap path did not
|
||||
// throw and the generated application could be created.
|
||||
} finally {
|
||||
app.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue