{"action":"created","comment":{"url":"https://api.github.com/repos/mediachain/mediachain/pulls/comments/61491532","id":61491532,"diff_hunk":"@@ -0,0 +1,117 @@\n+package io.mediachain.transactor\n+\n+import org.specs2.specification.{AfterAll, BeforeAll}\n+\n+import java.util.function.Consumer\n+import java.util.concurrent.{BlockingQueue, LinkedBlockingQueue, TimeUnit}\n+\n+import io.atomix.copycat.client.CopycatClient\n+import io.atomix.catalyst.transport.Address\n+\n+import Types._\n+import StateMachine._\n+\n+object JournalCommitSpec extends io.mediachain.BaseSpec\n+  with BeforeAll\n+  with AfterAll\n+{\n+\n+  def is =\n+    sequential ^\n+  s2\"\"\"\n+  JournalStateMachine publishes commit events:\n+   - when inserting an entity $insertEntity\n+   - when extending the entity chain $extendEntityChain\n+   - when extending the entity chain further $extendEntityChainFurther\n+   - when inserting an artefact $insertArtefact\n+   - when extending the artefact chain $extendArtefactChain\n+  \"\"\"\n+\n+  def beforeAll() {\n+    JournalCommitSpecContext.setup()\n+  }\n+  \n+  def afterAll() {\n+    JournalCommitSpecContext.shutdown()\n+  }\n+  \n+  def insertEntity = {\n+    val context = JournalCommitSpecContext.context\n+    val res = context.dummy.client.submit(JournalInsert(Entity(Map()))).join()\n+    res.foreach((entry: CanonicalEntry) => {context.ref = entry.ref})","path":"transactor/src/test/scala/io/mediachain/transactor/JournalCommitSpec.scala","position":41,"original_position":41,"commit_id":"aa1fcce4b7138dcb4cdb3f4b9bdc7a5ff8af41d2","original_commit_id":"154b53118a300c1157e42c1f44ca12f12252f36e","user":{"login":"parkan","id":204986,"avatar_url":"https://avatars.githubusercontent.com/u/204986?v=3","gravatar_id":"","url":"https://api.github.com/users/parkan","html_url":"https://github.com/parkan","followers_url":"https://api.github.com/users/parkan/followers","following_url":"https://api.github.com/users/parkan/following{/other_user}","gists_url":"https://api.github.com/users/parkan/gists{/gist_id}","starred_url":"https://api.github.com/users/parkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parkan/subscriptions","organizations_url":"https://api.github.com/users/parkan/orgs","repos_url":"https://api.github.com/users/parkan/repos","events_url":"https://api.github.com/users/parkan/events{/privacy}","received_events_url":"https://api.github.com/users/parkan/received_events","type":"User","site_admin":false},"body":"Ok, I see `res` is an `Xor` and you're setting JournalCommitSpecContext's `ref` to that result and then adding to it in `extendEntityChain` etc. Can we express this w/o side effects, in more of a unit style? I think it's preferable to have each test set up its fixtures and test an action in isolation rather than statefully chaining them in this way. We can also separately have an integration test that runs all of the actions and checks that the final state is sane.","created_at":"2016-04-28T19:50:52Z","updated_at":"2016-04-28T19:50:52Z","html_url":"https://github.com/mediachain/mediachain/pull/34#discussion_r61491532","pull_request_url":"https://api.github.com/repos/mediachain/mediachain/pulls/34","_links":{"self":{"href":"https://api.github.com/repos/mediachain/mediachain/pulls/comments/61491532"},"html":{"href":"https://github.com/mediachain/mediachain/pull/34#discussion_r61491532"},"pull_request":{"href":"https://api.github.com/repos/mediachain/mediachain/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/mediachain/mediachain/pulls/34","id":68205499,"html_url":"https://github.com/mediachain/mediachain/pull/34","diff_url":"https://github.com/mediachain/mediachain/pull/34.diff","patch_url":"https://github.com/mediachain/mediachain/pull/34.patch","issue_url":"https://api.github.com/repos/mediachain/mediachain/issues/34","number":34,"state":"closed","locked":false,"title":"Test scaffolding and spec for JournalStateMachine index","user":{"login":"vyzo","id":36426,"avatar_url":"https://avatars.githubusercontent.com/u/36426?v=3","gravatar_id":"","url":"https://api.github.com/users/vyzo","html_url":"https://github.com/vyzo","followers_url":"https://api.github.com/users/vyzo/followers","following_url":"https://api.github.com/users/vyzo/following{/other_user}","gists_url":"https://api.github.com/users/vyzo/gists{/gist_id}","starred_url":"https://api.github.com/users/vyzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vyzo/subscriptions","organizations_url":"https://api.github.com/users/vyzo/orgs","repos_url":"https://api.github.com/users/vyzo/repos","events_url":"https://api.github.com/users/vyzo/events{/privacy}","received_events_url":"https://api.github.com/users/vyzo/received_events","type":"User","site_admin":false},"body":"Adds test scaffolding and a spec for the index invariants of the JournalStateMachine","created_at":"2016-04-28T11:34:03Z","updated_at":"2016-04-28T19:50:52Z","closed_at":"2016-04-28T17:12:05Z","merged_at":"2016-04-28T17:12:05Z","merge_commit_sha":"2c49008df56c1497d6a412f205cf1819a86a48e2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mediachain/mediachain/pulls/34/commits","review_comments_url":"https://api.github.com/repos/mediachain/mediachain/pulls/34/comments","review_comment_url":"https://api.github.com/repos/mediachain/mediachain/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mediachain/mediachain/issues/34/comments","statuses_url":"https://api.github.com/repos/mediachain/mediachain/statuses/aa1fcce4b7138dcb4cdb3f4b9bdc7a5ff8af41d2","head":{"label":"mediachain:vyzo-transactor-copycat-tests","ref":"vyzo-transactor-copycat-tests","sha":"aa1fcce4b7138dcb4cdb3f4b9bdc7a5ff8af41d2","user":{"login":"mediachain","id":16711838,"avatar_url":"https://avatars.githubusercontent.com/u/16711838?v=3","gravatar_id":"","url":"https://api.github.com/users/mediachain","html_url":"https://github.com/mediachain","followers_url":"https://api.github.com/users/mediachain/followers","following_url":"https://api.github.com/users/mediachain/following{/other_user}","gists_url":"https://api.github.com/users/mediachain/gists{/gist_id}","starred_url":"https://api.github.com/users/mediachain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediachain/subscriptions","organizations_url":"https://api.github.com/users/mediachain/orgs","repos_url":"https://api.github.com/users/mediachain/repos","events_url":"https://api.github.com/users/mediachain/events{/privacy}","received_events_url":"https://api.github.com/users/mediachain/received_events","type":"Organization","site_admin":false},"repo":{"id":49516983,"name":"mediachain","full_name":"mediachain/mediachain","owner":{"login":"mediachain","id":16711838,"avatar_url":"https://avatars.githubusercontent.com/u/16711838?v=3","gravatar_id":"","url":"https://api.github.com/users/mediachain","html_url":"https://github.com/mediachain","followers_url":"https://api.github.com/users/mediachain/followers","following_url":"https://api.github.com/users/mediachain/following{/other_user}","gists_url":"https://api.github.com/users/mediachain/gists{/gist_id}","starred_url":"https://api.github.com/users/mediachain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediachain/subscriptions","organizations_url":"https://api.github.com/users/mediachain/orgs","repos_url":"https://api.github.com/users/mediachain/repos","events_url":"https://api.github.com/users/mediachain/events{/privacy}","received_events_url":"https://api.github.com/users/mediachain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mediachain/mediachain","description":"A distributed metadata protocol","fork":false,"url":"https://api.github.com/repos/mediachain/mediachain","forks_url":"https://api.github.com/repos/mediachain/mediachain/forks","keys_url":"https://api.github.com/repos/mediachain/mediachain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mediachain/mediachain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mediachain/mediachain/teams","hooks_url":"https://api.github.com/repos/mediachain/mediachain/hooks","issue_events_url":"https://api.github.com/repos/mediachain/mediachain/issues/events{/number}","events_url":"https://api.github.com/repos/mediachain/mediachain/events","assignees_url":"https://api.github.com/repos/mediachain/mediachain/assignees{/user}","branches_url":"https://api.github.com/repos/mediachain/mediachain/branches{/branch}","tags_url":"https://api.github.com/repos/mediachain/mediachain/tags","blobs_url":"https://api.github.com/repos/mediachain/mediachain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mediachain/mediachain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mediachain/mediachain/git/refs{/sha}","trees_url":"https://api.github.com/repos/mediachain/mediachain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mediachain/mediachain/statuses/{sha}","languages_url":"https://api.github.com/repos/mediachain/mediachain/languages","stargazers_url":"https://api.github.com/repos/mediachain/mediachain/stargazers","contributors_url":"https://api.github.com/repos/mediachain/mediachain/contributors","subscribers_url":"https://api.github.com/repos/mediachain/mediachain/subscribers","subscription_url":"https://api.github.com/repos/mediachain/mediachain/subscription","commits_url":"https://api.github.com/repos/mediachain/mediachain/commits{/sha}","git_commits_url":"https://api.github.com/repos/mediachain/mediachain/git/commits{/sha}","comments_url":"https://api.github.com/repos/mediachain/mediachain/comments{/number}","issue_comment_url":"https://api.github.com/repos/mediachain/mediachain/issues/comments{/number}","contents_url":"https://api.github.com/repos/mediachain/mediachain/contents/{+path}","compare_url":"https://api.github.com/repos/mediachain/mediachain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mediachain/mediachain/merges","archive_url":"https://api.github.com/repos/mediachain/mediachain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mediachain/mediachain/downloads","issues_url":"https://api.github.com/repos/mediachain/mediachain/issues{/number}","pulls_url":"https://api.github.com/repos/mediachain/mediachain/pulls{/number}","milestones_url":"https://api.github.com/repos/mediachain/mediachain/milestones{/number}","notifications_url":"https://api.github.com/repos/mediachain/mediachain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mediachain/mediachain/labels{/name}","releases_url":"https://api.github.com/repos/mediachain/mediachain/releases{/id}","deployments_url":"https://api.github.com/repos/mediachain/mediachain/deployments","created_at":"2016-01-12T17:29:52Z","updated_at":"2016-04-28T04:58:31Z","pushed_at":"2016-04-28T18:24:32Z","git_url":"git://github.com/mediachain/mediachain.git","ssh_url":"git@github.com:mediachain/mediachain.git","clone_url":"https://github.com/mediachain/mediachain.git","svn_url":"https://github.com/mediachain/mediachain","homepage":"https://medium.com/mine-labs/mediachain-483f49cbe37a","size":381,"stargazers_count":32,"watchers_count":32,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":18,"forks":0,"open_issues":18,"watchers":32,"default_branch":"master"}},"base":{"label":"mediachain:master","ref":"master","sha":"8952399774e80df05aee0fdd64ef025485224c76","user":{"login":"mediachain","id":16711838,"avatar_url":"https://avatars.githubusercontent.com/u/16711838?v=3","gravatar_id":"","url":"https://api.github.com/users/mediachain","html_url":"https://github.com/mediachain","followers_url":"https://api.github.com/users/mediachain/followers","following_url":"https://api.github.com/users/mediachain/following{/other_user}","gists_url":"https://api.github.com/users/mediachain/gists{/gist_id}","starred_url":"https://api.github.com/users/mediachain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediachain/subscriptions","organizations_url":"https://api.github.com/users/mediachain/orgs","repos_url":"https://api.github.com/users/mediachain/repos","events_url":"https://api.github.com/users/mediachain/events{/privacy}","received_events_url":"https://api.github.com/users/mediachain/received_events","type":"Organization","site_admin":false},"repo":{"id":49516983,"name":"mediachain","full_name":"mediachain/mediachain","owner":{"login":"mediachain","id":16711838,"avatar_url":"https://avatars.githubusercontent.com/u/16711838?v=3","gravatar_id":"","url":"https://api.github.com/users/mediachain","html_url":"https://github.com/mediachain","followers_url":"https://api.github.com/users/mediachain/followers","following_url":"https://api.github.com/users/mediachain/following{/other_user}","gists_url":"https://api.github.com/users/mediachain/gists{/gist_id}","starred_url":"https://api.github.com/users/mediachain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediachain/subscriptions","organizations_url":"https://api.github.com/users/mediachain/orgs","repos_url":"https://api.github.com/users/mediachain/repos","events_url":"https://api.github.com/users/mediachain/events{/privacy}","received_events_url":"https://api.github.com/users/mediachain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mediachain/mediachain","description":"A distributed metadata protocol","fork":false,"url":"https://api.github.com/repos/mediachain/mediachain","forks_url":"https://api.github.com/repos/mediachain/mediachain/forks","keys_url":"https://api.github.com/repos/mediachain/mediachain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mediachain/mediachain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mediachain/mediachain/teams","hooks_url":"https://api.github.com/repos/mediachain/mediachain/hooks","issue_events_url":"https://api.github.com/repos/mediachain/mediachain/issues/events{/number}","events_url":"https://api.github.com/repos/mediachain/mediachain/events","assignees_url":"https://api.github.com/repos/mediachain/mediachain/assignees{/user}","branches_url":"https://api.github.com/repos/mediachain/mediachain/branches{/branch}","tags_url":"https://api.github.com/repos/mediachain/mediachain/tags","blobs_url":"https://api.github.com/repos/mediachain/mediachain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mediachain/mediachain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mediachain/mediachain/git/refs{/sha}","trees_url":"https://api.github.com/repos/mediachain/mediachain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mediachain/mediachain/statuses/{sha}","languages_url":"https://api.github.com/repos/mediachain/mediachain/languages","stargazers_url":"https://api.github.com/repos/mediachain/mediachain/stargazers","contributors_url":"https://api.github.com/repos/mediachain/mediachain/contributors","subscribers_url":"https://api.github.com/repos/mediachain/mediachain/subscribers","subscription_url":"https://api.github.com/repos/mediachain/mediachain/subscription","commits_url":"https://api.github.com/repos/mediachain/mediachain/commits{/sha}","git_commits_url":"https://api.github.com/repos/mediachain/mediachain/git/commits{/sha}","comments_url":"https://api.github.com/repos/mediachain/mediachain/comments{/number}","issue_comment_url":"https://api.github.com/repos/mediachain/mediachain/issues/comments{/number}","contents_url":"https://api.github.com/repos/mediachain/mediachain/contents/{+path}","compare_url":"https://api.github.com/repos/mediachain/mediachain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mediachain/mediachain/merges","archive_url":"https://api.github.com/repos/mediachain/mediachain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mediachain/mediachain/downloads","issues_url":"https://api.github.com/repos/mediachain/mediachain/issues{/number}","pulls_url":"https://api.github.com/repos/mediachain/mediachain/pulls{/number}","milestones_url":"https://api.github.com/repos/mediachain/mediachain/milestones{/number}","notifications_url":"https://api.github.com/repos/mediachain/mediachain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mediachain/mediachain/labels{/name}","releases_url":"https://api.github.com/repos/mediachain/mediachain/releases{/id}","deployments_url":"https://api.github.com/repos/mediachain/mediachain/deployments","created_at":"2016-01-12T17:29:52Z","updated_at":"2016-04-28T04:58:31Z","pushed_at":"2016-04-28T18:24:32Z","git_url":"git://github.com/mediachain/mediachain.git","ssh_url":"git@github.com:mediachain/mediachain.git","clone_url":"https://github.com/mediachain/mediachain.git","svn_url":"https://github.com/mediachain/mediachain","homepage":"https://medium.com/mine-labs/mediachain-483f49cbe37a","size":381,"stargazers_count":32,"watchers_count":32,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":18,"forks":0,"open_issues":18,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mediachain/mediachain/pulls/34"},"html":{"href":"https://github.com/mediachain/mediachain/pull/34"},"issue":{"href":"https://api.github.com/repos/mediachain/mediachain/issues/34"},"comments":{"href":"https://api.github.com/repos/mediachain/mediachain/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/mediachain/mediachain/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/mediachain/mediachain/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mediachain/mediachain/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/mediachain/mediachain/statuses/aa1fcce4b7138dcb4cdb3f4b9bdc7a5ff8af41d2"}}}}