https://kotlinlang.org logo
#ktor
Title
# ktor
l

landon burch

04/23/2021, 5:00 PM
I am trying to mock a database within my unit test. This doesn't work currently because in my test I am using the
Copy code
withTestApplication({ module() })
inside the module it setup database with url does doesn't point anywhere.. I wanted to know if anyone had experience with this. I am hoping to keep this a mock and not an in memory database..
f

Fi5t

04/23/2021, 6:13 PM
l

landon burch

04/23/2021, 6:19 PM
@Fi5t thanks.. someone suggested that before.. I was trying to keep things with mocks and not throwaway containers for my unit test.. so what I have done in the mean time is just used a secondary testModule() which doesn't include connection.. that works but seems like I should be doing something more impressive than that. But I will look into this for integration thanks once again for the suggestion.
5 Views