I have a method in which a local Service instance is provided by a static ServiceProvider which is injected by Koin
val apiService: MyService by inject { parametersOf(someStrings) }
How to mock this using the PowerMockito? The injection works with a ServiceProver class which looks something like this
object ServiceProvier {
fun getMyServiceInstacne(..,..,..): MySerivce {
....
..
return retrofit.create(MyService::class.java)
}
}
question from:https://stackoverflow.com/questions/65882185/mock-koin-injects-of-local-instance-within-method-using-powermock