How to test repository by mocking data source using mockk #1200
Unanswered
vishwas-trivedi
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello Community!
I am very new to using mockk framework and would like some in-sight into how I could mock data-source and write tests for repository layer in my application.
I saw a couple of articles and repositories and everyone uses H2DB when writing mock tests, which is a bit different as I don't want to maintain in-memory DB.
I want to use mock data instead of using in-memory or any other form of DB for testing in order to write tests without any dependency.
Here is the sample repository that I am creating for PoC, I am trying to write unit tests for
BookRepository
class in my sample.Any response or guidance is much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions