{"action":"created","comment":{"url":"https://api.github.com/repos/tchap/gwi-challenge/pulls/comments/282471261","pull_request_review_id":235570272,"id":282471261,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI4MjQ3MTI2MQ==","diff_hunk":"@@ -0,0 +1,96 @@\n+package api_test\n+\n+import (\n+\t\"encoding/json\"\n+\t\"net/http\"\n+\t\"net/http/httptest\"\n+\t\"testing\"\n+\n+\t\"github.com/tchap/gwi-challenge/cmd/gwi-api/api\"\n+\t\"github.com/tchap/gwi-challenge/cmd/gwi-api/api/stores/mockstore\"\n+\n+\t\"github.com/labstack/echo\"\n+\t\"github.com/stretchr/testify/assert\"\n+\t\"github.com/stretchr/testify/mock\"\n+\t\"go.uber.org/zap\"\n+)\n+\n+// ----------------------------------------------------------------------------\n+// NOTE: Testing a single enpoint for time purposes only.\n+// ----------------------------------------------------------------------------\n+\n+func TestAPI_GetTeamByID(t *testing.T) {\n+\tassert := assert.New(t)\n+\n+\t// Testing endpoints returning *echo.HTTPError is kinda weird.\n+\t// You cannot check the response object, you have to check the error object being returned.\n+\t// So in case ExpectedResponseError is set, we do not check ExpectedResponseStatusCode at all.\n+\ttestCases := []struct {\n+\t\tRequestedTeamID            string\n+\t\tStoredTeam                 *api.Team\n+\t\tExpectedResponseError      error\n+\t\tExpectedResponseStatusCode int\n+\t\tExpectedResponseBody       echo.Map\n+\t}{\n+\t\t// Team found\n+\t\t{\n+\t\t\tRequestedTeamID: \"gladiators\",\n+\t\t\tStoredTeam: &api.Team{\n+\t\t\t\tID:   \"gladiators\",\n+\t\t\t\tName: \"The Gladiators\",\n+\t\t\t},\n+\t\t\tExpectedResponseStatusCode: http.StatusOK,\n+\t\t\tExpectedResponseBody: echo.Map{\n+\t\t\t\t\"id\":   \"gladiators\",\n+\t\t\t\t\"name\": \"The Gladiators\",\n+\t\t\t},\n+\t\t},\n+\t\t// Team not found\n+\t\t{\n+\t\t\tRequestedTeamID:       \"gladiators\",\n+\t\t\tExpectedResponseError: echo.ErrNotFound,\n+\t\t},\n+\t}\n+\n+\tfor _, tc := range testCases {","path":"cmd/gwi-api/api/api_test.go","position":55,"original_position":55,"commit_id":"4de47ae623343cf0d9f6ff96802065aaca782c76","original_commit_id":"4de47ae623343cf0d9f6ff96802065aaca782c76","user":{"login":"tchap","id":697127,"node_id":"MDQ6VXNlcjY5NzEyNw==","avatar_url":"https://avatars1.githubusercontent.com/u/697127?v=4","gravatar_id":"","url":"https://api.github.com/users/tchap","html_url":"https://github.com/tchap","followers_url":"https://api.github.com/users/tchap/followers","following_url":"https://api.github.com/users/tchap/following{/other_user}","gists_url":"https://api.github.com/users/tchap/gists{/gist_id}","starred_url":"https://api.github.com/users/tchap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchap/subscriptions","organizations_url":"https://api.github.com/users/tchap/orgs","repos_url":"https://api.github.com/users/tchap/repos","events_url":"https://api.github.com/users/tchap/events{/privacy}","received_events_url":"https://api.github.com/users/tchap/received_events","type":"User","site_admin":false},"body":"If you mean organizing tests, you can use suites and you probably mean https://godoc.org/github.com/stretchr/testify/suite . I remember using https://onsi.github.io/ginkgo/ on a project, not sure which one...","created_at":"2019-05-09T12:54:14Z","updated_at":"2019-05-09T12:54:14Z","html_url":"https://github.com/tchap/gwi-challenge/pull/1#discussion_r282471261","pull_request_url":"https://api.github.com/repos/tchap/gwi-challenge/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/tchap/gwi-challenge/pulls/comments/282471261"},"html":{"href":"https://github.com/tchap/gwi-challenge/pull/1#discussion_r282471261"},"pull_request":{"href":"https://api.github.com/repos/tchap/gwi-challenge/pulls/1"}},"in_reply_to_id":282466892},"pull_request":{"url":"https://api.github.com/repos/tchap/gwi-challenge/pulls/1","id":275306599,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjc1MzA2NTk5","html_url":"https://github.com/tchap/gwi-challenge/pull/1","diff_url":"https://github.com/tchap/gwi-challenge/pull/1.diff","patch_url":"https://github.com/tchap/gwi-challenge/pull/1.patch","issue_url":"https://api.github.com/repos/tchap/gwi-challenge/issues/1","number":1,"state":"open","locked":false,"title":"Add initial commands implementation","user":{"login":"tchap","id":697127,"node_id":"MDQ6VXNlcjY5NzEyNw==","avatar_url":"https://avatars1.githubusercontent.com/u/697127?v=4","gravatar_id":"","url":"https://api.github.com/users/tchap","html_url":"https://github.com/tchap","followers_url":"https://api.github.com/users/tchap/followers","following_url":"https://api.github.com/users/tchap/following{/other_user}","gists_url":"https://api.github.com/users/tchap/gists{/gist_id}","starred_url":"https://api.github.com/users/tchap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchap/subscriptions","organizations_url":"https://api.github.com/users/tchap/orgs","repos_url":"https://api.github.com/users/tchap/repos","events_url":"https://api.github.com/users/tchap/events{/privacy}","received_events_url":"https://api.github.com/users/tchap/received_events","type":"User","site_admin":false},"body":"This pull request contains the complete GWI challenge sources.\r\n\r\nThere are two subcommands present:\r\n\r\n* `cmd/gwi-api` - The API service.\r\n* `cmd/gwi-api-stats` - A tool for querying the service for data within the cron job.\r\n\r\nMore is described in README in each subdirectory.","created_at":"2019-05-02T10:22:09Z","updated_at":"2019-05-09T12:54:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0012d2bf6dabb0c26edd2285b7a1da536f8b5211","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/tchap/gwi-challenge/pulls/1/commits","review_comments_url":"https://api.github.com/repos/tchap/gwi-challenge/pulls/1/comments","review_comment_url":"https://api.github.com/repos/tchap/gwi-challenge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tchap/gwi-challenge/issues/1/comments","statuses_url":"https://api.github.com/repos/tchap/gwi-challenge/statuses/4de47ae623343cf0d9f6ff96802065aaca782c76","head":{"label":"tchap:mvp","ref":"mvp","sha":"4de47ae623343cf0d9f6ff96802065aaca782c76","user":{"login":"tchap","id":697127,"node_id":"MDQ6VXNlcjY5NzEyNw==","avatar_url":"https://avatars1.githubusercontent.com/u/697127?v=4","gravatar_id":"","url":"https://api.github.com/users/tchap","html_url":"https://github.com/tchap","followers_url":"https://api.github.com/users/tchap/followers","following_url":"https://api.github.com/users/tchap/following{/other_user}","gists_url":"https://api.github.com/users/tchap/gists{/gist_id}","starred_url":"https://api.github.com/users/tchap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchap/subscriptions","organizations_url":"https://api.github.com/users/tchap/orgs","repos_url":"https://api.github.com/users/tchap/repos","events_url":"https://api.github.com/users/tchap/events{/privacy}","received_events_url":"https://api.github.com/users/tchap/received_events","type":"User","site_admin":false},"repo":{"id":182759977,"node_id":"MDEwOlJlcG9zaXRvcnkxODI3NTk5Nzc=","name":"gwi-challenge","full_name":"tchap/gwi-challenge","private":false,"owner":{"login":"tchap","id":697127,"node_id":"MDQ6VXNlcjY5NzEyNw==","avatar_url":"https://avatars1.githubusercontent.com/u/697127?v=4","gravatar_id":"","url":"https://api.github.com/users/tchap","html_url":"https://github.com/tchap","followers_url":"https://api.github.com/users/tchap/followers","following_url":"https://api.github.com/users/tchap/following{/other_user}","gists_url":"https://api.github.com/users/tchap/gists{/gist_id}","starred_url":"https://api.github.com/users/tchap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchap/subscriptions","organizations_url":"https://api.github.com/users/tchap/orgs","repos_url":"https://api.github.com/users/tchap/repos","events_url":"https://api.github.com/users/tchap/events{/privacy}","received_events_url":"https://api.github.com/users/tchap/received_events","type":"User","site_admin":false},"html_url":"https://github.com/tchap/gwi-challenge","description":"An exercise to implement a simple HTTP API","fork":false,"url":"https://api.github.com/repos/tchap/gwi-challenge","forks_url":"https://api.github.com/repos/tchap/gwi-challenge/forks","keys_url":"https://api.github.com/repos/tchap/gwi-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tchap/gwi-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tchap/gwi-challenge/teams","hooks_url":"https://api.github.com/repos/tchap/gwi-challenge/hooks","issue_events_url":"https://api.github.com/repos/tchap/gwi-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/tchap/gwi-challenge/events","assignees_url":"https://api.github.com/repos/tchap/gwi-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/tchap/gwi-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/tchap/gwi-challenge/tags","blobs_url":"https://api.github.com/repos/tchap/gwi-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tchap/gwi-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tchap/gwi-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/tchap/gwi-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tchap/gwi-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/tchap/gwi-challenge/languages","stargazers_url":"https://api.github.com/repos/tchap/gwi-challenge/stargazers","contributors_url":"https://api.github.com/repos/tchap/gwi-challenge/contributors","subscribers_url":"https://api.github.com/repos/tchap/gwi-challenge/subscribers","subscription_url":"https://api.github.com/repos/tchap/gwi-challenge/subscription","commits_url":"https://api.github.com/repos/tchap/gwi-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/tchap/gwi-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/tchap/gwi-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/tchap/gwi-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/tchap/gwi-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/tchap/gwi-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tchap/gwi-challenge/merges","archive_url":"https://api.github.com/repos/tchap/gwi-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tchap/gwi-challenge/downloads","issues_url":"https://api.github.com/repos/tchap/gwi-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/tchap/gwi-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/tchap/gwi-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/tchap/gwi-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tchap/gwi-challenge/labels{/name}","releases_url":"https://api.github.com/repos/tchap/gwi-challenge/releases{/id}","deployments_url":"https://api.github.com/repos/tchap/gwi-challenge/deployments","created_at":"2019-04-22T10:54:45Z","updated_at":"2019-05-02T10:23:01Z","pushed_at":"2019-05-08T10:35:55Z","git_url":"git://github.com/tchap/gwi-challenge.git","ssh_url":"git@github.com:tchap/gwi-challenge.git","clone_url":"https://github.com/tchap/gwi-challenge.git","svn_url":"https://github.com/tchap/gwi-challenge","homepage":null,"size":26,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"tchap:master","ref":"master","sha":"09aeb0e2c5d2cfe1388960100300f9d53eb9d244","user":{"login":"tchap","id":697127,"node_id":"MDQ6VXNlcjY5NzEyNw==","avatar_url":"https://avatars1.githubusercontent.com/u/697127?v=4","gravatar_id":"","url":"https://api.github.com/users/tchap","html_url":"https://github.com/tchap","followers_url":"https://api.github.com/users/tchap/followers","following_url":"https://api.github.com/users/tchap/following{/other_user}","gists_url":"https://api.github.com/users/tchap/gists{/gist_id}","starred_url":"https://api.github.com/users/tchap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchap/subscriptions","organizations_url":"https://api.github.com/users/tchap/orgs","repos_url":"https://api.github.com/users/tchap/repos","events_url":"https://api.github.com/users/tchap/events{/privacy}","received_events_url":"https://api.github.com/users/tchap/received_events","type":"User","site_admin":false},"repo":{"id":182759977,"node_id":"MDEwOlJlcG9zaXRvcnkxODI3NTk5Nzc=","name":"gwi-challenge","full_name":"tchap/gwi-challenge","private":false,"owner":{"login":"tchap","id":697127,"node_id":"MDQ6VXNlcjY5NzEyNw==","avatar_url":"https://avatars1.githubusercontent.com/u/697127?v=4","gravatar_id":"","url":"https://api.github.com/users/tchap","html_url":"https://github.com/tchap","followers_url":"https://api.github.com/users/tchap/followers","following_url":"https://api.github.com/users/tchap/following{/other_user}","gists_url":"https://api.github.com/users/tchap/gists{/gist_id}","starred_url":"https://api.github.com/users/tchap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchap/subscriptions","organizations_url":"https://api.github.com/users/tchap/orgs","repos_url":"https://api.github.com/users/tchap/repos","events_url":"https://api.github.com/users/tchap/events{/privacy}","received_events_url":"https://api.github.com/users/tchap/received_events","type":"User","site_admin":false},"html_url":"https://github.com/tchap/gwi-challenge","description":"An exercise to implement a simple HTTP API","fork":false,"url":"https://api.github.com/repos/tchap/gwi-challenge","forks_url":"https://api.github.com/repos/tchap/gwi-challenge/forks","keys_url":"https://api.github.com/repos/tchap/gwi-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tchap/gwi-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tchap/gwi-challenge/teams","hooks_url":"https://api.github.com/repos/tchap/gwi-challenge/hooks","issue_events_url":"https://api.github.com/repos/tchap/gwi-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/tchap/gwi-challenge/events","assignees_url":"https://api.github.com/repos/tchap/gwi-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/tchap/gwi-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/tchap/gwi-challenge/tags","blobs_url":"https://api.github.com/repos/tchap/gwi-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tchap/gwi-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tchap/gwi-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/tchap/gwi-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tchap/gwi-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/tchap/gwi-challenge/languages","stargazers_url":"https://api.github.com/repos/tchap/gwi-challenge/stargazers","contributors_url":"https://api.github.com/repos/tchap/gwi-challenge/contributors","subscribers_url":"https://api.github.com/repos/tchap/gwi-challenge/subscribers","subscription_url":"https://api.github.com/repos/tchap/gwi-challenge/subscription","commits_url":"https://api.github.com/repos/tchap/gwi-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/tchap/gwi-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/tchap/gwi-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/tchap/gwi-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/tchap/gwi-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/tchap/gwi-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tchap/gwi-challenge/merges","archive_url":"https://api.github.com/repos/tchap/gwi-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tchap/gwi-challenge/downloads","issues_url":"https://api.github.com/repos/tchap/gwi-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/tchap/gwi-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/tchap/gwi-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/tchap/gwi-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tchap/gwi-challenge/labels{/name}","releases_url":"https://api.github.com/repos/tchap/gwi-challenge/releases{/id}","deployments_url":"https://api.github.com/repos/tchap/gwi-challenge/deployments","created_at":"2019-04-22T10:54:45Z","updated_at":"2019-05-02T10:23:01Z","pushed_at":"2019-05-08T10:35:55Z","git_url":"git://github.com/tchap/gwi-challenge.git","ssh_url":"git@github.com:tchap/gwi-challenge.git","clone_url":"https://github.com/tchap/gwi-challenge.git","svn_url":"https://github.com/tchap/gwi-challenge","homepage":null,"size":26,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tchap/gwi-challenge/pulls/1"},"html":{"href":"https://github.com/tchap/gwi-challenge/pull/1"},"issue":{"href":"https://api.github.com/repos/tchap/gwi-challenge/issues/1"},"comments":{"href":"https://api.github.com/repos/tchap/gwi-challenge/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/tchap/gwi-challenge/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/tchap/gwi-challenge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tchap/gwi-challenge/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/tchap/gwi-challenge/statuses/4de47ae623343cf0d9f6ff96802065aaca782c76"}},"author_association":"OWNER"}}
{"actor":{"display_login":"tchap"}}