Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Separate query-service functionality from http handler #1312
@@ Coverage Diff @@ ## master #1312 +/- ## ====================================== Coverage 100% 100% ====================================== Files 162 163 +1 Lines 7364 7374 +10 ====================================== + Hits 7364 7374 +10
A couple of things I came across as I'm fixing the test cases after refactoring.
... are going to change to -
And so we either need:
.. (if we don't go with implementing a mock for QueryService)
@yurishkuro could you please review?
On the first question, initTestServer is the one that creates and returns the mocks for storage. It should continue doing that. The tests are testing the handler endpoints, they don't care if internally the init function constructs QueryService. It seems like I'm missing something that's confusing you.
On the second question, you need to make the fields of the options struct public, since they are part of the public API of the package.
ideally, we should add tests, it's a simple one to test with mocks.