In this part of the Async API in Golang series, we'll implement the data access layer for the users model and go over how to integration test with our Postgres database. We're making use of the popular SQLx Go library.
Пікірлер: 6
@ranit-biswas27 күн бұрын
Great man. I don't have much knowledge about integration testing. But what I know that we don't do mocking and stubbing in integration test.. rather db interaction in real is happened during integration testing. Mocking and stubbing are done during unit testing. That's how I segregate b/w integration and unit testing. Please correct me if I'm wrong.
@thedevtool27 күн бұрын
@@ranit-biswas that’s correct. A unit test is not testing functionality of underlying dependencies. Rather, it will mock their behavior to ensure we’re using the dependencies correctly. However, people can get pedantic about what’s a unit versus integration test. You can just call it automated testing.
@samuelopeyemi83778 күн бұрын
Well done, chief! Why are you adding password-hashing logic in the store? All such logic should be moved to the service layer or handler so the store stays focused on database-related tasks.
@thedevtool8 күн бұрын
@@samuelopeyemi8377 yep that can totally be moved to the API handler layer if preferred.
@samuelopeyemi83778 күн бұрын
@@thedevtool Thank you for your work!
@thedevtool8 күн бұрын
@@samuelopeyemi8377 no problem thanks for watching!