{"action":"created","comment":{"url":"https://api.github.com/repos/zalando/beard/pulls/comments/56513531","id":56513531,"diff_hunk":"@@ -0,0 +1,113 @@\n+package de.zalando.beard.filter\n+\n+import org.scalatest.FunSpec\n+import org.slf4j.LoggerFactory\n+import org.scalatest._\n+import Matchers._\n+\n+/**\n+  * @author boopathi\n+  */\n+class FilterManagerSpec extends FunSpec with Matchers {\n+\n+  import FilterManager._\n+\n+  val logger = LoggerFactory.getLogger(this.getClass())\n+\n+  describe (\"FilterManager suite\") {\n+\n+    describe (\"Registry\") {\n+\n+      it (\"should get the Filter\") {\n+        rDummy.get(\"dummy\") should be (Some(DummyFilter))\n+      }\n+\n+      it (\"should add new filter\") {\n+        rDummy.add(DummyFilter2).get(\"dummy2\") should be (Some(DummyFilter2))\n+        rDummy.get(\"dummy2\") should be (None)\n+      }\n+\n+    }\n+\n+    describe (\"register & registerOverwrite\") {\n+\n+      it (\"should register new Filter into the passed registry and return a Monad\") {\n+\n+        val m = for {\n+          _ <- register(DummyFilter)\n+          _ <- register(DummyFilter2)\n+        } yield ()\n+\n+        val state = m.exec(r)\n+        state.get(\"dummy\") should be (Some(DummyFilter))\n+        state.get(\"dummy2\") should be (Some(DummyFilter2))\n+\n+      }\n+\n+      it (\"should throw when adding a new Filter with name which already exists in the registry\") {\n+\n+        val m = for {\n+          _ <- register(DummyFilter)\n+          _ <- register(DummyFilterClone)\n+        } yield ()\n+\n+        intercept[FilterExists] {\n+          m.run(r)\n+        }\n+\n+      }\n+\n+      it (\"should overwrite when register overwrite is called\") {\n+\n+        val m = for {\n+          _ <- register(DummyFilter)\n+          _ <- registerOverwrite(DummyFilterClone)\n+        } yield ()\n+\n+        m.exec(r).get(\"dummy\") should be (Some(DummyFilterClone))\n+\n+      }\n+\n+    }\n+\n+    describe (\"DefaultFilterRegistry\") {\n+\n+      it (\"should contain a filters monad\") {\n+        DefaultFilterRegistry.filters shouldBe a [StateRegistry[_]]\n+      }\n+\n+    }\n+\n+  }\n+","path":"src/test/scala/de/zalando/beard/filter/FilterManagerSpec.scala","position":82,"original_position":82,"commit_id":"329b1c35ec3cef8dd73c49285105b957f4055c2c","original_commit_id":"329b1c35ec3cef8dd73c49285105b957f4055c2c","user":{"login":"rweyand","id":1699994,"avatar_url":"https://avatars.githubusercontent.com/u/1699994?v=3","gravatar_id":"","url":"https://api.github.com/users/rweyand","html_url":"https://github.com/rweyand","followers_url":"https://api.github.com/users/rweyand/followers","following_url":"https://api.github.com/users/rweyand/following{/other_user}","gists_url":"https://api.github.com/users/rweyand/gists{/gist_id}","starred_url":"https://api.github.com/users/rweyand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rweyand/subscriptions","organizations_url":"https://api.github.com/users/rweyand/orgs","repos_url":"https://api.github.com/users/rweyand/repos","events_url":"https://api.github.com/users/rweyand/events{/privacy}","received_events_url":"https://api.github.com/users/rweyand/received_events","type":"User","site_admin":false},"body":"I don't know about scala conventions, but shouldn't we stick to private variables being put at the beginning? but as said, i have no clue what is the \"scala\" way\r\n","created_at":"2016-03-17T14:34:58Z","updated_at":"2016-03-17T14:34:58Z","html_url":"https://github.com/zalando/beard/pull/43#discussion_r56513531","pull_request_url":"https://api.github.com/repos/zalando/beard/pulls/43","_links":{"self":{"href":"https://api.github.com/repos/zalando/beard/pulls/comments/56513531"},"html":{"href":"https://github.com/zalando/beard/pull/43#discussion_r56513531"},"pull_request":{"href":"https://api.github.com/repos/zalando/beard/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/zalando/beard/pulls/43","id":62933068,"html_url":"https://github.com/zalando/beard/pull/43","diff_url":"https://github.com/zalando/beard/pull/43.diff","patch_url":"https://github.com/zalando/beard/pull/43.patch","issue_url":"https://api.github.com/repos/zalando/beard/issues/43","number":43,"state":"open","locked":false,"title":"Simple Functional Plugin system using State Monads","user":{"login":"boopathi","id":294474,"avatar_url":"https://avatars.githubusercontent.com/u/294474?v=3","gravatar_id":"","url":"https://api.github.com/users/boopathi","html_url":"https://github.com/boopathi","followers_url":"https://api.github.com/users/boopathi/followers","following_url":"https://api.github.com/users/boopathi/following{/other_user}","gists_url":"https://api.github.com/users/boopathi/gists{/gist_id}","starred_url":"https://api.github.com/users/boopathi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boopathi/subscriptions","organizations_url":"https://api.github.com/users/boopathi/orgs","repos_url":"https://api.github.com/users/boopathi/repos","events_url":"https://api.github.com/users/boopathi/events{/privacy}","received_events_url":"https://api.github.com/users/boopathi/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-15T16:15:31Z","updated_at":"2016-03-17T14:34:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eaef97e20a9757c68de7226e0c82fbcedc55c744","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zalando/beard/pulls/43/commits","review_comments_url":"https://api.github.com/repos/zalando/beard/pulls/43/comments","review_comment_url":"https://api.github.com/repos/zalando/beard/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zalando/beard/issues/43/comments","statuses_url":"https://api.github.com/repos/zalando/beard/statuses/329b1c35ec3cef8dd73c49285105b957f4055c2c","head":{"label":"boopathi:filter-monads","ref":"filter-monads","sha":"329b1c35ec3cef8dd73c49285105b957f4055c2c","user":{"login":"boopathi","id":294474,"avatar_url":"https://avatars.githubusercontent.com/u/294474?v=3","gravatar_id":"","url":"https://api.github.com/users/boopathi","html_url":"https://github.com/boopathi","followers_url":"https://api.github.com/users/boopathi/followers","following_url":"https://api.github.com/users/boopathi/following{/other_user}","gists_url":"https://api.github.com/users/boopathi/gists{/gist_id}","starred_url":"https://api.github.com/users/boopathi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boopathi/subscriptions","organizations_url":"https://api.github.com/users/boopathi/orgs","repos_url":"https://api.github.com/users/boopathi/repos","events_url":"https://api.github.com/users/boopathi/events{/privacy}","received_events_url":"https://api.github.com/users/boopathi/received_events","type":"User","site_admin":false},"repo":{"id":53411509,"name":"beard","full_name":"boopathi/beard","owner":{"login":"boopathi","id":294474,"avatar_url":"https://avatars.githubusercontent.com/u/294474?v=3","gravatar_id":"","url":"https://api.github.com/users/boopathi","html_url":"https://github.com/boopathi","followers_url":"https://api.github.com/users/boopathi/followers","following_url":"https://api.github.com/users/boopathi/following{/other_user}","gists_url":"https://api.github.com/users/boopathi/gists{/gist_id}","starred_url":"https://api.github.com/users/boopathi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boopathi/subscriptions","organizations_url":"https://api.github.com/users/boopathi/orgs","repos_url":"https://api.github.com/users/boopathi/repos","events_url":"https://api.github.com/users/boopathi/events{/privacy}","received_events_url":"https://api.github.com/users/boopathi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/boopathi/beard","description":"Lightweight logicless templating engine, inspired by Mustache","fork":true,"url":"https://api.github.com/repos/boopathi/beard","forks_url":"https://api.github.com/repos/boopathi/beard/forks","keys_url":"https://api.github.com/repos/boopathi/beard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/boopathi/beard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/boopathi/beard/teams","hooks_url":"https://api.github.com/repos/boopathi/beard/hooks","issue_events_url":"https://api.github.com/repos/boopathi/beard/issues/events{/number}","events_url":"https://api.github.com/repos/boopathi/beard/events","assignees_url":"https://api.github.com/repos/boopathi/beard/assignees{/user}","branches_url":"https://api.github.com/repos/boopathi/beard/branches{/branch}","tags_url":"https://api.github.com/repos/boopathi/beard/tags","blobs_url":"https://api.github.com/repos/boopathi/beard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/boopathi/beard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/boopathi/beard/git/refs{/sha}","trees_url":"https://api.github.com/repos/boopathi/beard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/boopathi/beard/statuses/{sha}","languages_url":"https://api.github.com/repos/boopathi/beard/languages","stargazers_url":"https://api.github.com/repos/boopathi/beard/stargazers","contributors_url":"https://api.github.com/repos/boopathi/beard/contributors","subscribers_url":"https://api.github.com/repos/boopathi/beard/subscribers","subscription_url":"https://api.github.com/repos/boopathi/beard/subscription","commits_url":"https://api.github.com/repos/boopathi/beard/commits{/sha}","git_commits_url":"https://api.github.com/repos/boopathi/beard/git/commits{/sha}","comments_url":"https://api.github.com/repos/boopathi/beard/comments{/number}","issue_comment_url":"https://api.github.com/repos/boopathi/beard/issues/comments{/number}","contents_url":"https://api.github.com/repos/boopathi/beard/contents/{+path}","compare_url":"https://api.github.com/repos/boopathi/beard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/boopathi/beard/merges","archive_url":"https://api.github.com/repos/boopathi/beard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/boopathi/beard/downloads","issues_url":"https://api.github.com/repos/boopathi/beard/issues{/number}","pulls_url":"https://api.github.com/repos/boopathi/beard/pulls{/number}","milestones_url":"https://api.github.com/repos/boopathi/beard/milestones{/number}","notifications_url":"https://api.github.com/repos/boopathi/beard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/boopathi/beard/labels{/name}","releases_url":"https://api.github.com/repos/boopathi/beard/releases{/id}","deployments_url":"https://api.github.com/repos/boopathi/beard/deployments","created_at":"2016-03-08T12:49:01Z","updated_at":"2016-03-08T12:49:01Z","pushed_at":"2016-03-16T10:36:22Z","git_url":"git://github.com/boopathi/beard.git","ssh_url":"git@github.com:boopathi/beard.git","clone_url":"https://github.com/boopathi/beard.git","svn_url":"https://github.com/boopathi/beard","homepage":null,"size":319,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"zalando:filters","ref":"filters","sha":"9561ce77db47c21a6ca5477d0fab108d993d149f","user":{"login":"zalando","id":1564818,"avatar_url":"https://avatars.githubusercontent.com/u/1564818?v=3","gravatar_id":"","url":"https://api.github.com/users/zalando","html_url":"https://github.com/zalando","followers_url":"https://api.github.com/users/zalando/followers","following_url":"https://api.github.com/users/zalando/following{/other_user}","gists_url":"https://api.github.com/users/zalando/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando/subscriptions","organizations_url":"https://api.github.com/users/zalando/orgs","repos_url":"https://api.github.com/users/zalando/repos","events_url":"https://api.github.com/users/zalando/events{/privacy}","received_events_url":"https://api.github.com/users/zalando/received_events","type":"Organization","site_admin":false},"repo":{"id":38810504,"name":"beard","full_name":"zalando/beard","owner":{"login":"zalando","id":1564818,"avatar_url":"https://avatars.githubusercontent.com/u/1564818?v=3","gravatar_id":"","url":"https://api.github.com/users/zalando","html_url":"https://github.com/zalando","followers_url":"https://api.github.com/users/zalando/followers","following_url":"https://api.github.com/users/zalando/following{/other_user}","gists_url":"https://api.github.com/users/zalando/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando/subscriptions","organizations_url":"https://api.github.com/users/zalando/orgs","repos_url":"https://api.github.com/users/zalando/repos","events_url":"https://api.github.com/users/zalando/events{/privacy}","received_events_url":"https://api.github.com/users/zalando/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zalando/beard","description":"Lightweight logicless templating engine, inspired by Mustache","fork":false,"url":"https://api.github.com/repos/zalando/beard","forks_url":"https://api.github.com/repos/zalando/beard/forks","keys_url":"https://api.github.com/repos/zalando/beard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zalando/beard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zalando/beard/teams","hooks_url":"https://api.github.com/repos/zalando/beard/hooks","issue_events_url":"https://api.github.com/repos/zalando/beard/issues/events{/number}","events_url":"https://api.github.com/repos/zalando/beard/events","assignees_url":"https://api.github.com/repos/zalando/beard/assignees{/user}","branches_url":"https://api.github.com/repos/zalando/beard/branches{/branch}","tags_url":"https://api.github.com/repos/zalando/beard/tags","blobs_url":"https://api.github.com/repos/zalando/beard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zalando/beard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zalando/beard/git/refs{/sha}","trees_url":"https://api.github.com/repos/zalando/beard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zalando/beard/statuses/{sha}","languages_url":"https://api.github.com/repos/zalando/beard/languages","stargazers_url":"https://api.github.com/repos/zalando/beard/stargazers","contributors_url":"https://api.github.com/repos/zalando/beard/contributors","subscribers_url":"https://api.github.com/repos/zalando/beard/subscribers","subscription_url":"https://api.github.com/repos/zalando/beard/subscription","commits_url":"https://api.github.com/repos/zalando/beard/commits{/sha}","git_commits_url":"https://api.github.com/repos/zalando/beard/git/commits{/sha}","comments_url":"https://api.github.com/repos/zalando/beard/comments{/number}","issue_comment_url":"https://api.github.com/repos/zalando/beard/issues/comments{/number}","contents_url":"https://api.github.com/repos/zalando/beard/contents/{+path}","compare_url":"https://api.github.com/repos/zalando/beard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zalando/beard/merges","archive_url":"https://api.github.com/repos/zalando/beard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zalando/beard/downloads","issues_url":"https://api.github.com/repos/zalando/beard/issues{/number}","pulls_url":"https://api.github.com/repos/zalando/beard/pulls{/number}","milestones_url":"https://api.github.com/repos/zalando/beard/milestones{/number}","notifications_url":"https://api.github.com/repos/zalando/beard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zalando/beard/labels{/name}","releases_url":"https://api.github.com/repos/zalando/beard/releases{/id}","deployments_url":"https://api.github.com/repos/zalando/beard/deployments","created_at":"2015-07-09T09:11:25Z","updated_at":"2016-03-16T15:17:13Z","pushed_at":"2016-03-16T10:36:23Z","git_url":"git://github.com/zalando/beard.git","ssh_url":"git@github.com:zalando/beard.git","clone_url":"https://github.com/zalando/beard.git","svn_url":"https://github.com/zalando/beard","homepage":null,"size":317,"stargazers_count":15,"watchers_count":15,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":11,"mirror_url":null,"open_issues_count":11,"forks":11,"open_issues":11,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zalando/beard/pulls/43"},"html":{"href":"https://github.com/zalando/beard/pull/43"},"issue":{"href":"https://api.github.com/repos/zalando/beard/issues/43"},"comments":{"href":"https://api.github.com/repos/zalando/beard/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/zalando/beard/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/zalando/beard/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zalando/beard/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/zalando/beard/statuses/329b1c35ec3cef8dd73c49285105b957f4055c2c"}}}}