or calls to another function receiving the dependencies (in your case the kodein instance), and then call that method in the tests
d
dave08
09/16/2018, 8:19 PM
It might be nice to add that to the testing docs... it took a while till I found the sample. I think using DIs is a common pattern, and knowing how to apply them in Ktor would be nice. Also, I prefer injecting only the necessary things into the particular route functions (which I called controllers) and not pass Kodein around everywhere... I feel it helps alot in decoupling which might also be nice to integrate into the Kodein sample... but in the end that sample saved me thanks 🙂
👌 1
b
bdawg.io
09/16/2018, 10:17 PM
Ktor doesn't prevent you from doing regular OOP
d
dave08
09/17/2018, 11:15 AM
Right, but it complicates things a bit, I started with Controllers that were classes, but found myself writing a whole layer to duplicate existing functionality... that's why Ktor isn't Spring, it's a DSL based framework @bdawg.io 😉
b
bdawg.io
09/17/2018, 2:33 PM
I'll grab a gist of what I really meant by my comment when I get to work haha