{"action":"created","comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/pulls/comments/37081021","id":37081021,"diff_hunk":"@@ -0,0 +1,50 @@\n+/*\n+ * Copyright 2015 the original author or authors.\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package org.springframework.cloud.stream.test.binder;\n+\n+import java.util.HashMap;\n+import java.util.Map;\n+import java.util.concurrent.BlockingQueue;\n+import java.util.concurrent.LinkedBlockingDeque;\n+\n+import org.springframework.messaging.Message;\n+import org.springframework.messaging.MessageChannel;\n+import org.springframework.util.Assert;\n+\n+/**\n+ * Maintains a map between (output) channels and messages received (in FIFO order). To be injected in tests that\n+ * can then run assertions on the enqueued messages.\n+ *\n+ * @author Eric Bottard\n+ */\n+public class MessageCollector {\n+\n+\tprivate Map<MessageChannel, BlockingQueue<Message<?>>> results = new HashMap<>();\n+\n+\t/*package*/ BlockingQueue register(MessageChannel channel) {\n+\t\tLinkedBlockingDeque<Message<?>> result = new LinkedBlockingDeque<>();\n+\t\tAssert.isNull(results.put(channel, result));\n+\t\treturn result;\n+\t}\n+\n+\t/*package*/ void unregister(MessageChannel channel) {\n+\t\tAssert.notNull(results.remove(channel));\n+\t}\n+\n+\tpublic BlockingQueue<Message<?>> forChannel(MessageChannel channel) {","path":"spring-cloud-stream-test-support/src/main/java/org/springframework/cloud/stream/test/binder/MessageCollector.java","position":47,"original_position":47,"commit_id":"3307e2e282622e6d23bcfb73db1d0d56984df2e5","original_commit_id":"3307e2e282622e6d23bcfb73db1d0d56984df2e5","user":{"login":"ericbottard","id":313494,"avatar_url":"https://avatars.githubusercontent.com/u/313494?v=3","gravatar_id":"","url":"https://api.github.com/users/ericbottard","html_url":"https://github.com/ericbottard","followers_url":"https://api.github.com/users/ericbottard/followers","following_url":"https://api.github.com/users/ericbottard/following{/other_user}","gists_url":"https://api.github.com/users/ericbottard/gists{/gist_id}","starred_url":"https://api.github.com/users/ericbottard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericbottard/subscriptions","organizations_url":"https://api.github.com/users/ericbottard/orgs","repos_url":"https://api.github.com/users/ericbottard/repos","events_url":"https://api.github.com/users/ericbottard/events{/privacy}","received_events_url":"https://api.github.com/users/ericbottard/received_events","type":"User","site_admin":false},"body":"Same reason as above, we may even want to fail if not found, as this would happen from a misuse of the test support IMO","created_at":"2015-08-14T14:26:23Z","updated_at":"2015-08-14T14:26:23Z","html_url":"https://github.com/spring-cloud/spring-cloud-stream/pull/72#discussion_r37081021","pull_request_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/pulls/72","_links":{"self":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/pulls/comments/37081021"},"html":{"href":"https://github.com/spring-cloud/spring-cloud-stream/pull/72#discussion_r37081021"},"pull_request":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/pulls/72"}}},"pull_request":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/pulls/72","id":42253820,"html_url":"https://github.com/spring-cloud/spring-cloud-stream/pull/72","diff_url":"https://github.com/spring-cloud/spring-cloud-stream/pull/72.diff","patch_url":"https://github.com/spring-cloud/spring-cloud-stream/pull/72.patch","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/issues/72","number":72,"state":"open","locked":false,"title":"XD-3381: Provide test support for modules","user":{"login":"ericbottard","id":313494,"avatar_url":"https://avatars.githubusercontent.com/u/313494?v=3","gravatar_id":"","url":"https://api.github.com/users/ericbottard","html_url":"https://github.com/ericbottard","followers_url":"https://api.github.com/users/ericbottard/followers","following_url":"https://api.github.com/users/ericbottard/following{/other_user}","gists_url":"https://api.github.com/users/ericbottard/gists{/gist_id}","starred_url":"https://api.github.com/users/ericbottard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericbottard/subscriptions","organizations_url":"https://api.github.com/users/ericbottard/orgs","repos_url":"https://api.github.com/users/ericbottard/repos","events_url":"https://api.github.com/users/ericbottard/events{/privacy}","received_events_url":"https://api.github.com/users/ericbottard/received_events","type":"User","site_admin":false},"body":"Example usage is here: https://github.com/ericbottard/spring-cloud-stream-modules/commit/3ad04862f8f844e23c51b09a52c5adfb58000d10","created_at":"2015-08-12T15:35:07Z","updated_at":"2015-08-14T14:26:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"77df576603f04693770e20107a6a93a7d26a7ae1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/pulls/72/commits","review_comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/pulls/72/comments","review_comment_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/issues/72/comments","statuses_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/statuses/3307e2e282622e6d23bcfb73db1d0d56984df2e5","head":{"label":"ericbottard:XD-3381","ref":"XD-3381","sha":"3307e2e282622e6d23bcfb73db1d0d56984df2e5","user":{"login":"ericbottard","id":313494,"avatar_url":"https://avatars.githubusercontent.com/u/313494?v=3","gravatar_id":"","url":"https://api.github.com/users/ericbottard","html_url":"https://github.com/ericbottard","followers_url":"https://api.github.com/users/ericbottard/followers","following_url":"https://api.github.com/users/ericbottard/following{/other_user}","gists_url":"https://api.github.com/users/ericbottard/gists{/gist_id}","starred_url":"https://api.github.com/users/ericbottard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericbottard/subscriptions","organizations_url":"https://api.github.com/users/ericbottard/orgs","repos_url":"https://api.github.com/users/ericbottard/repos","events_url":"https://api.github.com/users/ericbottard/events{/privacy}","received_events_url":"https://api.github.com/users/ericbottard/received_events","type":"User","site_admin":false},"repo":{"id":39128345,"name":"spring-cloud-stream","full_name":"ericbottard/spring-cloud-stream","owner":{"login":"ericbottard","id":313494,"avatar_url":"https://avatars.githubusercontent.com/u/313494?v=3","gravatar_id":"","url":"https://api.github.com/users/ericbottard","html_url":"https://github.com/ericbottard","followers_url":"https://api.github.com/users/ericbottard/followers","following_url":"https://api.github.com/users/ericbottard/following{/other_user}","gists_url":"https://api.github.com/users/ericbottard/gists{/gist_id}","starred_url":"https://api.github.com/users/ericbottard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericbottard/subscriptions","organizations_url":"https://api.github.com/users/ericbottard/orgs","repos_url":"https://api.github.com/users/ericbottard/repos","events_url":"https://api.github.com/users/ericbottard/events{/privacy}","received_events_url":"https://api.github.com/users/ericbottard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ericbottard/spring-cloud-stream","description":"Messaging Microservices with Spring Integration","fork":true,"url":"https://api.github.com/repos/ericbottard/spring-cloud-stream","forks_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/forks","keys_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/teams","hooks_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/hooks","issue_events_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/issues/events{/number}","events_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/events","assignees_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/assignees{/user}","branches_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/branches{/branch}","tags_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/tags","blobs_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/git/refs{/sha}","trees_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/statuses/{sha}","languages_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/languages","stargazers_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/stargazers","contributors_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/contributors","subscribers_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/subscribers","subscription_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/subscription","commits_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/commits{/sha}","git_commits_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/git/commits{/sha}","comments_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/comments{/number}","issue_comment_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/issues/comments{/number}","contents_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/contents/{+path}","compare_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/merges","archive_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/downloads","issues_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/issues{/number}","pulls_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/pulls{/number}","milestones_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/milestones{/number}","notifications_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/labels{/name}","releases_url":"https://api.github.com/repos/ericbottard/spring-cloud-stream/releases{/id}","created_at":"2015-07-15T09:32:07Z","updated_at":"2015-07-15T09:32:08Z","pushed_at":"2015-08-14T13:58:24Z","git_url":"git://github.com/ericbottard/spring-cloud-stream.git","ssh_url":"git@github.com:ericbottard/spring-cloud-stream.git","clone_url":"https://github.com/ericbottard/spring-cloud-stream.git","svn_url":"https://github.com/ericbottard/spring-cloud-stream","homepage":"http://cloud.spring.io/spring-cloud-streams/","size":1425,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spring-cloud:master","ref":"master","sha":"e078e29db4c3c69a68866f8bca43c04e38e6b1c3","user":{"login":"spring-cloud","id":7815877,"avatar_url":"https://avatars.githubusercontent.com/u/7815877?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-cloud","html_url":"https://github.com/spring-cloud","followers_url":"https://api.github.com/users/spring-cloud/followers","following_url":"https://api.github.com/users/spring-cloud/following{/other_user}","gists_url":"https://api.github.com/users/spring-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-cloud/subscriptions","organizations_url":"https://api.github.com/users/spring-cloud/orgs","repos_url":"https://api.github.com/users/spring-cloud/repos","events_url":"https://api.github.com/users/spring-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/spring-cloud/received_events","type":"Organization","site_admin":false},"repo":{"id":38764029,"name":"spring-cloud-stream","full_name":"spring-cloud/spring-cloud-stream","owner":{"login":"spring-cloud","id":7815877,"avatar_url":"https://avatars.githubusercontent.com/u/7815877?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-cloud","html_url":"https://github.com/spring-cloud","followers_url":"https://api.github.com/users/spring-cloud/followers","following_url":"https://api.github.com/users/spring-cloud/following{/other_user}","gists_url":"https://api.github.com/users/spring-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-cloud/subscriptions","organizations_url":"https://api.github.com/users/spring-cloud/orgs","repos_url":"https://api.github.com/users/spring-cloud/repos","events_url":"https://api.github.com/users/spring-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/spring-cloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spring-cloud/spring-cloud-stream","description":"Messaging Microservices with Spring Integration","fork":false,"url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream","forks_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/forks","keys_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/teams","hooks_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/hooks","issue_events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/issues/events{/number}","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/events","assignees_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/assignees{/user}","branches_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/branches{/branch}","tags_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/tags","blobs_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/git/refs{/sha}","trees_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/statuses/{sha}","languages_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/languages","stargazers_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/stargazers","contributors_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/contributors","subscribers_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/subscribers","subscription_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/subscription","commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/commits{/sha}","git_commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/git/commits{/sha}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/comments{/number}","issue_comment_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/issues/comments{/number}","contents_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/contents/{+path}","compare_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/merges","archive_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/downloads","issues_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/issues{/number}","pulls_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/pulls{/number}","milestones_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/milestones{/number}","notifications_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/labels{/name}","releases_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/releases{/id}","created_at":"2015-07-08T15:51:38Z","updated_at":"2015-08-12T17:56:32Z","pushed_at":"2015-08-14T09:17:28Z","git_url":"git://github.com/spring-cloud/spring-cloud-stream.git","ssh_url":"git@github.com:spring-cloud/spring-cloud-stream.git","clone_url":"https://github.com/spring-cloud/spring-cloud-stream.git","svn_url":"https://github.com/spring-cloud/spring-cloud-stream","homepage":"http://cloud.spring.io/spring-cloud-stream/","size":2316,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":15,"mirror_url":null,"open_issues_count":8,"forks":15,"open_issues":8,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/pulls/72"},"html":{"href":"https://github.com/spring-cloud/spring-cloud-stream/pull/72"},"issue":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/issues/72"},"comments":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/issues/72/comments"},"review_comments":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/pulls/72/comments"},"review_comment":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/pulls/72/commits"},"statuses":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/statuses/3307e2e282622e6d23bcfb73db1d0d56984df2e5"}}}}