ey guys, I’m trying to define a clean arch for tes...
# exposed
ey guys, I’m trying to define a clean arch for testing in my Ktor + Exposed + Hikari project. Do you know if there is any good approach for unit testing those methods that define a transaction?
Sounds like a similar stack to what we are using - what specific problem(s) are you facing? We use JUnit for unit tests and component tests (Guice for injection to configure test environments and Ktor's
) and cypress for e2e.
I also want to unit test the layer with the transaction
so finally I’ve managed by defining an interface for DbProvider and injecting with Koin the testing dbprovider so I dont need to use dbTransaction
I can still use dbQuery {} block in my controller layer
If anyone is interested I can explain my solution
sounds like you have found a strategy that works for your architecture 🙂
it is a bit messy with all the function extensions in Ktor structure 😄