{"action":"created","comment":{"url":"https://api.github.com/repos/allegro/hermes/pulls/comments/213578560","pull_request_review_id":150438521,"id":213578560,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMzU3ODU2MA==","diff_hunk":"@@ -0,0 +1,105 @@\n+# Hermes Mock\n+\n+A thin library designed to mocking Hermes in tests.\n+\n+## Overview\n+\n+Mocking is provided by `HermesMock` class, which consists of 3 parts:\n+- `HermesMockDefine` \n+- `HermesMockExpect`\n+- `HermesMockQuery`\n+\n+##### HermesMockDefine\n+\n+Is responsible for defining new topics on Hermes, consists of those methods:\n+\n+- `jsonTopic(String topicName)` - defines a JSON topic .\n+\n+- `avroTopic(String topicName)` - defines am Avro topic.\n+\n+- `jsonTopic(String topicName, int statusCode)` - defines a JSON topic with a specific response code.\n+\n+- `avroTopic(String topicName, int statusCode)` - defines an Avro topic with a specific response code.\n+\n+##### HermesMockExpect\n+\n+Is responsible for expectation of message on Hermes side, consists of those methods:\n+ \n+- `void singleMessageOnTopic(String topicName)` - expects 1 and only 1 message on topic.\n+\n+- `<T> void singleJsonMessageOnTopicAs(String topicName, Class<T> clazz)` - expects 1 and only 1 JSON message on a topic\n+of a specific type.\n+\n+- `<T> void singleAvroMessageOnTopic(String topicName, Schema schema)` - expects 1 and only 1 Avro message on a topic \n+of a specific type.\n+\n+- `void messagesOnTopic(String topicName, int count)` - expects particular number of messages on a given topic.\n+\n+- `<T> void jsonMessagesOnTopicAs(String topicName, int count, Class<T> clazz)` - expects particular number of\n+JSON messages on a given topic.\n+\n+- `<T> void avroMessagesOnTopic(String topicName, int count, Schema schema)` - expects particular number of\n+Avro messages on a given topic.\n+\n+##### HermesMockQuery\n+\n+Is responsible for querying Hermes for a received messages, consists of those methods: \n+\n+- `List<Request> allRequests()` - get all the received messages.\n+\n+- `List<Request> allRequestsOnTopic(String topicName)` - get all the received messages on a given topic.\n+\n+- `<T> List<T> allJsonMessagesAs(String topicName, Class<T> clazz)` - get all the received messages on a given topic.\n+\n+- `List<byte[]> allAvroRawMessages(String topicName)` - get all the received raw Avro messages on a given topic.\n+\n+- `<T> List<T> allAvroMessagesAs(String topicName, Schema schema, Class<T> clazz)` - get all the received Avro messages\n+on a given topic as a specific type.\n+\n+- `Optional<Request> lastRequest(String topicName)` - get last received request on topic.\n+\n+- `<T> Optional<T> lastJsonMessageAs(String topicName, Class<T> clazz)` - get last received JSON message on topic\n+as a specific type.\n+\n+- `<T> Optional<byte[]> lastAvroRawMessage(String topicName)` - get last received raw Avro message on topic.\n+\n+- `<T> Optional<T> lastAvroMessageAs(String topicName, Schema schema, Class<T> clazz)` - get last received Avro message\n+ on topic as a specific type.\n+\n+## Creating\n+\n+To start using Hermes mock, add it as an dependency:","path":"docs/docs/user/hermes-mock.md","position":71,"original_position":71,"commit_id":"e9c854a0f9f513b7a5ea342ac3dc3518f5b7fa9a","original_commit_id":"e9c854a0f9f513b7a5ea342ac3dc3518f5b7fa9a","user":{"login":"pbetkier","id":1076252,"node_id":"MDQ6VXNlcjEwNzYyNTI=","avatar_url":"https://avatars3.githubusercontent.com/u/1076252?v=4","gravatar_id":"","url":"https://api.github.com/users/pbetkier","html_url":"https://github.com/pbetkier","followers_url":"https://api.github.com/users/pbetkier/followers","following_url":"https://api.github.com/users/pbetkier/following{/other_user}","gists_url":"https://api.github.com/users/pbetkier/gists{/gist_id}","starred_url":"https://api.github.com/users/pbetkier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbetkier/subscriptions","organizations_url":"https://api.github.com/users/pbetkier/orgs","repos_url":"https://api.github.com/users/pbetkier/repos","events_url":"https://api.github.com/users/pbetkier/events{/privacy}","received_events_url":"https://api.github.com/users/pbetkier/received_events","type":"User","site_admin":false},"body":"`as a dependency`","created_at":"2018-08-29T07:55:39Z","updated_at":"2018-08-29T07:58:27Z","html_url":"https://github.com/allegro/hermes/pull/900#discussion_r213578560","pull_request_url":"https://api.github.com/repos/allegro/hermes/pulls/900","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/allegro/hermes/pulls/comments/213578560"},"html":{"href":"https://github.com/allegro/hermes/pull/900#discussion_r213578560"},"pull_request":{"href":"https://api.github.com/repos/allegro/hermes/pulls/900"}}},"pull_request":{"url":"https://api.github.com/repos/allegro/hermes/pulls/900","id":211650378,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExNjUwMzc4","html_url":"https://github.com/allegro/hermes/pull/900","diff_url":"https://github.com/allegro/hermes/pull/900.diff","patch_url":"https://github.com/allegro/hermes/pull/900.patch","issue_url":"https://api.github.com/repos/allegro/hermes/issues/900","number":900,"state":"open","locked":false,"title":"Hermes-Mock docs","user":{"login":"cristaloleg","id":366002,"node_id":"MDQ6VXNlcjM2NjAwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/366002?v=4","gravatar_id":"","url":"https://api.github.com/users/cristaloleg","html_url":"https://github.com/cristaloleg","followers_url":"https://api.github.com/users/cristaloleg/followers","following_url":"https://api.github.com/users/cristaloleg/following{/other_user}","gists_url":"https://api.github.com/users/cristaloleg/gists{/gist_id}","starred_url":"https://api.github.com/users/cristaloleg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cristaloleg/subscriptions","organizations_url":"https://api.github.com/users/cristaloleg/orgs","repos_url":"https://api.github.com/users/cristaloleg/repos","events_url":"https://api.github.com/users/cristaloleg/events{/privacy}","received_events_url":"https://api.github.com/users/cristaloleg/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-29T07:12:26Z","updated_at":"2018-08-29T07:58:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"67fb102976096ac0a2a8a9e7913c7e252f7eae1e","assignee":{"login":"cristaloleg","id":366002,"node_id":"MDQ6VXNlcjM2NjAwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/366002?v=4","gravatar_id":"","url":"https://api.github.com/users/cristaloleg","html_url":"https://github.com/cristaloleg","followers_url":"https://api.github.com/users/cristaloleg/followers","following_url":"https://api.github.com/users/cristaloleg/following{/other_user}","gists_url":"https://api.github.com/users/cristaloleg/gists{/gist_id}","starred_url":"https://api.github.com/users/cristaloleg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cristaloleg/subscriptions","organizations_url":"https://api.github.com/users/cristaloleg/orgs","repos_url":"https://api.github.com/users/cristaloleg/repos","events_url":"https://api.github.com/users/cristaloleg/events{/privacy}","received_events_url":"https://api.github.com/users/cristaloleg/received_events","type":"User","site_admin":false},"assignees":[{"login":"cristaloleg","id":366002,"node_id":"MDQ6VXNlcjM2NjAwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/366002?v=4","gravatar_id":"","url":"https://api.github.com/users/cristaloleg","html_url":"https://github.com/cristaloleg","followers_url":"https://api.github.com/users/cristaloleg/followers","following_url":"https://api.github.com/users/cristaloleg/following{/other_user}","gists_url":"https://api.github.com/users/cristaloleg/gists{/gist_id}","starred_url":"https://api.github.com/users/cristaloleg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cristaloleg/subscriptions","organizations_url":"https://api.github.com/users/cristaloleg/orgs","repos_url":"https://api.github.com/users/cristaloleg/repos","events_url":"https://api.github.com/users/cristaloleg/events{/privacy}","received_events_url":"https://api.github.com/users/cristaloleg/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":211844791,"node_id":"MDU6TGFiZWwyMTE4NDQ3OTE=","url":"https://api.github.com/repos/allegro/hermes/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/allegro/hermes/pulls/900/commits","review_comments_url":"https://api.github.com/repos/allegro/hermes/pulls/900/comments","review_comment_url":"https://api.github.com/repos/allegro/hermes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/allegro/hermes/issues/900/comments","statuses_url":"https://api.github.com/repos/allegro/hermes/statuses/e9c854a0f9f513b7a5ea342ac3dc3518f5b7fa9a","head":{"label":"allegro:feature/hermes-mock-docs","ref":"feature/hermes-mock-docs","sha":"e9c854a0f9f513b7a5ea342ac3dc3518f5b7fa9a","user":{"login":"allegro","id":562236,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2MjIzNg==","avatar_url":"https://avatars3.githubusercontent.com/u/562236?v=4","gravatar_id":"","url":"https://api.github.com/users/allegro","html_url":"https://github.com/allegro","followers_url":"https://api.github.com/users/allegro/followers","following_url":"https://api.github.com/users/allegro/following{/other_user}","gists_url":"https://api.github.com/users/allegro/gists{/gist_id}","starred_url":"https://api.github.com/users/allegro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allegro/subscriptions","organizations_url":"https://api.github.com/users/allegro/orgs","repos_url":"https://api.github.com/users/allegro/repos","events_url":"https://api.github.com/users/allegro/events{/privacy}","received_events_url":"https://api.github.com/users/allegro/received_events","type":"Organization","site_admin":false},"repo":{"id":35662043,"node_id":"MDEwOlJlcG9zaXRvcnkzNTY2MjA0Mw==","name":"hermes","full_name":"allegro/hermes","owner":{"login":"allegro","id":562236,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2MjIzNg==","avatar_url":"https://avatars3.githubusercontent.com/u/562236?v=4","gravatar_id":"","url":"https://api.github.com/users/allegro","html_url":"https://github.com/allegro","followers_url":"https://api.github.com/users/allegro/followers","following_url":"https://api.github.com/users/allegro/following{/other_user}","gists_url":"https://api.github.com/users/allegro/gists{/gist_id}","starred_url":"https://api.github.com/users/allegro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allegro/subscriptions","organizations_url":"https://api.github.com/users/allegro/orgs","repos_url":"https://api.github.com/users/allegro/repos","events_url":"https://api.github.com/users/allegro/events{/privacy}","received_events_url":"https://api.github.com/users/allegro/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/allegro/hermes","description":"Fast and reliable message broker built on top of Kafka.","fork":false,"url":"https://api.github.com/repos/allegro/hermes","forks_url":"https://api.github.com/repos/allegro/hermes/forks","keys_url":"https://api.github.com/repos/allegro/hermes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allegro/hermes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allegro/hermes/teams","hooks_url":"https://api.github.com/repos/allegro/hermes/hooks","issue_events_url":"https://api.github.com/repos/allegro/hermes/issues/events{/number}","events_url":"https://api.github.com/repos/allegro/hermes/events","assignees_url":"https://api.github.com/repos/allegro/hermes/assignees{/user}","branches_url":"https://api.github.com/repos/allegro/hermes/branches{/branch}","tags_url":"https://api.github.com/repos/allegro/hermes/tags","blobs_url":"https://api.github.com/repos/allegro/hermes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allegro/hermes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allegro/hermes/git/refs{/sha}","trees_url":"https://api.github.com/repos/allegro/hermes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allegro/hermes/statuses/{sha}","languages_url":"https://api.github.com/repos/allegro/hermes/languages","stargazers_url":"https://api.github.com/repos/allegro/hermes/stargazers","contributors_url":"https://api.github.com/repos/allegro/hermes/contributors","subscribers_url":"https://api.github.com/repos/allegro/hermes/subscribers","subscription_url":"https://api.github.com/repos/allegro/hermes/subscription","commits_url":"https://api.github.com/repos/allegro/hermes/commits{/sha}","git_commits_url":"https://api.github.com/repos/allegro/hermes/git/commits{/sha}","comments_url":"https://api.github.com/repos/allegro/hermes/comments{/number}","issue_comment_url":"https://api.github.com/repos/allegro/hermes/issues/comments{/number}","contents_url":"https://api.github.com/repos/allegro/hermes/contents/{+path}","compare_url":"https://api.github.com/repos/allegro/hermes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allegro/hermes/merges","archive_url":"https://api.github.com/repos/allegro/hermes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allegro/hermes/downloads","issues_url":"https://api.github.com/repos/allegro/hermes/issues{/number}","pulls_url":"https://api.github.com/repos/allegro/hermes/pulls{/number}","milestones_url":"https://api.github.com/repos/allegro/hermes/milestones{/number}","notifications_url":"https://api.github.com/repos/allegro/hermes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allegro/hermes/labels{/name}","releases_url":"https://api.github.com/repos/allegro/hermes/releases{/id}","deployments_url":"https://api.github.com/repos/allegro/hermes/deployments","created_at":"2015-05-15T08:11:16Z","updated_at":"2018-08-28T07:12:40Z","pushed_at":"2018-08-29T07:27:11Z","git_url":"git://github.com/allegro/hermes.git","ssh_url":"git@github.com:allegro/hermes.git","clone_url":"https://github.com/allegro/hermes.git","svn_url":"https://github.com/allegro/hermes","homepage":"http://hermes.allegro.tech","size":6264,"stargazers_count":369,"watchers_count":369,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":84,"mirror_url":null,"archived":false,"open_issues_count":77,"license":null,"forks":84,"open_issues":77,"watchers":369,"default_branch":"master"}},"base":{"label":"allegro:master","ref":"master","sha":"aa7dec45ffcfaf133aa85916150ee519078ceaa7","user":{"login":"allegro","id":562236,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2MjIzNg==","avatar_url":"https://avatars3.githubusercontent.com/u/562236?v=4","gravatar_id":"","url":"https://api.github.com/users/allegro","html_url":"https://github.com/allegro","followers_url":"https://api.github.com/users/allegro/followers","following_url":"https://api.github.com/users/allegro/following{/other_user}","gists_url":"https://api.github.com/users/allegro/gists{/gist_id}","starred_url":"https://api.github.com/users/allegro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allegro/subscriptions","organizations_url":"https://api.github.com/users/allegro/orgs","repos_url":"https://api.github.com/users/allegro/repos","events_url":"https://api.github.com/users/allegro/events{/privacy}","received_events_url":"https://api.github.com/users/allegro/received_events","type":"Organization","site_admin":false},"repo":{"id":35662043,"node_id":"MDEwOlJlcG9zaXRvcnkzNTY2MjA0Mw==","name":"hermes","full_name":"allegro/hermes","owner":{"login":"allegro","id":562236,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2MjIzNg==","avatar_url":"https://avatars3.githubusercontent.com/u/562236?v=4","gravatar_id":"","url":"https://api.github.com/users/allegro","html_url":"https://github.com/allegro","followers_url":"https://api.github.com/users/allegro/followers","following_url":"https://api.github.com/users/allegro/following{/other_user}","gists_url":"https://api.github.com/users/allegro/gists{/gist_id}","starred_url":"https://api.github.com/users/allegro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allegro/subscriptions","organizations_url":"https://api.github.com/users/allegro/orgs","repos_url":"https://api.github.com/users/allegro/repos","events_url":"https://api.github.com/users/allegro/events{/privacy}","received_events_url":"https://api.github.com/users/allegro/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/allegro/hermes","description":"Fast and reliable message broker built on top of Kafka.","fork":false,"url":"https://api.github.com/repos/allegro/hermes","forks_url":"https://api.github.com/repos/allegro/hermes/forks","keys_url":"https://api.github.com/repos/allegro/hermes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allegro/hermes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allegro/hermes/teams","hooks_url":"https://api.github.com/repos/allegro/hermes/hooks","issue_events_url":"https://api.github.com/repos/allegro/hermes/issues/events{/number}","events_url":"https://api.github.com/repos/allegro/hermes/events","assignees_url":"https://api.github.com/repos/allegro/hermes/assignees{/user}","branches_url":"https://api.github.com/repos/allegro/hermes/branches{/branch}","tags_url":"https://api.github.com/repos/allegro/hermes/tags","blobs_url":"https://api.github.com/repos/allegro/hermes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allegro/hermes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allegro/hermes/git/refs{/sha}","trees_url":"https://api.github.com/repos/allegro/hermes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allegro/hermes/statuses/{sha}","languages_url":"https://api.github.com/repos/allegro/hermes/languages","stargazers_url":"https://api.github.com/repos/allegro/hermes/stargazers","contributors_url":"https://api.github.com/repos/allegro/hermes/contributors","subscribers_url":"https://api.github.com/repos/allegro/hermes/subscribers","subscription_url":"https://api.github.com/repos/allegro/hermes/subscription","commits_url":"https://api.github.com/repos/allegro/hermes/commits{/sha}","git_commits_url":"https://api.github.com/repos/allegro/hermes/git/commits{/sha}","comments_url":"https://api.github.com/repos/allegro/hermes/comments{/number}","issue_comment_url":"https://api.github.com/repos/allegro/hermes/issues/comments{/number}","contents_url":"https://api.github.com/repos/allegro/hermes/contents/{+path}","compare_url":"https://api.github.com/repos/allegro/hermes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allegro/hermes/merges","archive_url":"https://api.github.com/repos/allegro/hermes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allegro/hermes/downloads","issues_url":"https://api.github.com/repos/allegro/hermes/issues{/number}","pulls_url":"https://api.github.com/repos/allegro/hermes/pulls{/number}","milestones_url":"https://api.github.com/repos/allegro/hermes/milestones{/number}","notifications_url":"https://api.github.com/repos/allegro/hermes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allegro/hermes/labels{/name}","releases_url":"https://api.github.com/repos/allegro/hermes/releases{/id}","deployments_url":"https://api.github.com/repos/allegro/hermes/deployments","created_at":"2015-05-15T08:11:16Z","updated_at":"2018-08-28T07:12:40Z","pushed_at":"2018-08-29T07:27:11Z","git_url":"git://github.com/allegro/hermes.git","ssh_url":"git@github.com:allegro/hermes.git","clone_url":"https://github.com/allegro/hermes.git","svn_url":"https://github.com/allegro/hermes","homepage":"http://hermes.allegro.tech","size":6264,"stargazers_count":369,"watchers_count":369,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":84,"mirror_url":null,"archived":false,"open_issues_count":77,"license":null,"forks":84,"open_issues":77,"watchers":369,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/allegro/hermes/pulls/900"},"html":{"href":"https://github.com/allegro/hermes/pull/900"},"issue":{"href":"https://api.github.com/repos/allegro/hermes/issues/900"},"comments":{"href":"https://api.github.com/repos/allegro/hermes/issues/900/comments"},"review_comments":{"href":"https://api.github.com/repos/allegro/hermes/pulls/900/comments"},"review_comment":{"href":"https://api.github.com/repos/allegro/hermes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/allegro/hermes/pulls/900/commits"},"statuses":{"href":"https://api.github.com/repos/allegro/hermes/statuses/e9c854a0f9f513b7a5ea342ac3dc3518f5b7fa9a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"pbetkier"}}