{"action":"created","comment":{"url":"https://api.github.com/repos/ONSdigital/dp-api-tests/pulls/comments/148837115","pull_request_review_id":74142410,"id":148837115,"diff_hunk":"@@ -0,0 +1,108 @@\n+package importAPI\n+\n+import (\n+\t\"net/http\"\n+\t\"os\"\n+\t\"testing\"\n+\n+\t\"github.com/ONSdigital/dp-api-tests/testDataSetup/mongo\"\n+\t\"github.com/ONSdigital/go-ns/log\"\n+\t\"github.com/gavv/httpexpect\"\n+\t. \"github.com/smartystreets/goconvey/convey\"\n+\tmgo \"gopkg.in/mgo.v2\"\n+)\n+\n+// Update the state of the job. If this is set to submitted, this shall trigger the import process.\n+// 200 - The job is in a queue\n+func TestUpdateImportJobState(t *testing.T) {\n+\n+\tif err := mongo.Teardown(\"imports\", \"imports\", \"id\", jobID); err != nil {\n+\t\tif err != mgo.ErrNotFound {\n+\t\t\tlog.ErrorC(\"Was unable to run test\", err, nil)\n+\t\t\tos.Exit(1)\n+\t\t}\n+\t}\n+\n+\tif err := mongo.Setup(\"imports\", \"imports\", \"id\", jobID, validCreatedImportJobData); err != nil {\n+\t\tlog.ErrorC(\"Was unable to run test\", err, nil)\n+\t\tos.Exit(1)\n+\t}\n+\n+\timportAPI := httpexpect.New(t, cfg.ImportAPIURL)\n+\n+\t// This test fails.\n+\t// Bug raised in Trello.\n+\t// These tests needs to refine when authentication was handled in the code.\n+\tConvey(\"Update the state of the import job\", t, func() {\n+\n+\t\tConvey(\"When the user is authenticated\", func() {\n+\n+\t\t\timportAPI.PUT(\"/jobs/{id}\", jobID).WithHeader(internalToken, internalTokenID).\n+\t\t\t\tWithBytes([]byte(validPUTJobJSON)).Expect().Status(http.StatusOK)\n+","path":"httpexpect/importAPI/put_job_test.go","position":42,"original_position":42,"commit_id":"b5b658baa4a28f91a635fb548659bd730529cd61","original_commit_id":"b5b658baa4a28f91a635fb548659bd730529cd61","user":{"login":"nshumoogum","id":7114615,"avatar_url":"https://avatars0.githubusercontent.com/u/7114615?v=4","gravatar_id":"","url":"https://api.github.com/users/nshumoogum","html_url":"https://github.com/nshumoogum","followers_url":"https://api.github.com/users/nshumoogum/followers","following_url":"https://api.github.com/users/nshumoogum/following{/other_user}","gists_url":"https://api.github.com/users/nshumoogum/gists{/gist_id}","starred_url":"https://api.github.com/users/nshumoogum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nshumoogum/subscriptions","organizations_url":"https://api.github.com/users/nshumoogum/orgs","repos_url":"https://api.github.com/users/nshumoogum/repos","events_url":"https://api.github.com/users/nshumoogum/events{/privacy}","received_events_url":"https://api.github.com/users/nshumoogum/received_events","type":"User","site_admin":false},"body":"Remove whitespace","created_at":"2017-11-03T16:51:20Z","updated_at":"2017-11-03T16:52:43Z","html_url":"https://github.com/ONSdigital/dp-api-tests/pull/10#discussion_r148837115","pull_request_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/pulls/10","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ONSdigital/dp-api-tests/pulls/comments/148837115"},"html":{"href":"https://github.com/ONSdigital/dp-api-tests/pull/10#discussion_r148837115"},"pull_request":{"href":"https://api.github.com/repos/ONSdigital/dp-api-tests/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/ONSdigital/dp-api-tests/pulls/10","id":150514414,"html_url":"https://github.com/ONSdigital/dp-api-tests/pull/10","diff_url":"https://github.com/ONSdigital/dp-api-tests/pull/10.diff","patch_url":"https://github.com/ONSdigital/dp-api-tests/pull/10.patch","issue_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/issues/10","number":10,"state":"open","locked":false,"title":"Feature/refactor import api","user":{"login":"pathimanoj","id":7795253,"avatar_url":"https://avatars0.githubusercontent.com/u/7795253?v=4","gravatar_id":"","url":"https://api.github.com/users/pathimanoj","html_url":"https://github.com/pathimanoj","followers_url":"https://api.github.com/users/pathimanoj/followers","following_url":"https://api.github.com/users/pathimanoj/following{/other_user}","gists_url":"https://api.github.com/users/pathimanoj/gists{/gist_id}","starred_url":"https://api.github.com/users/pathimanoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pathimanoj/subscriptions","organizations_url":"https://api.github.com/users/pathimanoj/orgs","repos_url":"https://api.github.com/users/pathimanoj/repos","events_url":"https://api.github.com/users/pathimanoj/events{/privacy}","received_events_url":"https://api.github.com/users/pathimanoj/received_events","type":"User","site_admin":false},"body":"### What\r\n\r\nRefactored Import API Tests to add setup and teardown functionality.\r\n\r\n### How to review\r\n\r\nCheck the logic of the tests, run the tests. Few tests fail due to bugs in the code, I did left a comment on the tests which fails.\r\n\r\n### Who can review\r\n\r\nTeam B.\r\n","created_at":"2017-11-03T12:20:58Z","updated_at":"2017-11-03T16:52:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"edbf44b3a0b70c7bcaabefc5a509b6b691b63f62","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/pulls/10/commits","review_comments_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/pulls/10/comments","review_comment_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/issues/10/comments","statuses_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/statuses/b5b658baa4a28f91a635fb548659bd730529cd61","head":{"label":"ONSdigital:feature/refactor-import-api","ref":"feature/refactor-import-api","sha":"b5b658baa4a28f91a635fb548659bd730529cd61","user":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"repo":{"id":102735561,"name":"dp-api-tests","full_name":"ONSdigital/dp-api-tests","owner":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ONSdigital/dp-api-tests","description":"Automated API acceptance tests ","fork":false,"url":"https://api.github.com/repos/ONSdigital/dp-api-tests","forks_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/forks","keys_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/teams","hooks_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/hooks","issue_events_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/issues/events{/number}","events_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/events","assignees_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/assignees{/user}","branches_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/branches{/branch}","tags_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/tags","blobs_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/languages","stargazers_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/stargazers","contributors_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/contributors","subscribers_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/subscribers","subscription_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/subscription","commits_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/contents/{+path}","compare_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/merges","archive_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/downloads","issues_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/issues{/number}","pulls_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/labels{/name}","releases_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/releases{/id}","deployments_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/deployments","created_at":"2017-09-07T12:40:49Z","updated_at":"2017-10-26T09:00:16Z","pushed_at":"2017-11-03T12:20:59Z","git_url":"git://github.com/ONSdigital/dp-api-tests.git","ssh_url":"git@github.com:ONSdigital/dp-api-tests.git","clone_url":"https://github.com/ONSdigital/dp-api-tests.git","svn_url":"https://github.com/ONSdigital/dp-api-tests","homepage":null,"size":790,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"cmd-develop"}},"base":{"label":"ONSdigital:cmd-develop","ref":"cmd-develop","sha":"cf230b308399b9e3bc869cf02cca7ab88496f2f0","user":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"repo":{"id":102735561,"name":"dp-api-tests","full_name":"ONSdigital/dp-api-tests","owner":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ONSdigital/dp-api-tests","description":"Automated API acceptance tests ","fork":false,"url":"https://api.github.com/repos/ONSdigital/dp-api-tests","forks_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/forks","keys_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/teams","hooks_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/hooks","issue_events_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/issues/events{/number}","events_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/events","assignees_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/assignees{/user}","branches_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/branches{/branch}","tags_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/tags","blobs_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/languages","stargazers_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/stargazers","contributors_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/contributors","subscribers_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/subscribers","subscription_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/subscription","commits_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/contents/{+path}","compare_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/merges","archive_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/downloads","issues_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/issues{/number}","pulls_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/labels{/name}","releases_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/releases{/id}","deployments_url":"https://api.github.com/repos/ONSdigital/dp-api-tests/deployments","created_at":"2017-09-07T12:40:49Z","updated_at":"2017-10-26T09:00:16Z","pushed_at":"2017-11-03T12:20:59Z","git_url":"git://github.com/ONSdigital/dp-api-tests.git","ssh_url":"git@github.com:ONSdigital/dp-api-tests.git","clone_url":"https://github.com/ONSdigital/dp-api-tests.git","svn_url":"https://github.com/ONSdigital/dp-api-tests","homepage":null,"size":790,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"cmd-develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ONSdigital/dp-api-tests/pulls/10"},"html":{"href":"https://github.com/ONSdigital/dp-api-tests/pull/10"},"issue":{"href":"https://api.github.com/repos/ONSdigital/dp-api-tests/issues/10"},"comments":{"href":"https://api.github.com/repos/ONSdigital/dp-api-tests/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/ONSdigital/dp-api-tests/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/ONSdigital/dp-api-tests/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ONSdigital/dp-api-tests/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/ONSdigital/dp-api-tests/statuses/b5b658baa4a28f91a635fb548659bd730529cd61"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nshumoogum"}}