{"id":18953432,"url":"https://github.com/pthethanh/testing-mongodb-with-gomock","last_synced_at":"2025-09-26T16:14:22.369Z","repository":{"id":123098481,"uuid":"152031154","full_name":"pthethanh/testing-mongodb-with-gomock","owner":"pthethanh","description":"demonstrate mocking mongodb with gomock ","archived":false,"fork":false,"pushed_at":"2018-10-08T07:36:05.000Z","size":5,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-17T02:37:35.925Z","etag":null,"topics":["go","golang","mock","mongodb","testing"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pthethanh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-10-08T06:46:38.000Z","updated_at":"2024-05-17T16:47:25.000Z","dependencies_parsed_at":"2024-04-17T17:11:11.387Z","dependency_job_id":"ff11c963-cab9-44e1-bdc8-04d19eb7a786","html_url":"https://github.com/pthethanh/testing-mongodb-with-gomock","commit_stats":null,"previous_names":["pthethanh/testing-mongodb-with-gomock","golovers/testing-mongodb-with-gomock"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pthethanh/testing-mongodb-with-gomock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pthethanh%2Ftesting-mongodb-with-gomock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pthethanh%2Ftesting-mongodb-with-gomock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pthethanh%2Ftesting-mongodb-with-gomock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pthethanh%2Ftesting-mongodb-with-gomock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pthethanh","download_url":"https://codeload.github.com/pthethanh/testing-mongodb-with-gomock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pthethanh%2Ftesting-mongodb-with-gomock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277104899,"owners_count":25761659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-26T02:00:09.010Z","response_time":78,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","mock","mongodb","testing"],"created_at":"2024-11-08T13:38:30.355Z","updated_at":"2025-09-26T16:14:22.350Z","avatar_url":"https://github.com/pthethanh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# testing-mongodb-with-gomock\nThis is a demonstration of mocking MongoDB with [gomock](https://github.com/golang/mock).\n\n## Get the code and run the test :)\n\n**Get it:** `go get -u github.com/golovers/testing-mongodb-with-gomock`\n\n**Run it**: `go test -v pkg/users/*`\n**Result**:\n\n```\n=== RUN   TestMongoDB\n=== PAUSE TestMongoDB\n=== RUN   TestAddUser\n=== PAUSE TestAddUser\n=== RUN   TestGetUserEmptyResponse\n=== PAUSE TestGetUserEmptyResponse\n=== RUN   TestGetUserNonEmptyResponse\n=== PAUSE TestGetUserNonEmptyResponse\n=== CONT  TestMongoDB\n=== CONT  TestGetUserNonEmptyResponse\n=== CONT  TestGetUserEmptyResponse\n--- PASS: TestGetUserNonEmptyResponse (0.00s)\n--- PASS: TestMongoDB (0.00s)\n=== CONT  TestAddUser\n--- PASS: TestAddUser (0.00s)\n--- PASS: TestGetUserEmptyResponse (0.00s)\nPASS\nok      command-line-arguments  (cached)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpthethanh%2Ftesting-mongodb-with-gomock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpthethanh%2Ftesting-mongodb-with-gomock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpthethanh%2Ftesting-mongodb-with-gomock/lists"}