{"action":"created","comment":{"url":"https://api.github.com/repos/cfpb/hmda-platform/pulls/comments/87836636","pull_request_review_id":8427590,"id":87836636,"diff_hunk":"@@ -0,0 +1,57 @@\n+package hmda.query.projections.institutions\n+\n+import akka.testkit.TestProbe\n+import hmda.model.institution.InstitutionGenerators\n+import hmda.persistence.messages.CommonMessages.GetState\n+import hmda.persistence.messages.events.institutions.InstitutionEvents.{ InstitutionCreated, InstitutionModified }\n+import hmda.persistence.model.ActorSpec\n+import hmda.persistence.processing.HmdaQuery.EventWithSeqNr\n+import hmda.query.projections.institutions.InstitutionView._\n+\n+class InstitutionViewSpec extends ActorSpec {\n+\n+  val i1 = InstitutionGenerators.institutionGen.sample.get\n+  val i2 = InstitutionGenerators.institutionGen.sample.get\n+  val i3 = InstitutionGenerators.institutionGen.sample.get\n+  val i4 = i3.copy(cra = true)\n+\n+  val institutionQuery = createInstitutionQuery(system)\n+\n+  val probe = TestProbe()\n+\n+  override def beforeAll(): Unit = {\n+    super.beforeAll()\n+    institutionQuery ! EventWithSeqNr(1, InstitutionCreated(i1))\n+    institutionQuery ! EventWithSeqNr(2, InstitutionCreated(i2))\n+    institutionQuery ! EventWithSeqNr(3, InstitutionCreated(i3))\n+    institutionQuery ! EventWithSeqNr(4, InstitutionModified(i4))\n+  }\n+\n+  \"Institutions Projection\" must {","path":"query/src/test/scala/hmda/query/projections/institutions/InstitutionViewSpec.scala","position":30,"original_position":30,"commit_id":"bee9dd11f86ca26e7c083e3a58e28ca4d1f08f5b","original_commit_id":"351023c2fefd029e880a26ff2631279306407aa9","user":{"login":"schbetsy","id":4295388,"avatar_url":"https://avatars.githubusercontent.com/u/4295388?v=3","gravatar_id":"","url":"https://api.github.com/users/schbetsy","html_url":"https://github.com/schbetsy","followers_url":"https://api.github.com/users/schbetsy/followers","following_url":"https://api.github.com/users/schbetsy/following{/other_user}","gists_url":"https://api.github.com/users/schbetsy/gists{/gist_id}","starred_url":"https://api.github.com/users/schbetsy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schbetsy/subscriptions","organizations_url":"https://api.github.com/users/schbetsy/orgs","repos_url":"https://api.github.com/users/schbetsy/repos","events_url":"https://api.github.com/users/schbetsy/events{/privacy}","received_events_url":"https://api.github.com/users/schbetsy/received_events","type":"User","site_admin":false},"body":"Not sure what you mean by \"read events that it doesn't have\". Could you clarify?","created_at":"2016-11-14T16:28:25Z","updated_at":"2016-11-14T16:28:25Z","html_url":"https://github.com/cfpb/hmda-platform/pull/659#discussion_r87836636","pull_request_url":"https://api.github.com/repos/cfpb/hmda-platform/pulls/659","_links":{"self":{"href":"https://api.github.com/repos/cfpb/hmda-platform/pulls/comments/87836636"},"html":{"href":"https://github.com/cfpb/hmda-platform/pull/659#discussion_r87836636"},"pull_request":{"href":"https://api.github.com/repos/cfpb/hmda-platform/pulls/659"}}},"pull_request":{"url":"https://api.github.com/repos/cfpb/hmda-platform/pulls/659","id":91980320,"html_url":"https://github.com/cfpb/hmda-platform/pull/659","diff_url":"https://github.com/cfpb/hmda-platform/pull/659.diff","patch_url":"https://github.com/cfpb/hmda-platform/pull/659.patch","issue_url":"https://api.github.com/repos/cfpb/hmda-platform/issues/659","number":659,"state":"open","locked":false,"title":"Query institutions","user":{"login":"jmarin","id":438146,"avatar_url":"https://avatars.githubusercontent.com/u/438146?v=3","gravatar_id":"","url":"https://api.github.com/users/jmarin","html_url":"https://github.com/jmarin","followers_url":"https://api.github.com/users/jmarin/followers","following_url":"https://api.github.com/users/jmarin/following{/other_user}","gists_url":"https://api.github.com/users/jmarin/gists{/gist_id}","starred_url":"https://api.github.com/users/jmarin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmarin/subscriptions","organizations_url":"https://api.github.com/users/jmarin/orgs","repos_url":"https://api.github.com/users/jmarin/repos","events_url":"https://api.github.com/users/jmarin/events{/privacy}","received_events_url":"https://api.github.com/users/jmarin/received_events","type":"User","site_admin":false},"body":"Closes #660\r\n\r\nSome notes:\r\n\r\n* DAO implementation is specific to `Institution`. A generic implementation will be included at a later date when the `query` project is augmented. This will also be properly abstracted with a `Repository` data access model\r\n* `InstitutionView` reads the journal as institution events come in. It stores the state and keeps track of what it has seen (to recover from crashes). It also sends events to `InstitutionDBProjection` and is now responsible for the institutions API endpoints, while `InstitutionPersistence` is responsible for writing (separation of writes from reads). \r\n* `InstitutionDBProjection` is a projection of the institution events in the journal, it stores them in an H2 database. This will be later changed to use Postgres","created_at":"2016-11-02T14:29:27Z","updated_at":"2016-11-14T16:31:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2dcee9410d620c9372de62babfdd9fc3d8a8ce69","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/cfpb/hmda-platform/milestones/20","html_url":"https://github.com/cfpb/hmda-platform/milestones/Sprint%2019","labels_url":"https://api.github.com/repos/cfpb/hmda-platform/milestones/20/labels","id":2133496,"number":20,"title":"Sprint 19","description":"","creator":{"login":"Kibrael","id":8459164,"avatar_url":"https://avatars.githubusercontent.com/u/8459164?v=3","gravatar_id":"","url":"https://api.github.com/users/Kibrael","html_url":"https://github.com/Kibrael","followers_url":"https://api.github.com/users/Kibrael/followers","following_url":"https://api.github.com/users/Kibrael/following{/other_user}","gists_url":"https://api.github.com/users/Kibrael/gists{/gist_id}","starred_url":"https://api.github.com/users/Kibrael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kibrael/subscriptions","organizations_url":"https://api.github.com/users/Kibrael/orgs","repos_url":"https://api.github.com/users/Kibrael/repos","events_url":"https://api.github.com/users/Kibrael/events{/privacy}","received_events_url":"https://api.github.com/users/Kibrael/received_events","type":"User","site_admin":false},"open_issues":21,"closed_issues":0,"state":"open","created_at":"2016-11-14T12:50:12Z","updated_at":"2016-11-14T15:17:13Z","due_on":"2016-11-27T00:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/cfpb/hmda-platform/pulls/659/commits","review_comments_url":"https://api.github.com/repos/cfpb/hmda-platform/pulls/659/comments","review_comment_url":"https://api.github.com/repos/cfpb/hmda-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cfpb/hmda-platform/issues/659/comments","statuses_url":"https://api.github.com/repos/cfpb/hmda-platform/statuses/bee9dd11f86ca26e7c083e3a58e28ca4d1f08f5b","head":{"label":"jmarin:query-institutions","ref":"query-institutions","sha":"bee9dd11f86ca26e7c083e3a58e28ca4d1f08f5b","user":{"login":"jmarin","id":438146,"avatar_url":"https://avatars.githubusercontent.com/u/438146?v=3","gravatar_id":"","url":"https://api.github.com/users/jmarin","html_url":"https://github.com/jmarin","followers_url":"https://api.github.com/users/jmarin/followers","following_url":"https://api.github.com/users/jmarin/following{/other_user}","gists_url":"https://api.github.com/users/jmarin/gists{/gist_id}","starred_url":"https://api.github.com/users/jmarin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmarin/subscriptions","organizations_url":"https://api.github.com/users/jmarin/orgs","repos_url":"https://api.github.com/users/jmarin/repos","events_url":"https://api.github.com/users/jmarin/events{/privacy}","received_events_url":"https://api.github.com/users/jmarin/received_events","type":"User","site_admin":false},"repo":{"id":50183720,"name":"hmda-platform","full_name":"jmarin/hmda-platform","owner":{"login":"jmarin","id":438146,"avatar_url":"https://avatars.githubusercontent.com/u/438146?v=3","gravatar_id":"","url":"https://api.github.com/users/jmarin","html_url":"https://github.com/jmarin","followers_url":"https://api.github.com/users/jmarin/followers","following_url":"https://api.github.com/users/jmarin/following{/other_user}","gists_url":"https://api.github.com/users/jmarin/gists{/gist_id}","starred_url":"https://api.github.com/users/jmarin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmarin/subscriptions","organizations_url":"https://api.github.com/users/jmarin/orgs","repos_url":"https://api.github.com/users/jmarin/repos","events_url":"https://api.github.com/users/jmarin/events{/privacy}","received_events_url":"https://api.github.com/users/jmarin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmarin/hmda-platform","description":null,"fork":true,"url":"https://api.github.com/repos/jmarin/hmda-platform","forks_url":"https://api.github.com/repos/jmarin/hmda-platform/forks","keys_url":"https://api.github.com/repos/jmarin/hmda-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmarin/hmda-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmarin/hmda-platform/teams","hooks_url":"https://api.github.com/repos/jmarin/hmda-platform/hooks","issue_events_url":"https://api.github.com/repos/jmarin/hmda-platform/issues/events{/number}","events_url":"https://api.github.com/repos/jmarin/hmda-platform/events","assignees_url":"https://api.github.com/repos/jmarin/hmda-platform/assignees{/user}","branches_url":"https://api.github.com/repos/jmarin/hmda-platform/branches{/branch}","tags_url":"https://api.github.com/repos/jmarin/hmda-platform/tags","blobs_url":"https://api.github.com/repos/jmarin/hmda-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmarin/hmda-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmarin/hmda-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmarin/hmda-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmarin/hmda-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/jmarin/hmda-platform/languages","stargazers_url":"https://api.github.com/repos/jmarin/hmda-platform/stargazers","contributors_url":"https://api.github.com/repos/jmarin/hmda-platform/contributors","subscribers_url":"https://api.github.com/repos/jmarin/hmda-platform/subscribers","subscription_url":"https://api.github.com/repos/jmarin/hmda-platform/subscription","commits_url":"https://api.github.com/repos/jmarin/hmda-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmarin/hmda-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmarin/hmda-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmarin/hmda-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmarin/hmda-platform/contents/{+path}","compare_url":"https://api.github.com/repos/jmarin/hmda-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmarin/hmda-platform/merges","archive_url":"https://api.github.com/repos/jmarin/hmda-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmarin/hmda-platform/downloads","issues_url":"https://api.github.com/repos/jmarin/hmda-platform/issues{/number}","pulls_url":"https://api.github.com/repos/jmarin/hmda-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/jmarin/hmda-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/jmarin/hmda-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmarin/hmda-platform/labels{/name}","releases_url":"https://api.github.com/repos/jmarin/hmda-platform/releases{/id}","deployments_url":"https://api.github.com/repos/jmarin/hmda-platform/deployments","created_at":"2016-01-22T13:44:02Z","updated_at":"2016-03-04T22:36:21Z","pushed_at":"2016-11-14T15:11:35Z","git_url":"git://github.com/jmarin/hmda-platform.git","ssh_url":"git@github.com:jmarin/hmda-platform.git","clone_url":"https://github.com/jmarin/hmda-platform.git","svn_url":"https://github.com/jmarin/hmda-platform","homepage":"https://github.com/cfpb","size":12164,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"cfpb:master","ref":"master","sha":"e93ff256b57fe25507384595dd3ba05e878cbf38","user":{"login":"cfpb","id":1071563,"avatar_url":"https://avatars.githubusercontent.com/u/1071563?v=3","gravatar_id":"","url":"https://api.github.com/users/cfpb","html_url":"https://github.com/cfpb","followers_url":"https://api.github.com/users/cfpb/followers","following_url":"https://api.github.com/users/cfpb/following{/other_user}","gists_url":"https://api.github.com/users/cfpb/gists{/gist_id}","starred_url":"https://api.github.com/users/cfpb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfpb/subscriptions","organizations_url":"https://api.github.com/users/cfpb/orgs","repos_url":"https://api.github.com/users/cfpb/repos","events_url":"https://api.github.com/users/cfpb/events{/privacy}","received_events_url":"https://api.github.com/users/cfpb/received_events","type":"Organization","site_admin":false},"repo":{"id":50141662,"name":"hmda-platform","full_name":"cfpb/hmda-platform","owner":{"login":"cfpb","id":1071563,"avatar_url":"https://avatars.githubusercontent.com/u/1071563?v=3","gravatar_id":"","url":"https://api.github.com/users/cfpb","html_url":"https://github.com/cfpb","followers_url":"https://api.github.com/users/cfpb/followers","following_url":"https://api.github.com/users/cfpb/following{/other_user}","gists_url":"https://api.github.com/users/cfpb/gists{/gist_id}","starred_url":"https://api.github.com/users/cfpb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfpb/subscriptions","organizations_url":"https://api.github.com/users/cfpb/orgs","repos_url":"https://api.github.com/users/cfpb/repos","events_url":"https://api.github.com/users/cfpb/events{/privacy}","received_events_url":"https://api.github.com/users/cfpb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cfpb/hmda-platform","description":null,"fork":false,"url":"https://api.github.com/repos/cfpb/hmda-platform","forks_url":"https://api.github.com/repos/cfpb/hmda-platform/forks","keys_url":"https://api.github.com/repos/cfpb/hmda-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cfpb/hmda-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cfpb/hmda-platform/teams","hooks_url":"https://api.github.com/repos/cfpb/hmda-platform/hooks","issue_events_url":"https://api.github.com/repos/cfpb/hmda-platform/issues/events{/number}","events_url":"https://api.github.com/repos/cfpb/hmda-platform/events","assignees_url":"https://api.github.com/repos/cfpb/hmda-platform/assignees{/user}","branches_url":"https://api.github.com/repos/cfpb/hmda-platform/branches{/branch}","tags_url":"https://api.github.com/repos/cfpb/hmda-platform/tags","blobs_url":"https://api.github.com/repos/cfpb/hmda-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cfpb/hmda-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cfpb/hmda-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/cfpb/hmda-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cfpb/hmda-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/cfpb/hmda-platform/languages","stargazers_url":"https://api.github.com/repos/cfpb/hmda-platform/stargazers","contributors_url":"https://api.github.com/repos/cfpb/hmda-platform/contributors","subscribers_url":"https://api.github.com/repos/cfpb/hmda-platform/subscribers","subscription_url":"https://api.github.com/repos/cfpb/hmda-platform/subscription","commits_url":"https://api.github.com/repos/cfpb/hmda-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/cfpb/hmda-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/cfpb/hmda-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/cfpb/hmda-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/cfpb/hmda-platform/contents/{+path}","compare_url":"https://api.github.com/repos/cfpb/hmda-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cfpb/hmda-platform/merges","archive_url":"https://api.github.com/repos/cfpb/hmda-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cfpb/hmda-platform/downloads","issues_url":"https://api.github.com/repos/cfpb/hmda-platform/issues{/number}","pulls_url":"https://api.github.com/repos/cfpb/hmda-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/cfpb/hmda-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/cfpb/hmda-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cfpb/hmda-platform/labels{/name}","releases_url":"https://api.github.com/repos/cfpb/hmda-platform/releases{/id}","deployments_url":"https://api.github.com/repos/cfpb/hmda-platform/deployments","created_at":"2016-01-21T22:39:17Z","updated_at":"2016-11-04T07:39:54Z","pushed_at":"2016-11-14T15:52:17Z","git_url":"git://github.com/cfpb/hmda-platform.git","ssh_url":"git@github.com:cfpb/hmda-platform.git","clone_url":"https://github.com/cfpb/hmda-platform.git","svn_url":"https://github.com/cfpb/hmda-platform","homepage":"","size":13346,"stargazers_count":6,"watchers_count":6,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":95,"forks":12,"open_issues":95,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cfpb/hmda-platform/pulls/659"},"html":{"href":"https://github.com/cfpb/hmda-platform/pull/659"},"issue":{"href":"https://api.github.com/repos/cfpb/hmda-platform/issues/659"},"comments":{"href":"https://api.github.com/repos/cfpb/hmda-platform/issues/659/comments"},"review_comments":{"href":"https://api.github.com/repos/cfpb/hmda-platform/pulls/659/comments"},"review_comment":{"href":"https://api.github.com/repos/cfpb/hmda-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cfpb/hmda-platform/pulls/659/commits"},"statuses":{"href":"https://api.github.com/repos/cfpb/hmda-platform/statuses/bee9dd11f86ca26e7c083e3a58e28ca4d1f08f5b"}}}}
{"actor":{"display_login":"schbetsy"}}