{"action":"created","comment":{"url":"https://api.github.com/repos/scalapenos/stamina/pulls/comments/29289668","id":29289668,"diff_hunk":"@@ -0,0 +1,85 @@\n+package stamina\n+package testkit\n+\n+import scala.util._\n+import scala.annotation.tailrec\n+\n+trait StaminaTestKit { self: org.scalatest.WordSpecLike ⇒\n+\n+  val defaultSampleId = \"default\"\n+  case class PersistableSample(sampleId: String, persistable: AnyRef, description: Option[String]) {\n+    override def toString = persistable.getClass.getSimpleName + description.map(\" \" + _).getOrElse(\"\")\n+  }\n+\n+  def sample(persistable: AnyRef) = new PersistableSample(defaultSampleId, persistable, None)\n+  def sample(sampleId: String, persistable: AnyRef) = new PersistableSample(sampleId, persistable, Some(sampleId))\n+  def sample(sampleId: String, persistable: AnyRef, description: String) = new PersistableSample(sampleId, persistable, Some(description))\n+\n+  implicit class TestablePersisters(persisters: Persisters) extends org.scalatest.Matchers {\n+    def generateTestsFor(samples: PersistableSample*): Unit = {\n+      samples.foreach { sample ⇒\n+        performRoundtrip(sample)\n+        deserializeStoredVersions(sample)\n+      }\n+      // Here we could verify test coverage\n+    }\n+\n+    private def performRoundtrip(sample: PersistableSample) = {\n+      s\"persist and unpersist $sample\" in {\n+        persisters.canPersist(sample.persistable) should be(true)","path":"stamina-testkit/src/main/scala/stamina/testkit/StaminaTestKit.scala","position":29,"original_position":29,"commit_id":"d04a2b80e74e5413d0d3d4d423639d5b7e55ab49","original_commit_id":"d04a2b80e74e5413d0d3d4d423639d5b7e55ab49","user":{"login":"raboof","id":131856,"avatar_url":"https://avatars.githubusercontent.com/u/131856?v=3","gravatar_id":"","url":"https://api.github.com/users/raboof","html_url":"https://github.com/raboof","followers_url":"https://api.github.com/users/raboof/followers","following_url":"https://api.github.com/users/raboof/following{/other_user}","gists_url":"https://api.github.com/users/raboof/gists{/gist_id}","starred_url":"https://api.github.com/users/raboof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raboof/subscriptions","organizations_url":"https://api.github.com/users/raboof/orgs","repos_url":"https://api.github.com/users/raboof/repos","events_url":"https://api.github.com/users/raboof/events{/privacy}","received_events_url":"https://api.github.com/users/raboof/received_events","type":"User","site_admin":false},"body":"Removing this line - the next line will fail with a (probably) more descriptive error.","created_at":"2015-04-28T21:17:13Z","updated_at":"2015-04-28T21:17:13Z","html_url":"https://github.com/scalapenos/stamina/pull/15#discussion_r29289668","pull_request_url":"https://api.github.com/repos/scalapenos/stamina/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/scalapenos/stamina/pulls/comments/29289668"},"html":{"href":"https://github.com/scalapenos/stamina/pull/15#discussion_r29289668"},"pull_request":{"href":"https://api.github.com/repos/scalapenos/stamina/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/scalapenos/stamina/pulls/15","id":33547019,"html_url":"https://github.com/scalapenos/stamina/pull/15","diff_url":"https://github.com/scalapenos/stamina/pull/15.diff","patch_url":"https://github.com/scalapenos/stamina/pull/15.patch","issue_url":"https://api.github.com/repos/scalapenos/stamina/issues/15","number":15,"state":"open","locked":false,"title":"Testkit","user":{"login":"upeter","id":155391,"avatar_url":"https://avatars.githubusercontent.com/u/155391?v=3","gravatar_id":"","url":"https://api.github.com/users/upeter","html_url":"https://github.com/upeter","followers_url":"https://api.github.com/users/upeter/followers","following_url":"https://api.github.com/users/upeter/following{/other_user}","gists_url":"https://api.github.com/users/upeter/gists{/gist_id}","starred_url":"https://api.github.com/users/upeter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/upeter/subscriptions","organizations_url":"https://api.github.com/users/upeter/orgs","repos_url":"https://api.github.com/users/upeter/repos","events_url":"https://api.github.com/users/upeter/events{/privacy}","received_events_url":"https://api.github.com/users/upeter/received_events","type":"User","site_admin":false},"body":"Introduction of StaminaTestKit to simplify serialization and deserialization tests","created_at":"2015-04-17T14:04:20Z","updated_at":"2015-04-28T21:17:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68d6abe2060da536eb941fbfe219c75661b1e5db","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scalapenos/stamina/pulls/15/commits","review_comments_url":"https://api.github.com/repos/scalapenos/stamina/pulls/15/comments","review_comment_url":"https://api.github.com/repos/scalapenos/stamina/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scalapenos/stamina/issues/15/comments","statuses_url":"https://api.github.com/repos/scalapenos/stamina/statuses/d04a2b80e74e5413d0d3d4d423639d5b7e55ab49","head":{"label":"upeter:testkit","ref":"testkit","sha":"d04a2b80e74e5413d0d3d4d423639d5b7e55ab49","user":{"login":"upeter","id":155391,"avatar_url":"https://avatars.githubusercontent.com/u/155391?v=3","gravatar_id":"","url":"https://api.github.com/users/upeter","html_url":"https://github.com/upeter","followers_url":"https://api.github.com/users/upeter/followers","following_url":"https://api.github.com/users/upeter/following{/other_user}","gists_url":"https://api.github.com/users/upeter/gists{/gist_id}","starred_url":"https://api.github.com/users/upeter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/upeter/subscriptions","organizations_url":"https://api.github.com/users/upeter/orgs","repos_url":"https://api.github.com/users/upeter/repos","events_url":"https://api.github.com/users/upeter/events{/privacy}","received_events_url":"https://api.github.com/users/upeter/received_events","type":"User","site_admin":false},"repo":{"id":34118823,"name":"stamina","full_name":"upeter/stamina","owner":{"login":"upeter","id":155391,"avatar_url":"https://avatars.githubusercontent.com/u/155391?v=3","gravatar_id":"","url":"https://api.github.com/users/upeter","html_url":"https://github.com/upeter","followers_url":"https://api.github.com/users/upeter/followers","following_url":"https://api.github.com/users/upeter/following{/other_user}","gists_url":"https://api.github.com/users/upeter/gists{/gist_id}","starred_url":"https://api.github.com/users/upeter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/upeter/subscriptions","organizations_url":"https://api.github.com/users/upeter/orgs","repos_url":"https://api.github.com/users/upeter/repos","events_url":"https://api.github.com/users/upeter/events{/privacy}","received_events_url":"https://api.github.com/users/upeter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/upeter/stamina","description":"An alternative approach to serialization in akka-persistence","fork":true,"url":"https://api.github.com/repos/upeter/stamina","forks_url":"https://api.github.com/repos/upeter/stamina/forks","keys_url":"https://api.github.com/repos/upeter/stamina/keys{/key_id}","collaborators_url":"https://api.github.com/repos/upeter/stamina/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/upeter/stamina/teams","hooks_url":"https://api.github.com/repos/upeter/stamina/hooks","issue_events_url":"https://api.github.com/repos/upeter/stamina/issues/events{/number}","events_url":"https://api.github.com/repos/upeter/stamina/events","assignees_url":"https://api.github.com/repos/upeter/stamina/assignees{/user}","branches_url":"https://api.github.com/repos/upeter/stamina/branches{/branch}","tags_url":"https://api.github.com/repos/upeter/stamina/tags","blobs_url":"https://api.github.com/repos/upeter/stamina/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/upeter/stamina/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/upeter/stamina/git/refs{/sha}","trees_url":"https://api.github.com/repos/upeter/stamina/git/trees{/sha}","statuses_url":"https://api.github.com/repos/upeter/stamina/statuses/{sha}","languages_url":"https://api.github.com/repos/upeter/stamina/languages","stargazers_url":"https://api.github.com/repos/upeter/stamina/stargazers","contributors_url":"https://api.github.com/repos/upeter/stamina/contributors","subscribers_url":"https://api.github.com/repos/upeter/stamina/subscribers","subscription_url":"https://api.github.com/repos/upeter/stamina/subscription","commits_url":"https://api.github.com/repos/upeter/stamina/commits{/sha}","git_commits_url":"https://api.github.com/repos/upeter/stamina/git/commits{/sha}","comments_url":"https://api.github.com/repos/upeter/stamina/comments{/number}","issue_comment_url":"https://api.github.com/repos/upeter/stamina/issues/comments{/number}","contents_url":"https://api.github.com/repos/upeter/stamina/contents/{+path}","compare_url":"https://api.github.com/repos/upeter/stamina/compare/{base}...{head}","merges_url":"https://api.github.com/repos/upeter/stamina/merges","archive_url":"https://api.github.com/repos/upeter/stamina/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/upeter/stamina/downloads","issues_url":"https://api.github.com/repos/upeter/stamina/issues{/number}","pulls_url":"https://api.github.com/repos/upeter/stamina/pulls{/number}","milestones_url":"https://api.github.com/repos/upeter/stamina/milestones{/number}","notifications_url":"https://api.github.com/repos/upeter/stamina/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/upeter/stamina/labels{/name}","releases_url":"https://api.github.com/repos/upeter/stamina/releases{/id}","created_at":"2015-04-17T13:41:32Z","updated_at":"2015-04-17T13:41:33Z","pushed_at":"2015-04-17T13:58:58Z","git_url":"git://github.com/upeter/stamina.git","ssh_url":"git@github.com:upeter/stamina.git","clone_url":"https://github.com/upeter/stamina.git","svn_url":"https://github.com/upeter/stamina","homepage":null,"size":200,"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":"scalapenos:master","ref":"master","sha":"ef14b14e86f3c042145004a297831763bb476c9a","user":{"login":"scalapenos","id":3343186,"avatar_url":"https://avatars.githubusercontent.com/u/3343186?v=3","gravatar_id":"","url":"https://api.github.com/users/scalapenos","html_url":"https://github.com/scalapenos","followers_url":"https://api.github.com/users/scalapenos/followers","following_url":"https://api.github.com/users/scalapenos/following{/other_user}","gists_url":"https://api.github.com/users/scalapenos/gists{/gist_id}","starred_url":"https://api.github.com/users/scalapenos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scalapenos/subscriptions","organizations_url":"https://api.github.com/users/scalapenos/orgs","repos_url":"https://api.github.com/users/scalapenos/repos","events_url":"https://api.github.com/users/scalapenos/events{/privacy}","received_events_url":"https://api.github.com/users/scalapenos/received_events","type":"Organization","site_admin":false},"repo":{"id":28387011,"name":"stamina","full_name":"scalapenos/stamina","owner":{"login":"scalapenos","id":3343186,"avatar_url":"https://avatars.githubusercontent.com/u/3343186?v=3","gravatar_id":"","url":"https://api.github.com/users/scalapenos","html_url":"https://github.com/scalapenos","followers_url":"https://api.github.com/users/scalapenos/followers","following_url":"https://api.github.com/users/scalapenos/following{/other_user}","gists_url":"https://api.github.com/users/scalapenos/gists{/gist_id}","starred_url":"https://api.github.com/users/scalapenos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scalapenos/subscriptions","organizations_url":"https://api.github.com/users/scalapenos/orgs","repos_url":"https://api.github.com/users/scalapenos/repos","events_url":"https://api.github.com/users/scalapenos/events{/privacy}","received_events_url":"https://api.github.com/users/scalapenos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scalapenos/stamina","description":"An alternative approach to serialization in akka-persistence","fork":false,"url":"https://api.github.com/repos/scalapenos/stamina","forks_url":"https://api.github.com/repos/scalapenos/stamina/forks","keys_url":"https://api.github.com/repos/scalapenos/stamina/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scalapenos/stamina/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scalapenos/stamina/teams","hooks_url":"https://api.github.com/repos/scalapenos/stamina/hooks","issue_events_url":"https://api.github.com/repos/scalapenos/stamina/issues/events{/number}","events_url":"https://api.github.com/repos/scalapenos/stamina/events","assignees_url":"https://api.github.com/repos/scalapenos/stamina/assignees{/user}","branches_url":"https://api.github.com/repos/scalapenos/stamina/branches{/branch}","tags_url":"https://api.github.com/repos/scalapenos/stamina/tags","blobs_url":"https://api.github.com/repos/scalapenos/stamina/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scalapenos/stamina/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scalapenos/stamina/git/refs{/sha}","trees_url":"https://api.github.com/repos/scalapenos/stamina/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scalapenos/stamina/statuses/{sha}","languages_url":"https://api.github.com/repos/scalapenos/stamina/languages","stargazers_url":"https://api.github.com/repos/scalapenos/stamina/stargazers","contributors_url":"https://api.github.com/repos/scalapenos/stamina/contributors","subscribers_url":"https://api.github.com/repos/scalapenos/stamina/subscribers","subscription_url":"https://api.github.com/repos/scalapenos/stamina/subscription","commits_url":"https://api.github.com/repos/scalapenos/stamina/commits{/sha}","git_commits_url":"https://api.github.com/repos/scalapenos/stamina/git/commits{/sha}","comments_url":"https://api.github.com/repos/scalapenos/stamina/comments{/number}","issue_comment_url":"https://api.github.com/repos/scalapenos/stamina/issues/comments{/number}","contents_url":"https://api.github.com/repos/scalapenos/stamina/contents/{+path}","compare_url":"https://api.github.com/repos/scalapenos/stamina/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scalapenos/stamina/merges","archive_url":"https://api.github.com/repos/scalapenos/stamina/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scalapenos/stamina/downloads","issues_url":"https://api.github.com/repos/scalapenos/stamina/issues{/number}","pulls_url":"https://api.github.com/repos/scalapenos/stamina/pulls{/number}","milestones_url":"https://api.github.com/repos/scalapenos/stamina/milestones{/number}","notifications_url":"https://api.github.com/repos/scalapenos/stamina/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scalapenos/stamina/labels{/name}","releases_url":"https://api.github.com/repos/scalapenos/stamina/releases{/id}","created_at":"2014-12-23T08:32:54Z","updated_at":"2015-04-28T11:30:30Z","pushed_at":"2015-04-28T11:30:30Z","git_url":"git://github.com/scalapenos/stamina.git","ssh_url":"git@github.com:scalapenos/stamina.git","clone_url":"https://github.com/scalapenos/stamina.git","svn_url":"https://github.com/scalapenos/stamina","homepage":null,"size":584,"stargazers_count":3,"watchers_count":3,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":8,"forks":4,"open_issues":8,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scalapenos/stamina/pulls/15"},"html":{"href":"https://github.com/scalapenos/stamina/pull/15"},"issue":{"href":"https://api.github.com/repos/scalapenos/stamina/issues/15"},"comments":{"href":"https://api.github.com/repos/scalapenos/stamina/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/scalapenos/stamina/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/scalapenos/stamina/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scalapenos/stamina/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/scalapenos/stamina/statuses/d04a2b80e74e5413d0d3d4d423639d5b7e55ab49"}}}}