{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/comments/171698179","pull_request_review_id":100598519,"id":171698179,"diff_hunk":"@@ -329,5 +330,24 @@ describe('Mqtt as MqttReceiver', function () {\n         });\n       });\n     });\n+\n+    /*Tests_SRS_NODE_DEVICE_MQTT_18_057: [ If there is a listener for the `inputMessage` event, a `inputMessage` event shall be emitted for each message received. ]*/\n+    /*Tests_SRS_NODE_DEVICE_MQTT_18_058: [ When an `inputMessage` event is received, Mqtt shall extract the inputName from the topic according to the following convention: 'devices/<deviceId>/modules/<moduleId>/inputs/<inputName>' ]*/\n+    /*Tests_SRS_NODE_DEVICE_MQTT_18_056: [ When an `inputMessage` event is emitted, the first parameter shall be the inputName and the second parameter shall be of type `Message`. ]*/\n+    describe('#inputMessage', function() {\n+        it('emits an inputMessage event with a Message object when there is a listener', function (done) {\n+          fakeConfig.moduleId = 'moduleId';\n+          var receiver = new Mqtt(fakeAuthenticationProvider, fakeMqttBase);\n+          receiver.connect(function () {\n+            receiver.on('inputMessage', function (inputName, msg) {\n+              assert.strictEqual(inputName, 'fakeInputName')\n+              assert.instanceOf(msg, Message);","path":"device/transport/mqtt/test/_mqtt_receiver_test.js","position":40,"original_position":40,"commit_id":"8566724533d7e9a39edc0b92c9f47b5cc9dfbbf9","original_commit_id":"8566724533d7e9a39edc0b92c9f47b5cc9dfbbf9","user":{"login":"BertKleewein","id":8028738,"avatar_url":"https://avatars0.githubusercontent.com/u/8028738?v=4","gravatar_id":"","url":"https://api.github.com/users/BertKleewein","html_url":"https://github.com/BertKleewein","followers_url":"https://api.github.com/users/BertKleewein/followers","following_url":"https://api.github.com/users/BertKleewein/following{/other_user}","gists_url":"https://api.github.com/users/BertKleewein/gists{/gist_id}","starred_url":"https://api.github.com/users/BertKleewein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BertKleewein/subscriptions","organizations_url":"https://api.github.com/users/BertKleewein/orgs","repos_url":"https://api.github.com/users/BertKleewein/repos","events_url":"https://api.github.com/users/BertKleewein/events{/privacy}","received_events_url":"https://api.github.com/users/BertKleewein/received_events","type":"User","site_admin":false},"body":"Yep, this was copy/paste from the corresponding message test\r\n\r\n---\r\nIn reply to: [171429827](https://github.com/Azure/azure-iot-sdk-node/pull/237#discussion_r171429827) [](ancestors = 171429827)","created_at":"2018-03-01T21:24:57Z","updated_at":"2018-03-01T21:24:57Z","html_url":"https://github.com/Azure/azure-iot-sdk-node/pull/237#discussion_r171698179","pull_request_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/237","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/comments/171698179"},"html":{"href":"https://github.com/Azure/azure-iot-sdk-node/pull/237#discussion_r171698179"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/237"}},"in_reply_to_id":171429827},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/237","id":172100058,"html_url":"https://github.com/Azure/azure-iot-sdk-node/pull/237","diff_url":"https://github.com/Azure/azure-iot-sdk-node/pull/237.diff","patch_url":"https://github.com/Azure/azure-iot-sdk-node/pull/237.patch","issue_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/issues/237","number":237,"state":"closed","locked":false,"title":"CR feedback and unit tests for MQTT modules.","user":{"login":"BertKleewein","id":8028738,"avatar_url":"https://avatars0.githubusercontent.com/u/8028738?v=4","gravatar_id":"","url":"https://api.github.com/users/BertKleewein","html_url":"https://github.com/BertKleewein","followers_url":"https://api.github.com/users/BertKleewein/followers","following_url":"https://api.github.com/users/BertKleewein/following{/other_user}","gists_url":"https://api.github.com/users/BertKleewein/gists{/gist_id}","starred_url":"https://api.github.com/users/BertKleewein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BertKleewein/subscriptions","organizations_url":"https://api.github.com/users/BertKleewein/orgs","repos_url":"https://api.github.com/users/BertKleewein/repos","events_url":"https://api.github.com/users/BertKleewein/events{/privacy}","received_events_url":"https://api.github.com/users/BertKleewein/received_events","type":"User","site_admin":false},"body":"This is larger than I thought it would be.  \r\n\r\nI did the following:\r\n1) Removed the onInputMessage() and removeInputMessageHandler() functions, opting for on('inputMessage', function(inputName, msg)) instead.\r\n2) Added enableInputMessages and disableInputMessages at the transport level.\r\n3) Diverged code paths for sendEvent and sendOutputEvent.  A module can do both Event and OutputEvent.  Likewise, a device can do both.  \r\n4) Diverged code paths for on('message') and on('inputMessage').\r\n5) Added unit test coverage.\r\n\r\nI have mixed feelings about this change.  It feels like I've added a lot of complexity that maybe isn't necessary. ","created_at":"2018-02-28T23:08:13Z","updated_at":"2018-03-01T21:24:57Z","closed_at":"2018-03-01T19:34:51Z","merged_at":"2018-03-01T19:34:51Z","merge_commit_sha":"8566724533d7e9a39edc0b92c9f47b5cc9dfbbf9","assignee":null,"assignees":[],"requested_reviewers":[{"login":"anthonyvercolano","id":9854568,"avatar_url":"https://avatars0.githubusercontent.com/u/9854568?v=4","gravatar_id":"","url":"https://api.github.com/users/anthonyvercolano","html_url":"https://github.com/anthonyvercolano","followers_url":"https://api.github.com/users/anthonyvercolano/followers","following_url":"https://api.github.com/users/anthonyvercolano/following{/other_user}","gists_url":"https://api.github.com/users/anthonyvercolano/gists{/gist_id}","starred_url":"https://api.github.com/users/anthonyvercolano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anthonyvercolano/subscriptions","organizations_url":"https://api.github.com/users/anthonyvercolano/orgs","repos_url":"https://api.github.com/users/anthonyvercolano/repos","events_url":"https://api.github.com/users/anthonyvercolano/events{/privacy}","received_events_url":"https://api.github.com/users/anthonyvercolano/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/237/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/237/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/issues/237/comments","statuses_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/statuses/8566724533d7e9a39edc0b92c9f47b5cc9dfbbf9","head":{"label":"BertKleewein:modules-ut","ref":"modules-ut","sha":"8566724533d7e9a39edc0b92c9f47b5cc9dfbbf9","user":{"login":"BertKleewein","id":8028738,"avatar_url":"https://avatars0.githubusercontent.com/u/8028738?v=4","gravatar_id":"","url":"https://api.github.com/users/BertKleewein","html_url":"https://github.com/BertKleewein","followers_url":"https://api.github.com/users/BertKleewein/followers","following_url":"https://api.github.com/users/BertKleewein/following{/other_user}","gists_url":"https://api.github.com/users/BertKleewein/gists{/gist_id}","starred_url":"https://api.github.com/users/BertKleewein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BertKleewein/subscriptions","organizations_url":"https://api.github.com/users/BertKleewein/orgs","repos_url":"https://api.github.com/users/BertKleewein/repos","events_url":"https://api.github.com/users/BertKleewein/events{/privacy}","received_events_url":"https://api.github.com/users/BertKleewein/received_events","type":"User","site_admin":false},"repo":{"id":103567942,"name":"azure-iot-sdk-node","full_name":"BertKleewein/azure-iot-sdk-node","owner":{"login":"BertKleewein","id":8028738,"avatar_url":"https://avatars0.githubusercontent.com/u/8028738?v=4","gravatar_id":"","url":"https://api.github.com/users/BertKleewein","html_url":"https://github.com/BertKleewein","followers_url":"https://api.github.com/users/BertKleewein/followers","following_url":"https://api.github.com/users/BertKleewein/following{/other_user}","gists_url":"https://api.github.com/users/BertKleewein/gists{/gist_id}","starred_url":"https://api.github.com/users/BertKleewein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BertKleewein/subscriptions","organizations_url":"https://api.github.com/users/BertKleewein/orgs","repos_url":"https://api.github.com/users/BertKleewein/repos","events_url":"https://api.github.com/users/BertKleewein/events{/privacy}","received_events_url":"https://api.github.com/users/BertKleewein/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BertKleewein/azure-iot-sdk-node","description":"A Node.js SDK for connecting devices to Microsoft Azure IoT services","fork":true,"url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node","forks_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/forks","keys_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/teams","hooks_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/hooks","issue_events_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/issues/events{/number}","events_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/events","assignees_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/assignees{/user}","branches_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/branches{/branch}","tags_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/tags","blobs_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/statuses/{sha}","languages_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/languages","stargazers_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/stargazers","contributors_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/contributors","subscribers_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/subscribers","subscription_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/subscription","commits_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/contents/{+path}","compare_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/merges","archive_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/downloads","issues_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/issues{/number}","pulls_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/pulls{/number}","milestones_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/milestones{/number}","notifications_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/labels{/name}","releases_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/releases{/id}","deployments_url":"https://api.github.com/repos/BertKleewein/azure-iot-sdk-node/deployments","created_at":"2017-09-14T18:33:09Z","updated_at":"2017-09-14T18:33:12Z","pushed_at":"2018-03-01T21:18:44Z","git_url":"git://github.com/BertKleewein/azure-iot-sdk-node.git","ssh_url":"git@github.com:BertKleewein/azure-iot-sdk-node.git","clone_url":"https://github.com/BertKleewein/azure-iot-sdk-node.git","svn_url":"https://github.com/BertKleewein/azure-iot-sdk-node","homepage":"https://azure.github.io/azure-iot-sdk-node/","size":42156,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Azure:modules-preview","ref":"modules-preview","sha":"abe5af5e9cb5fa482c2582e8fb49a28ded20416d","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":70935002,"name":"azure-iot-sdk-node","full_name":"Azure/azure-iot-sdk-node","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-iot-sdk-node","description":"A Node.js SDK for connecting devices to Microsoft Azure IoT services","fork":false,"url":"https://api.github.com/repos/Azure/azure-iot-sdk-node","forks_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/forks","keys_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/teams","hooks_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/events","assignees_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/tags","blobs_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/subscription","commits_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/merges","archive_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/downloads","issues_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/deployments","created_at":"2016-10-14T18:03:43Z","updated_at":"2018-02-25T18:11:48Z","pushed_at":"2018-03-01T19:34:50Z","git_url":"git://github.com/Azure/azure-iot-sdk-node.git","ssh_url":"git@github.com:Azure/azure-iot-sdk-node.git","clone_url":"https://github.com/Azure/azure-iot-sdk-node.git","svn_url":"https://github.com/Azure/azure-iot-sdk-node","homepage":"https://docs.microsoft.com/en-us/azure/iot-hub/","size":43194,"stargazers_count":91,"watchers_count":91,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":74,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":74,"open_issues":9,"watchers":91,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/237"},"html":{"href":"https://github.com/Azure/azure-iot-sdk-node/pull/237"},"issue":{"href":"https://api.github.com/repos/Azure/azure-iot-sdk-node/issues/237"},"comments":{"href":"https://api.github.com/repos/Azure/azure-iot-sdk-node/issues/237/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/237/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/237/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-iot-sdk-node/statuses/8566724533d7e9a39edc0b92c9f47b5cc9dfbbf9"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"BertKleewein"}}