StefMa
07/29/2017, 11:53 AMkodein.instance<Manager>().getRandomWikiPage(language)
.
My kodein implementation lookes like that:
val kodein = Kodein {
bind<Manager>() with refSingleton(softReference) { Manager() }
}
Now I want to test my class and override the Manager
injection with a Mock.
For that I've created (in my test/
"package" obviously) the following "overriding code":
val testKodein = Kodein {
extend(kodein)
bind<Manager>(overrides = true) with refSingleton(softReference) { MockManager() }
}
Unfortunately my MockManager
isn't created. Instead it will call the real Manager
from the kodein
instance.
What do I wrong?
I found that https://stackoverflow.com/a/40022532 and thought that my code is correct...?!