{"action":"created","comment":{"url":"https://api.github.com/repos/infobip/jira-version-generator/pulls/comments/24721948","id":24721948,"diff_hunk":"@@ -0,0 +1,80 @@\n+/**\n+ *# Copyright 2014 Infobip\n+ #\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+package com.infobip.stash;\n+\n+import static org.mockito.BDDMockito.given;\n+import static org.mockito.BDDMockito.then;\n+import static org.mockito.Matchers.anyString;\n+import static org.mockito.Matchers.eq;\n+import static org.mockito.Mockito.never;\n+\n+import com.atlassian.stash.repository.Repository;\n+import com.atlassian.stash.setting.Settings;\n+import com.atlassian.stash.setting.SettingsValidationErrors;\n+import org.junit.Test;\n+import org.junit.runner.RunWith;\n+import org.mockito.Mock;\n+import org.mockito.runners.MockitoJUnitRunner;\n+\n+@RunWith(MockitoJUnitRunner.class)\n+public class VersionPatternValidatorTest {\n+\n+    private VersionPatternValidator versionPatternValidator = new VersionPatternValidator();\n+\n+    @Mock\n+    private Settings settings;\n+\n+    @Mock\n+    private SettingsValidationErrors settingsValidationErrors;\n+\n+    @Mock\n+    private Repository repository;\n+\n+    @Test\n+    public void shouldSuccessfullyValidatePatternWithNamedCapturingGroup() {\n+\n+        givenSetting(\"Release (?<version>.*) version.\");\n+\n+        versionPatternValidator.validate(settings, settingsValidationErrors, repository);\n+\n+        then(settingsValidationErrors).should(never()).addFieldError(anyString(), anyString());\n+    }\n+\n+    @Test\n+    public void shouldSuccessfullyValidateEmptyString() {\n+\n+        givenSetting(\"\");\n+\n+        versionPatternValidator.validate(settings, settingsValidationErrors, repository);\n+\n+        then(settingsValidationErrors).should(never()).addFieldError(anyString(), anyString());\n+    }\n+\n+    @Test\n+    public void shouldFailToValidatePatternWithNamedCapturingGroup() {\n+\n+        givenSetting(\"(.*)\");\n+\n+        versionPatternValidator.validate(settings, settingsValidationErrors, repository);","path":"src/test/java/com/infobip/stash/VersionPatternValidatorTest.java","position":null,"original_position":71,"commit_id":"2e8caddc5d2f2bb4d60f28230e3d5239ed3988df","original_commit_id":"c8c63aa9d360c7fc52457460a41e180bb824a111","user":{"login":"lpandzic","id":4463380,"avatar_url":"https://avatars.githubusercontent.com/u/4463380?v=3","gravatar_id":"","url":"https://api.github.com/users/lpandzic","html_url":"https://github.com/lpandzic","followers_url":"https://api.github.com/users/lpandzic/followers","following_url":"https://api.github.com/users/lpandzic/following{/other_user}","gists_url":"https://api.github.com/users/lpandzic/gists{/gist_id}","starred_url":"https://api.github.com/users/lpandzic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpandzic/subscriptions","organizations_url":"https://api.github.com/users/lpandzic/orgs","repos_url":"https://api.github.com/users/lpandzic/repos","events_url":"https://api.github.com/users/lpandzic/events{/privacy}","received_events_url":"https://api.github.com/users/lpandzic/received_events","type":"User","site_admin":false},"body":"fixed","created_at":"2015-02-15T12:24:35Z","updated_at":"2015-02-15T12:24:35Z","html_url":"https://github.com/infobip/jira-version-generator/pull/4#discussion_r24721948","pull_request_url":"https://api.github.com/repos/infobip/jira-version-generator/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/infobip/jira-version-generator/pulls/comments/24721948"},"html":{"href":"https://github.com/infobip/jira-version-generator/pull/4#discussion_r24721948"},"pull_request":{"href":"https://api.github.com/repos/infobip/jira-version-generator/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/infobip/jira-version-generator/pulls/4","id":28818703,"html_url":"https://github.com/infobip/jira-version-generator/pull/4","diff_url":"https://github.com/infobip/jira-version-generator/pull/4.diff","patch_url":"https://github.com/infobip/jira-version-generator/pull/4.patch","issue_url":"https://api.github.com/repos/infobip/jira-version-generator/issues/4","number":4,"state":"open","locked":false,"title":"Issue #2 version commit pattern","user":{"login":"lpandzic","id":4463380,"avatar_url":"https://avatars.githubusercontent.com/u/4463380?v=3","gravatar_id":"","url":"https://api.github.com/users/lpandzic","html_url":"https://github.com/lpandzic","followers_url":"https://api.github.com/users/lpandzic/followers","following_url":"https://api.github.com/users/lpandzic/following{/other_user}","gists_url":"https://api.github.com/users/lpandzic/gists{/gist_id}","starred_url":"https://api.github.com/users/lpandzic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpandzic/subscriptions","organizations_url":"https://api.github.com/users/lpandzic/orgs","repos_url":"https://api.github.com/users/lpandzic/repos","events_url":"https://api.github.com/users/lpandzic/events{/privacy}","received_events_url":"https://api.github.com/users/lpandzic/received_events","type":"User","site_admin":false},"body":"Oj @mbjelac @anhula, bacite oko.","created_at":"2015-02-06T15:55:16Z","updated_at":"2015-02-15T12:24:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9769fc3e71e61769c1d3f87b824f12b4baaabd3a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/infobip/jira-version-generator/pulls/4/commits","review_comments_url":"https://api.github.com/repos/infobip/jira-version-generator/pulls/4/comments","review_comment_url":"https://api.github.com/repos/infobip/jira-version-generator/pulls/comments/{number}","comments_url":"https://api.github.com/repos/infobip/jira-version-generator/issues/4/comments","statuses_url":"https://api.github.com/repos/infobip/jira-version-generator/statuses/2e8caddc5d2f2bb4d60f28230e3d5239ed3988df","head":{"label":"infobip:issue-#2-version-commit-pattern","ref":"issue-#2-version-commit-pattern","sha":"2e8caddc5d2f2bb4d60f28230e3d5239ed3988df","user":{"login":"infobip","id":1288491,"avatar_url":"https://avatars.githubusercontent.com/u/1288491?v=3","gravatar_id":"","url":"https://api.github.com/users/infobip","html_url":"https://github.com/infobip","followers_url":"https://api.github.com/users/infobip/followers","following_url":"https://api.github.com/users/infobip/following{/other_user}","gists_url":"https://api.github.com/users/infobip/gists{/gist_id}","starred_url":"https://api.github.com/users/infobip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infobip/subscriptions","organizations_url":"https://api.github.com/users/infobip/orgs","repos_url":"https://api.github.com/users/infobip/repos","events_url":"https://api.github.com/users/infobip/events{/privacy}","received_events_url":"https://api.github.com/users/infobip/received_events","type":"Organization","site_admin":false},"repo":{"id":28955545,"name":"jira-version-generator","full_name":"infobip/jira-version-generator","owner":{"login":"infobip","id":1288491,"avatar_url":"https://avatars.githubusercontent.com/u/1288491?v=3","gravatar_id":"","url":"https://api.github.com/users/infobip","html_url":"https://github.com/infobip","followers_url":"https://api.github.com/users/infobip/followers","following_url":"https://api.github.com/users/infobip/following{/other_user}","gists_url":"https://api.github.com/users/infobip/gists{/gist_id}","starred_url":"https://api.github.com/users/infobip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infobip/subscriptions","organizations_url":"https://api.github.com/users/infobip/orgs","repos_url":"https://api.github.com/users/infobip/repos","events_url":"https://api.github.com/users/infobip/events{/privacy}","received_events_url":"https://api.github.com/users/infobip/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/infobip/jira-version-generator","description":"","fork":false,"url":"https://api.github.com/repos/infobip/jira-version-generator","forks_url":"https://api.github.com/repos/infobip/jira-version-generator/forks","keys_url":"https://api.github.com/repos/infobip/jira-version-generator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/infobip/jira-version-generator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/infobip/jira-version-generator/teams","hooks_url":"https://api.github.com/repos/infobip/jira-version-generator/hooks","issue_events_url":"https://api.github.com/repos/infobip/jira-version-generator/issues/events{/number}","events_url":"https://api.github.com/repos/infobip/jira-version-generator/events","assignees_url":"https://api.github.com/repos/infobip/jira-version-generator/assignees{/user}","branches_url":"https://api.github.com/repos/infobip/jira-version-generator/branches{/branch}","tags_url":"https://api.github.com/repos/infobip/jira-version-generator/tags","blobs_url":"https://api.github.com/repos/infobip/jira-version-generator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/infobip/jira-version-generator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/infobip/jira-version-generator/git/refs{/sha}","trees_url":"https://api.github.com/repos/infobip/jira-version-generator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/infobip/jira-version-generator/statuses/{sha}","languages_url":"https://api.github.com/repos/infobip/jira-version-generator/languages","stargazers_url":"https://api.github.com/repos/infobip/jira-version-generator/stargazers","contributors_url":"https://api.github.com/repos/infobip/jira-version-generator/contributors","subscribers_url":"https://api.github.com/repos/infobip/jira-version-generator/subscribers","subscription_url":"https://api.github.com/repos/infobip/jira-version-generator/subscription","commits_url":"https://api.github.com/repos/infobip/jira-version-generator/commits{/sha}","git_commits_url":"https://api.github.com/repos/infobip/jira-version-generator/git/commits{/sha}","comments_url":"https://api.github.com/repos/infobip/jira-version-generator/comments{/number}","issue_comment_url":"https://api.github.com/repos/infobip/jira-version-generator/issues/comments/{number}","contents_url":"https://api.github.com/repos/infobip/jira-version-generator/contents/{+path}","compare_url":"https://api.github.com/repos/infobip/jira-version-generator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/infobip/jira-version-generator/merges","archive_url":"https://api.github.com/repos/infobip/jira-version-generator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/infobip/jira-version-generator/downloads","issues_url":"https://api.github.com/repos/infobip/jira-version-generator/issues{/number}","pulls_url":"https://api.github.com/repos/infobip/jira-version-generator/pulls{/number}","milestones_url":"https://api.github.com/repos/infobip/jira-version-generator/milestones{/number}","notifications_url":"https://api.github.com/repos/infobip/jira-version-generator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/infobip/jira-version-generator/labels{/name}","releases_url":"https://api.github.com/repos/infobip/jira-version-generator/releases{/id}","created_at":"2015-01-08T08:03:33Z","updated_at":"2015-01-28T08:21:51Z","pushed_at":"2015-02-15T12:23:48Z","git_url":"git://github.com/infobip/jira-version-generator.git","ssh_url":"git@github.com:infobip/jira-version-generator.git","clone_url":"https://github.com/infobip/jira-version-generator.git","svn_url":"https://github.com/infobip/jira-version-generator","homepage":null,"size":764,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":8,"default_branch":"master"}},"base":{"label":"infobip:master","ref":"master","sha":"fe8f15c7197a8943aacf1ad0cc50dd7c3e4e743c","user":{"login":"infobip","id":1288491,"avatar_url":"https://avatars.githubusercontent.com/u/1288491?v=3","gravatar_id":"","url":"https://api.github.com/users/infobip","html_url":"https://github.com/infobip","followers_url":"https://api.github.com/users/infobip/followers","following_url":"https://api.github.com/users/infobip/following{/other_user}","gists_url":"https://api.github.com/users/infobip/gists{/gist_id}","starred_url":"https://api.github.com/users/infobip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infobip/subscriptions","organizations_url":"https://api.github.com/users/infobip/orgs","repos_url":"https://api.github.com/users/infobip/repos","events_url":"https://api.github.com/users/infobip/events{/privacy}","received_events_url":"https://api.github.com/users/infobip/received_events","type":"Organization","site_admin":false},"repo":{"id":28955545,"name":"jira-version-generator","full_name":"infobip/jira-version-generator","owner":{"login":"infobip","id":1288491,"avatar_url":"https://avatars.githubusercontent.com/u/1288491?v=3","gravatar_id":"","url":"https://api.github.com/users/infobip","html_url":"https://github.com/infobip","followers_url":"https://api.github.com/users/infobip/followers","following_url":"https://api.github.com/users/infobip/following{/other_user}","gists_url":"https://api.github.com/users/infobip/gists{/gist_id}","starred_url":"https://api.github.com/users/infobip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infobip/subscriptions","organizations_url":"https://api.github.com/users/infobip/orgs","repos_url":"https://api.github.com/users/infobip/repos","events_url":"https://api.github.com/users/infobip/events{/privacy}","received_events_url":"https://api.github.com/users/infobip/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/infobip/jira-version-generator","description":"","fork":false,"url":"https://api.github.com/repos/infobip/jira-version-generator","forks_url":"https://api.github.com/repos/infobip/jira-version-generator/forks","keys_url":"https://api.github.com/repos/infobip/jira-version-generator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/infobip/jira-version-generator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/infobip/jira-version-generator/teams","hooks_url":"https://api.github.com/repos/infobip/jira-version-generator/hooks","issue_events_url":"https://api.github.com/repos/infobip/jira-version-generator/issues/events{/number}","events_url":"https://api.github.com/repos/infobip/jira-version-generator/events","assignees_url":"https://api.github.com/repos/infobip/jira-version-generator/assignees{/user}","branches_url":"https://api.github.com/repos/infobip/jira-version-generator/branches{/branch}","tags_url":"https://api.github.com/repos/infobip/jira-version-generator/tags","blobs_url":"https://api.github.com/repos/infobip/jira-version-generator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/infobip/jira-version-generator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/infobip/jira-version-generator/git/refs{/sha}","trees_url":"https://api.github.com/repos/infobip/jira-version-generator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/infobip/jira-version-generator/statuses/{sha}","languages_url":"https://api.github.com/repos/infobip/jira-version-generator/languages","stargazers_url":"https://api.github.com/repos/infobip/jira-version-generator/stargazers","contributors_url":"https://api.github.com/repos/infobip/jira-version-generator/contributors","subscribers_url":"https://api.github.com/repos/infobip/jira-version-generator/subscribers","subscription_url":"https://api.github.com/repos/infobip/jira-version-generator/subscription","commits_url":"https://api.github.com/repos/infobip/jira-version-generator/commits{/sha}","git_commits_url":"https://api.github.com/repos/infobip/jira-version-generator/git/commits{/sha}","comments_url":"https://api.github.com/repos/infobip/jira-version-generator/comments{/number}","issue_comment_url":"https://api.github.com/repos/infobip/jira-version-generator/issues/comments/{number}","contents_url":"https://api.github.com/repos/infobip/jira-version-generator/contents/{+path}","compare_url":"https://api.github.com/repos/infobip/jira-version-generator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/infobip/jira-version-generator/merges","archive_url":"https://api.github.com/repos/infobip/jira-version-generator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/infobip/jira-version-generator/downloads","issues_url":"https://api.github.com/repos/infobip/jira-version-generator/issues{/number}","pulls_url":"https://api.github.com/repos/infobip/jira-version-generator/pulls{/number}","milestones_url":"https://api.github.com/repos/infobip/jira-version-generator/milestones{/number}","notifications_url":"https://api.github.com/repos/infobip/jira-version-generator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/infobip/jira-version-generator/labels{/name}","releases_url":"https://api.github.com/repos/infobip/jira-version-generator/releases{/id}","created_at":"2015-01-08T08:03:33Z","updated_at":"2015-01-28T08:21:51Z","pushed_at":"2015-02-15T12:23:48Z","git_url":"git://github.com/infobip/jira-version-generator.git","ssh_url":"git@github.com:infobip/jira-version-generator.git","clone_url":"https://github.com/infobip/jira-version-generator.git","svn_url":"https://github.com/infobip/jira-version-generator","homepage":null,"size":764,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/infobip/jira-version-generator/pulls/4"},"html":{"href":"https://github.com/infobip/jira-version-generator/pull/4"},"issue":{"href":"https://api.github.com/repos/infobip/jira-version-generator/issues/4"},"comments":{"href":"https://api.github.com/repos/infobip/jira-version-generator/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/infobip/jira-version-generator/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/infobip/jira-version-generator/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/infobip/jira-version-generator/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/infobip/jira-version-generator/statuses/2e8caddc5d2f2bb4d60f28230e3d5239ed3988df"}}}}