{"action":"opened","number":15,"pull_request":{"url":"https://api.github.com/repos/chbatey/kafka-unit/pulls/15","id":54474434,"html_url":"https://github.com/chbatey/kafka-unit/pull/15","diff_url":"https://github.com/chbatey/kafka-unit/pull/15.diff","patch_url":"https://github.com/chbatey/kafka-unit/pull/15.patch","issue_url":"https://api.github.com/repos/chbatey/kafka-unit/issues/15","number":15,"state":"open","locked":false,"title":"Alternative constructor parsing connection strings","user":{"login":"regispl","id":869815,"avatar_url":"https://avatars.githubusercontent.com/u/869815?v=3","gravatar_id":"","url":"https://api.github.com/users/regispl","html_url":"https://github.com/regispl","followers_url":"https://api.github.com/users/regispl/followers","following_url":"https://api.github.com/users/regispl/following{/other_user}","gists_url":"https://api.github.com/users/regispl/gists{/gist_id}","starred_url":"https://api.github.com/users/regispl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/regispl/subscriptions","organizations_url":"https://api.github.com/users/regispl/orgs","repos_url":"https://api.github.com/users/regispl/repos","events_url":"https://api.github.com/users/regispl/events{/privacy}","received_events_url":"https://api.github.com/users/regispl/received_events","type":"User","site_admin":false},"body":"As I'm mainly using the `host:port` connection strings in my configs (rather than separating host and port using two variables), like these...\r\n\r\n```\r\n  kafka.bootstrap.servers = \"localhost:9092\"\r\n  zookeeper.servers = \"localhost:2181\"\r\n```\r\n\r\n...I found it useful to add a constructor allowing to pass these connection strings to KafkaUnit and extract the port number there, rather than having to parse them every time on my own. It seems to be a popular pattern for Kafka and Zookeeper (and other HA services like Cassandra etc. where you often point to multiple nodes running a service), I thought you may find it useful too.\r\n\r\nBTW. tests look a bit messy as I'm testing the same thing for two params separately, but that's what exposed in this class at the moment. I found relaxing the access restriction on parseConnectionString method (to protected) a bit \"dirty\" and I think that extracting parser to separate class seems to be a bit of an overkill now, but I'm open for suggestions as I don't have a strong opinion on that ;-)","created_at":"2015-12-23T14:32:50Z","updated_at":"2015-12-23T14:32:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chbatey/kafka-unit/pulls/15/commits","review_comments_url":"https://api.github.com/repos/chbatey/kafka-unit/pulls/15/comments","review_comment_url":"https://api.github.com/repos/chbatey/kafka-unit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chbatey/kafka-unit/issues/15/comments","statuses_url":"https://api.github.com/repos/chbatey/kafka-unit/statuses/b614d1d51c8955539184012efebeb2221ae25d77","head":{"label":"regispl:alternative-constructor","ref":"alternative-constructor","sha":"b614d1d51c8955539184012efebeb2221ae25d77","user":{"login":"regispl","id":869815,"avatar_url":"https://avatars.githubusercontent.com/u/869815?v=3","gravatar_id":"","url":"https://api.github.com/users/regispl","html_url":"https://github.com/regispl","followers_url":"https://api.github.com/users/regispl/followers","following_url":"https://api.github.com/users/regispl/following{/other_user}","gists_url":"https://api.github.com/users/regispl/gists{/gist_id}","starred_url":"https://api.github.com/users/regispl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/regispl/subscriptions","organizations_url":"https://api.github.com/users/regispl/orgs","repos_url":"https://api.github.com/users/regispl/repos","events_url":"https://api.github.com/users/regispl/events{/privacy}","received_events_url":"https://api.github.com/users/regispl/received_events","type":"User","site_admin":false},"repo":{"id":48177032,"name":"kafka-unit","full_name":"regispl/kafka-unit","owner":{"login":"regispl","id":869815,"avatar_url":"https://avatars.githubusercontent.com/u/869815?v=3","gravatar_id":"","url":"https://api.github.com/users/regispl","html_url":"https://github.com/regispl","followers_url":"https://api.github.com/users/regispl/followers","following_url":"https://api.github.com/users/regispl/following{/other_user}","gists_url":"https://api.github.com/users/regispl/gists{/gist_id}","starred_url":"https://api.github.com/users/regispl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/regispl/subscriptions","organizations_url":"https://api.github.com/users/regispl/orgs","repos_url":"https://api.github.com/users/regispl/repos","events_url":"https://api.github.com/users/regispl/events{/privacy}","received_events_url":"https://api.github.com/users/regispl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/regispl/kafka-unit","description":"","fork":true,"url":"https://api.github.com/repos/regispl/kafka-unit","forks_url":"https://api.github.com/repos/regispl/kafka-unit/forks","keys_url":"https://api.github.com/repos/regispl/kafka-unit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/regispl/kafka-unit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/regispl/kafka-unit/teams","hooks_url":"https://api.github.com/repos/regispl/kafka-unit/hooks","issue_events_url":"https://api.github.com/repos/regispl/kafka-unit/issues/events{/number}","events_url":"https://api.github.com/repos/regispl/kafka-unit/events","assignees_url":"https://api.github.com/repos/regispl/kafka-unit/assignees{/user}","branches_url":"https://api.github.com/repos/regispl/kafka-unit/branches{/branch}","tags_url":"https://api.github.com/repos/regispl/kafka-unit/tags","blobs_url":"https://api.github.com/repos/regispl/kafka-unit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/regispl/kafka-unit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/regispl/kafka-unit/git/refs{/sha}","trees_url":"https://api.github.com/repos/regispl/kafka-unit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/regispl/kafka-unit/statuses/{sha}","languages_url":"https://api.github.com/repos/regispl/kafka-unit/languages","stargazers_url":"https://api.github.com/repos/regispl/kafka-unit/stargazers","contributors_url":"https://api.github.com/repos/regispl/kafka-unit/contributors","subscribers_url":"https://api.github.com/repos/regispl/kafka-unit/subscribers","subscription_url":"https://api.github.com/repos/regispl/kafka-unit/subscription","commits_url":"https://api.github.com/repos/regispl/kafka-unit/commits{/sha}","git_commits_url":"https://api.github.com/repos/regispl/kafka-unit/git/commits{/sha}","comments_url":"https://api.github.com/repos/regispl/kafka-unit/comments{/number}","issue_comment_url":"https://api.github.com/repos/regispl/kafka-unit/issues/comments{/number}","contents_url":"https://api.github.com/repos/regispl/kafka-unit/contents/{+path}","compare_url":"https://api.github.com/repos/regispl/kafka-unit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/regispl/kafka-unit/merges","archive_url":"https://api.github.com/repos/regispl/kafka-unit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/regispl/kafka-unit/downloads","issues_url":"https://api.github.com/repos/regispl/kafka-unit/issues{/number}","pulls_url":"https://api.github.com/repos/regispl/kafka-unit/pulls{/number}","milestones_url":"https://api.github.com/repos/regispl/kafka-unit/milestones{/number}","notifications_url":"https://api.github.com/repos/regispl/kafka-unit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/regispl/kafka-unit/labels{/name}","releases_url":"https://api.github.com/repos/regispl/kafka-unit/releases{/id}","created_at":"2015-12-17T13:51:44Z","updated_at":"2015-12-17T13:51:45Z","pushed_at":"2015-12-23T14:29:54Z","git_url":"git://github.com/regispl/kafka-unit.git","ssh_url":"git@github.com:regispl/kafka-unit.git","clone_url":"https://github.com/regispl/kafka-unit.git","svn_url":"https://github.com/regispl/kafka-unit","homepage":null,"size":88,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"chbatey:master","ref":"master","sha":"a1e5aba8876bcf06a8b7617639f16a768c1b48d9","user":{"login":"chbatey","id":1866779,"avatar_url":"https://avatars.githubusercontent.com/u/1866779?v=3","gravatar_id":"","url":"https://api.github.com/users/chbatey","html_url":"https://github.com/chbatey","followers_url":"https://api.github.com/users/chbatey/followers","following_url":"https://api.github.com/users/chbatey/following{/other_user}","gists_url":"https://api.github.com/users/chbatey/gists{/gist_id}","starred_url":"https://api.github.com/users/chbatey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chbatey/subscriptions","organizations_url":"https://api.github.com/users/chbatey/orgs","repos_url":"https://api.github.com/users/chbatey/repos","events_url":"https://api.github.com/users/chbatey/events{/privacy}","received_events_url":"https://api.github.com/users/chbatey/received_events","type":"User","site_admin":false},"repo":{"id":30079086,"name":"kafka-unit","full_name":"chbatey/kafka-unit","owner":{"login":"chbatey","id":1866779,"avatar_url":"https://avatars.githubusercontent.com/u/1866779?v=3","gravatar_id":"","url":"https://api.github.com/users/chbatey","html_url":"https://github.com/chbatey","followers_url":"https://api.github.com/users/chbatey/followers","following_url":"https://api.github.com/users/chbatey/following{/other_user}","gists_url":"https://api.github.com/users/chbatey/gists{/gist_id}","starred_url":"https://api.github.com/users/chbatey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chbatey/subscriptions","organizations_url":"https://api.github.com/users/chbatey/orgs","repos_url":"https://api.github.com/users/chbatey/repos","events_url":"https://api.github.com/users/chbatey/events{/privacy}","received_events_url":"https://api.github.com/users/chbatey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chbatey/kafka-unit","description":"","fork":false,"url":"https://api.github.com/repos/chbatey/kafka-unit","forks_url":"https://api.github.com/repos/chbatey/kafka-unit/forks","keys_url":"https://api.github.com/repos/chbatey/kafka-unit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chbatey/kafka-unit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chbatey/kafka-unit/teams","hooks_url":"https://api.github.com/repos/chbatey/kafka-unit/hooks","issue_events_url":"https://api.github.com/repos/chbatey/kafka-unit/issues/events{/number}","events_url":"https://api.github.com/repos/chbatey/kafka-unit/events","assignees_url":"https://api.github.com/repos/chbatey/kafka-unit/assignees{/user}","branches_url":"https://api.github.com/repos/chbatey/kafka-unit/branches{/branch}","tags_url":"https://api.github.com/repos/chbatey/kafka-unit/tags","blobs_url":"https://api.github.com/repos/chbatey/kafka-unit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chbatey/kafka-unit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chbatey/kafka-unit/git/refs{/sha}","trees_url":"https://api.github.com/repos/chbatey/kafka-unit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chbatey/kafka-unit/statuses/{sha}","languages_url":"https://api.github.com/repos/chbatey/kafka-unit/languages","stargazers_url":"https://api.github.com/repos/chbatey/kafka-unit/stargazers","contributors_url":"https://api.github.com/repos/chbatey/kafka-unit/contributors","subscribers_url":"https://api.github.com/repos/chbatey/kafka-unit/subscribers","subscription_url":"https://api.github.com/repos/chbatey/kafka-unit/subscription","commits_url":"https://api.github.com/repos/chbatey/kafka-unit/commits{/sha}","git_commits_url":"https://api.github.com/repos/chbatey/kafka-unit/git/commits{/sha}","comments_url":"https://api.github.com/repos/chbatey/kafka-unit/comments{/number}","issue_comment_url":"https://api.github.com/repos/chbatey/kafka-unit/issues/comments{/number}","contents_url":"https://api.github.com/repos/chbatey/kafka-unit/contents/{+path}","compare_url":"https://api.github.com/repos/chbatey/kafka-unit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chbatey/kafka-unit/merges","archive_url":"https://api.github.com/repos/chbatey/kafka-unit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chbatey/kafka-unit/downloads","issues_url":"https://api.github.com/repos/chbatey/kafka-unit/issues{/number}","pulls_url":"https://api.github.com/repos/chbatey/kafka-unit/pulls{/number}","milestones_url":"https://api.github.com/repos/chbatey/kafka-unit/milestones{/number}","notifications_url":"https://api.github.com/repos/chbatey/kafka-unit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chbatey/kafka-unit/labels{/name}","releases_url":"https://api.github.com/repos/chbatey/kafka-unit/releases{/id}","created_at":"2015-01-30T15:58:37Z","updated_at":"2015-12-03T17:00:39Z","pushed_at":"2015-12-23T14:32:52Z","git_url":"git://github.com/chbatey/kafka-unit.git","ssh_url":"git@github.com:chbatey/kafka-unit.git","clone_url":"https://github.com/chbatey/kafka-unit.git","svn_url":"https://github.com/chbatey/kafka-unit","homepage":null,"size":83,"stargazers_count":29,"watchers_count":29,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":2,"forks":10,"open_issues":2,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chbatey/kafka-unit/pulls/15"},"html":{"href":"https://github.com/chbatey/kafka-unit/pull/15"},"issue":{"href":"https://api.github.com/repos/chbatey/kafka-unit/issues/15"},"comments":{"href":"https://api.github.com/repos/chbatey/kafka-unit/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/chbatey/kafka-unit/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/chbatey/kafka-unit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chbatey/kafka-unit/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/chbatey/kafka-unit/statuses/b614d1d51c8955539184012efebeb2221ae25d77"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":6,"additions":81,"deletions":1,"changed_files":3}}