{"action":"created","comment":{"url":"https://api.github.com/repos/MitocGroup/deep-framework/pulls/comments/51129758","id":51129758,"diff_hunk":"@@ -248,10 +249,95 @@ suite('CredentialsManager', function() {\n \n     credentialsManager.loadBackendCredentials('test_identityID', spyCallback);\n \n+    for (let record of CognitoSyncMock.DATA.Records) {\n+      if (record.Key === CredentialsManager.RECORD_NAME) {\n+        expectedResult = credentialsManager._decodeCredentials(record.Value);\n+        break;\n+      }\n+    }\n+\n+    chai.expect(spyCallback.args[0][1]).to.eql(expectedResult);\n+  });\n+\n+  test('Check loadFrontendCredentials executes with error in _createOrGetDataset()', function() {\n+    let spyCallback = sinon.spy();\n+\n+    let credentialsManagerExport = requireProxy('../lib/CredentialsManager', {\n+      'aws-sdk': cognitoSyncClient,\n+    });\n+\n+    let CredentialsManager = credentialsManagerExport.CredentialsManager;\n+    let credentialsManager = new CredentialsManager(identityPoolId);\n+\n+    //set failure mode openOrCreateDataset\n+    credentialsManager.cognitoSyncClient.setMode(CognitoSyncClientMock.FAILURE_MODE, ['openOrCreateDataset']);\n+\n+    credentialsManager.loadFrontendCredentials(spyCallback);\n+\n     let callbackArg = spyCallback.args[0];\n \n-    chai.expect(callbackArg[0]).to.eql(null);\n-    // @todo - check why it fails\n-    //chai.expect(callbackArg[1]).to.eql({token: 'test_session_creds'});\n+    chai.assert.instanceOf(\n+      callbackArg[0],\n+      CreateCognitoDatasetException,\n+      'callback error argument is an instance of CreateCognitoDatasetException'\n+    );\n+    chai.expect(callbackArg[1]).to.equal(null);\n+  });\n+\n+  test('Check loadFrontendCredentials executes with error in dataset.get()', function() {\n+    let spyCallback = sinon.spy();\n+\n+    let credentialsManagerExport = requireProxy('../lib/CredentialsManager', {\n+      'aws-sdk': cognitoSyncClient,\n+    });\n+\n+    let CredentialsManager = credentialsManagerExport.CredentialsManager;\n+    let credentialsManager = new CredentialsManager(identityPoolId);\n+\n+    //set failure in get mode\n+    credentialsManager.cognitoSyncClient.setMode(CognitoSyncClientMock.DATA_MODE_WITH_ERROR_IN_GET_DATASET, ['openOrCreateDataset']);\n+\n+    credentialsManager.loadFrontendCredentials(spyCallback);\n+\n+    let callbackArg = spyCallback.args[0];\n+\n+    chai.expect(callbackArg[0]).to.eql(Dataset.ERROR);\n+    chai.expect(callbackArg[1]).to.equal(null);\n+  });\n+\n+  test('Check loadFrontendCredentials executes with data in dataset.get()', function() {\n+    let spyCallback = sinon.spy();\n+\n+    let credentialsManagerExport = requireProxy('../lib/CredentialsManager', {\n+      'aws-sdk': cognitoSyncClient,\n+    });\n+\n+    let CredentialsManager = credentialsManagerExport.CredentialsManager;\n+    let credentialsManager = new CredentialsManager(identityPoolId);\n+\n+    //set data mode\n+    credentialsManager.cognitoSyncClient.setMode(CognitoSyncClientMock.DATA_MODE_WITH_DATA_IN_GET_DATASET, ['openOrCreateDataset']);","path":"src/deep-security/test/CredentialsManager.js","position":160,"original_position":160,"commit_id":"467a116777b9e6b4a1e401fe0563a953e2d3f798","original_commit_id":"467a116777b9e6b4a1e401fe0563a953e2d3f798","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Line is too long.","created_at":"2016-01-28T14:39:58Z","updated_at":"2016-01-28T14:39:58Z","html_url":"https://github.com/MitocGroup/deep-framework/pull/211#discussion_r51129758","pull_request_url":"https://api.github.com/repos/MitocGroup/deep-framework/pulls/211","_links":{"self":{"href":"https://api.github.com/repos/MitocGroup/deep-framework/pulls/comments/51129758"},"html":{"href":"https://github.com/MitocGroup/deep-framework/pull/211#discussion_r51129758"},"pull_request":{"href":"https://api.github.com/repos/MitocGroup/deep-framework/pulls/211"}}},"pull_request":{"url":"https://api.github.com/repos/MitocGroup/deep-framework/pulls/211","id":57510506,"html_url":"https://github.com/MitocGroup/deep-framework/pull/211","diff_url":"https://github.com/MitocGroup/deep-framework/pull/211.diff","patch_url":"https://github.com/MitocGroup/deep-framework/pull/211.patch","issue_url":"https://api.github.com/repos/MitocGroup/deep-framework/issues/211","number":211,"state":"open","locked":false,"title":"Refactoring old one and adding new unit tests for deep-security","user":{"login":"vcernomschi","id":10863276,"avatar_url":"https://avatars.githubusercontent.com/u/10863276?v=3","gravatar_id":"","url":"https://api.github.com/users/vcernomschi","html_url":"https://github.com/vcernomschi","followers_url":"https://api.github.com/users/vcernomschi/followers","following_url":"https://api.github.com/users/vcernomschi/following{/other_user}","gists_url":"https://api.github.com/users/vcernomschi/gists{/gist_id}","starred_url":"https://api.github.com/users/vcernomschi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vcernomschi/subscriptions","organizations_url":"https://api.github.com/users/vcernomschi/orgs","repos_url":"https://api.github.com/users/vcernomschi/repos","events_url":"https://api.github.com/users/vcernomschi/events{/privacy}","received_events_url":"https://api.github.com/users/vcernomschi/received_events","type":"User","site_admin":false},"body":"Refactoring old one and adding new unit tests for deep-security","created_at":"2016-01-28T14:39:28Z","updated_at":"2016-01-28T14:39:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cef32073c4fefe5727b30b43e0269544ae4dfc3c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/MitocGroup/deep-framework/pulls/211/commits","review_comments_url":"https://api.github.com/repos/MitocGroup/deep-framework/pulls/211/comments","review_comment_url":"https://api.github.com/repos/MitocGroup/deep-framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MitocGroup/deep-framework/issues/211/comments","statuses_url":"https://api.github.com/repos/MitocGroup/deep-framework/statuses/467a116777b9e6b4a1e401fe0563a953e2d3f798","head":{"label":"MitocGroup:issue_206","ref":"issue_206","sha":"467a116777b9e6b4a1e401fe0563a953e2d3f798","user":{"login":"MitocGroup","id":8398780,"avatar_url":"https://avatars.githubusercontent.com/u/8398780?v=3","gravatar_id":"","url":"https://api.github.com/users/MitocGroup","html_url":"https://github.com/MitocGroup","followers_url":"https://api.github.com/users/MitocGroup/followers","following_url":"https://api.github.com/users/MitocGroup/following{/other_user}","gists_url":"https://api.github.com/users/MitocGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/MitocGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MitocGroup/subscriptions","organizations_url":"https://api.github.com/users/MitocGroup/orgs","repos_url":"https://api.github.com/users/MitocGroup/repos","events_url":"https://api.github.com/users/MitocGroup/events{/privacy}","received_events_url":"https://api.github.com/users/MitocGroup/received_events","type":"Organization","site_admin":false},"repo":{"id":43718196,"name":"deep-framework","full_name":"MitocGroup/deep-framework","owner":{"login":"MitocGroup","id":8398780,"avatar_url":"https://avatars.githubusercontent.com/u/8398780?v=3","gravatar_id":"","url":"https://api.github.com/users/MitocGroup","html_url":"https://github.com/MitocGroup","followers_url":"https://api.github.com/users/MitocGroup/followers","following_url":"https://api.github.com/users/MitocGroup/following{/other_user}","gists_url":"https://api.github.com/users/MitocGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/MitocGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MitocGroup/subscriptions","organizations_url":"https://api.github.com/users/MitocGroup/orgs","repos_url":"https://api.github.com/users/MitocGroup/repos","events_url":"https://api.github.com/users/MitocGroup/events{/privacy}","received_events_url":"https://api.github.com/users/MitocGroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MitocGroup/deep-framework","description":"Serverless Web Framework for Cloud-Native Applications and Platforms using Microservices Architecture","fork":false,"url":"https://api.github.com/repos/MitocGroup/deep-framework","forks_url":"https://api.github.com/repos/MitocGroup/deep-framework/forks","keys_url":"https://api.github.com/repos/MitocGroup/deep-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MitocGroup/deep-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MitocGroup/deep-framework/teams","hooks_url":"https://api.github.com/repos/MitocGroup/deep-framework/hooks","issue_events_url":"https://api.github.com/repos/MitocGroup/deep-framework/issues/events{/number}","events_url":"https://api.github.com/repos/MitocGroup/deep-framework/events","assignees_url":"https://api.github.com/repos/MitocGroup/deep-framework/assignees{/user}","branches_url":"https://api.github.com/repos/MitocGroup/deep-framework/branches{/branch}","tags_url":"https://api.github.com/repos/MitocGroup/deep-framework/tags","blobs_url":"https://api.github.com/repos/MitocGroup/deep-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MitocGroup/deep-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MitocGroup/deep-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/MitocGroup/deep-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MitocGroup/deep-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/MitocGroup/deep-framework/languages","stargazers_url":"https://api.github.com/repos/MitocGroup/deep-framework/stargazers","contributors_url":"https://api.github.com/repos/MitocGroup/deep-framework/contributors","subscribers_url":"https://api.github.com/repos/MitocGroup/deep-framework/subscribers","subscription_url":"https://api.github.com/repos/MitocGroup/deep-framework/subscription","commits_url":"https://api.github.com/repos/MitocGroup/deep-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/MitocGroup/deep-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/MitocGroup/deep-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/MitocGroup/deep-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/MitocGroup/deep-framework/contents/{+path}","compare_url":"https://api.github.com/repos/MitocGroup/deep-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MitocGroup/deep-framework/merges","archive_url":"https://api.github.com/repos/MitocGroup/deep-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MitocGroup/deep-framework/downloads","issues_url":"https://api.github.com/repos/MitocGroup/deep-framework/issues{/number}","pulls_url":"https://api.github.com/repos/MitocGroup/deep-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/MitocGroup/deep-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/MitocGroup/deep-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MitocGroup/deep-framework/labels{/name}","releases_url":"https://api.github.com/repos/MitocGroup/deep-framework/releases{/id}","deployments_url":"https://api.github.com/repos/MitocGroup/deep-framework/deployments","created_at":"2015-10-05T22:48:47Z","updated_at":"2016-01-27T21:53:43Z","pushed_at":"2016-01-28T14:39:29Z","git_url":"git://github.com/MitocGroup/deep-framework.git","ssh_url":"git@github.com:MitocGroup/deep-framework.git","clone_url":"https://github.com/MitocGroup/deep-framework.git","svn_url":"https://github.com/MitocGroup/deep-framework","homepage":"http://docs.deep.mg","size":9239,"stargazers_count":210,"watchers_count":210,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":10,"forks":21,"open_issues":10,"watchers":210,"default_branch":"master"}},"base":{"label":"MitocGroup:master","ref":"master","sha":"769240045fd0c971ffe5b45f86e5cbe223d2ce66","user":{"login":"MitocGroup","id":8398780,"avatar_url":"https://avatars.githubusercontent.com/u/8398780?v=3","gravatar_id":"","url":"https://api.github.com/users/MitocGroup","html_url":"https://github.com/MitocGroup","followers_url":"https://api.github.com/users/MitocGroup/followers","following_url":"https://api.github.com/users/MitocGroup/following{/other_user}","gists_url":"https://api.github.com/users/MitocGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/MitocGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MitocGroup/subscriptions","organizations_url":"https://api.github.com/users/MitocGroup/orgs","repos_url":"https://api.github.com/users/MitocGroup/repos","events_url":"https://api.github.com/users/MitocGroup/events{/privacy}","received_events_url":"https://api.github.com/users/MitocGroup/received_events","type":"Organization","site_admin":false},"repo":{"id":43718196,"name":"deep-framework","full_name":"MitocGroup/deep-framework","owner":{"login":"MitocGroup","id":8398780,"avatar_url":"https://avatars.githubusercontent.com/u/8398780?v=3","gravatar_id":"","url":"https://api.github.com/users/MitocGroup","html_url":"https://github.com/MitocGroup","followers_url":"https://api.github.com/users/MitocGroup/followers","following_url":"https://api.github.com/users/MitocGroup/following{/other_user}","gists_url":"https://api.github.com/users/MitocGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/MitocGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MitocGroup/subscriptions","organizations_url":"https://api.github.com/users/MitocGroup/orgs","repos_url":"https://api.github.com/users/MitocGroup/repos","events_url":"https://api.github.com/users/MitocGroup/events{/privacy}","received_events_url":"https://api.github.com/users/MitocGroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MitocGroup/deep-framework","description":"Serverless Web Framework for Cloud-Native Applications and Platforms using Microservices Architecture","fork":false,"url":"https://api.github.com/repos/MitocGroup/deep-framework","forks_url":"https://api.github.com/repos/MitocGroup/deep-framework/forks","keys_url":"https://api.github.com/repos/MitocGroup/deep-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MitocGroup/deep-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MitocGroup/deep-framework/teams","hooks_url":"https://api.github.com/repos/MitocGroup/deep-framework/hooks","issue_events_url":"https://api.github.com/repos/MitocGroup/deep-framework/issues/events{/number}","events_url":"https://api.github.com/repos/MitocGroup/deep-framework/events","assignees_url":"https://api.github.com/repos/MitocGroup/deep-framework/assignees{/user}","branches_url":"https://api.github.com/repos/MitocGroup/deep-framework/branches{/branch}","tags_url":"https://api.github.com/repos/MitocGroup/deep-framework/tags","blobs_url":"https://api.github.com/repos/MitocGroup/deep-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MitocGroup/deep-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MitocGroup/deep-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/MitocGroup/deep-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MitocGroup/deep-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/MitocGroup/deep-framework/languages","stargazers_url":"https://api.github.com/repos/MitocGroup/deep-framework/stargazers","contributors_url":"https://api.github.com/repos/MitocGroup/deep-framework/contributors","subscribers_url":"https://api.github.com/repos/MitocGroup/deep-framework/subscribers","subscription_url":"https://api.github.com/repos/MitocGroup/deep-framework/subscription","commits_url":"https://api.github.com/repos/MitocGroup/deep-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/MitocGroup/deep-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/MitocGroup/deep-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/MitocGroup/deep-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/MitocGroup/deep-framework/contents/{+path}","compare_url":"https://api.github.com/repos/MitocGroup/deep-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MitocGroup/deep-framework/merges","archive_url":"https://api.github.com/repos/MitocGroup/deep-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MitocGroup/deep-framework/downloads","issues_url":"https://api.github.com/repos/MitocGroup/deep-framework/issues{/number}","pulls_url":"https://api.github.com/repos/MitocGroup/deep-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/MitocGroup/deep-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/MitocGroup/deep-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MitocGroup/deep-framework/labels{/name}","releases_url":"https://api.github.com/repos/MitocGroup/deep-framework/releases{/id}","deployments_url":"https://api.github.com/repos/MitocGroup/deep-framework/deployments","created_at":"2015-10-05T22:48:47Z","updated_at":"2016-01-27T21:53:43Z","pushed_at":"2016-01-28T14:39:29Z","git_url":"git://github.com/MitocGroup/deep-framework.git","ssh_url":"git@github.com:MitocGroup/deep-framework.git","clone_url":"https://github.com/MitocGroup/deep-framework.git","svn_url":"https://github.com/MitocGroup/deep-framework","homepage":"http://docs.deep.mg","size":9239,"stargazers_count":210,"watchers_count":210,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":10,"forks":21,"open_issues":10,"watchers":210,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MitocGroup/deep-framework/pulls/211"},"html":{"href":"https://github.com/MitocGroup/deep-framework/pull/211"},"issue":{"href":"https://api.github.com/repos/MitocGroup/deep-framework/issues/211"},"comments":{"href":"https://api.github.com/repos/MitocGroup/deep-framework/issues/211/comments"},"review_comments":{"href":"https://api.github.com/repos/MitocGroup/deep-framework/pulls/211/comments"},"review_comment":{"href":"https://api.github.com/repos/MitocGroup/deep-framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MitocGroup/deep-framework/pulls/211/commits"},"statuses":{"href":"https://api.github.com/repos/MitocGroup/deep-framework/statuses/467a116777b9e6b4a1e401fe0563a953e2d3f798"}}}}