{"action":"created","comment":{"url":"https://api.github.com/repos/clouway-incubator/servlets/pulls/comments/88294868","pull_request_review_id":8872924,"id":88294868,"diff_hunk":"@@ -0,0 +1,75 @@\n+package com.clouway.persistent.adapter.jdbc;\n+\n+import com.clouway.core.Session;\n+import com.clouway.persistent.DatastoreCleaner;\n+import com.clouway.persistent.datastore.DataStore;\n+import org.junit.Before;\n+import org.junit.Test;\n+\n+import java.text.DateFormat;\n+import java.text.SimpleDateFormat;\n+import java.util.Date;\n+import java.util.Optional;\n+\n+import static junit.framework.TestCase.assertTrue;\n+import static org.hamcrest.MatcherAssert.assertThat;\n+import static org.hamcrest.core.Is.is;\n+\n+/**\n+ * @author Martin Milev <martinmariusmilev@gmail.com>\n+ */\n+public class PersistentSessionRepositoryTest {\n+  private PersistentSessionRepository repo;\n+\n+  @Before\n+  public void setUp() throws Exception {\n+    repo = new PersistentSessionRepository(new DataStore(new ConnectionProvider()));\n+    DatastoreCleaner datastoreCleaner = new DatastoreCleaner(\"accounts\", \"sessions\");\n+    datastoreCleaner.perform();\n+  }\n+\n+  @Test\n+  public void findSessionBySID() throws Exception {\n+    DateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\n+    Date date = format.parse(\"2000-01-01 00:00:00\");\n+    Session session = new Session(\"id\", \"John\", date);\n+\n+    repo.save(session);\n+    Session actual = repo.findBySID(\"id\").get();\n+    Session expected = new Session(\"id\", \"John\", date);\n+\n+    assertThat(actual, is(expected));\n+  }\n+\n+  @Test\n+  public void findSessionByUsername() throws Exception {","path":"src/test/java/com/clouway/persistent/adapter/jdbc/PersistentSessionRepositoryTest.java","position":45,"original_position":45,"commit_id":"e568d1287ef563441fa2efcadd79ff0bc4f736cc","original_commit_id":"e568d1287ef563441fa2efcadd79ff0bc4f736cc","user":{"login":"freekman","id":8199446,"avatar_url":"https://avatars.githubusercontent.com/u/8199446?v=3","gravatar_id":"","url":"https://api.github.com/users/freekman","html_url":"https://github.com/freekman","followers_url":"https://api.github.com/users/freekman/followers","following_url":"https://api.github.com/users/freekman/following{/other_user}","gists_url":"https://api.github.com/users/freekman/gists{/gist_id}","starred_url":"https://api.github.com/users/freekman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freekman/subscriptions","organizations_url":"https://api.github.com/users/freekman/orgs","repos_url":"https://api.github.com/users/freekman/repos","events_url":"https://api.github.com/users/freekman/events{/privacy}","received_events_url":"https://api.github.com/users/freekman/received_events","type":"User","site_admin":false},"body":"use camel case for naming","created_at":"2016-11-16T18:09:17Z","updated_at":"2016-11-16T18:09:17Z","html_url":"https://github.com/clouway-incubator/servlets/pull/113#discussion_r88294868","pull_request_url":"https://api.github.com/repos/clouway-incubator/servlets/pulls/113","_links":{"self":{"href":"https://api.github.com/repos/clouway-incubator/servlets/pulls/comments/88294868"},"html":{"href":"https://github.com/clouway-incubator/servlets/pull/113#discussion_r88294868"},"pull_request":{"href":"https://api.github.com/repos/clouway-incubator/servlets/pulls/113"}}},"pull_request":{"url":"https://api.github.com/repos/clouway-incubator/servlets/pulls/113","id":93143811,"html_url":"https://github.com/clouway-incubator/servlets/pull/113","diff_url":"https://github.com/clouway-incubator/servlets/pull/113.diff","patch_url":"https://github.com/clouway-incubator/servlets/pull/113.patch","issue_url":"https://api.github.com/repos/clouway-incubator/servlets/issues/113","number":113,"state":"open","locked":false,"title":"bank: active users in the system.","user":{"login":"martinmilev","id":2754552,"avatar_url":"https://avatars.githubusercontent.com/u/2754552?v=3","gravatar_id":"","url":"https://api.github.com/users/martinmilev","html_url":"https://github.com/martinmilev","followers_url":"https://api.github.com/users/martinmilev/followers","following_url":"https://api.github.com/users/martinmilev/following{/other_user}","gists_url":"https://api.github.com/users/martinmilev/gists{/gist_id}","starred_url":"https://api.github.com/users/martinmilev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinmilev/subscriptions","organizations_url":"https://api.github.com/users/martinmilev/orgs","repos_url":"https://api.github.com/users/martinmilev/repos","events_url":"https://api.github.com/users/martinmilev/events{/privacy}","received_events_url":"https://api.github.com/users/martinmilev/received_events","type":"User","site_admin":false},"body":"Saving sessions in DB. Searching for sessions in the DB and counting the saved sessions.\r\nFixes #111.","created_at":"2016-11-10T12:44:38Z","updated_at":"2016-11-16T18:09:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e64baf9a2b361995e47621514bda805b18172b24","assignee":{"login":"mgenov","id":209223,"avatar_url":"https://avatars.githubusercontent.com/u/209223?v=3","gravatar_id":"","url":"https://api.github.com/users/mgenov","html_url":"https://github.com/mgenov","followers_url":"https://api.github.com/users/mgenov/followers","following_url":"https://api.github.com/users/mgenov/following{/other_user}","gists_url":"https://api.github.com/users/mgenov/gists{/gist_id}","starred_url":"https://api.github.com/users/mgenov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgenov/subscriptions","organizations_url":"https://api.github.com/users/mgenov/orgs","repos_url":"https://api.github.com/users/mgenov/repos","events_url":"https://api.github.com/users/mgenov/events{/privacy}","received_events_url":"https://api.github.com/users/mgenov/received_events","type":"User","site_admin":false},"assignees":[{"login":"mgenov","id":209223,"avatar_url":"https://avatars.githubusercontent.com/u/209223?v=3","gravatar_id":"","url":"https://api.github.com/users/mgenov","html_url":"https://github.com/mgenov","followers_url":"https://api.github.com/users/mgenov/followers","following_url":"https://api.github.com/users/mgenov/following{/other_user}","gists_url":"https://api.github.com/users/mgenov/gists{/gist_id}","starred_url":"https://api.github.com/users/mgenov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgenov/subscriptions","organizations_url":"https://api.github.com/users/mgenov/orgs","repos_url":"https://api.github.com/users/mgenov/repos","events_url":"https://api.github.com/users/mgenov/events{/privacy}","received_events_url":"https://api.github.com/users/mgenov/received_events","type":"User","site_admin":false},{"login":"freekman","id":8199446,"avatar_url":"https://avatars.githubusercontent.com/u/8199446?v=3","gravatar_id":"","url":"https://api.github.com/users/freekman","html_url":"https://github.com/freekman","followers_url":"https://api.github.com/users/freekman/followers","following_url":"https://api.github.com/users/freekman/following{/other_user}","gists_url":"https://api.github.com/users/freekman/gists{/gist_id}","starred_url":"https://api.github.com/users/freekman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freekman/subscriptions","organizations_url":"https://api.github.com/users/freekman/orgs","repos_url":"https://api.github.com/users/freekman/repos","events_url":"https://api.github.com/users/freekman/events{/privacy}","received_events_url":"https://api.github.com/users/freekman/received_events","type":"User","site_admin":false},{"login":"gadjevb","id":19385077,"avatar_url":"https://avatars.githubusercontent.com/u/19385077?v=3","gravatar_id":"","url":"https://api.github.com/users/gadjevb","html_url":"https://github.com/gadjevb","followers_url":"https://api.github.com/users/gadjevb/followers","following_url":"https://api.github.com/users/gadjevb/following{/other_user}","gists_url":"https://api.github.com/users/gadjevb/gists{/gist_id}","starred_url":"https://api.github.com/users/gadjevb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gadjevb/subscriptions","organizations_url":"https://api.github.com/users/gadjevb/orgs","repos_url":"https://api.github.com/users/gadjevb/repos","events_url":"https://api.github.com/users/gadjevb/events{/privacy}","received_events_url":"https://api.github.com/users/gadjevb/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/clouway-incubator/servlets/pulls/113/commits","review_comments_url":"https://api.github.com/repos/clouway-incubator/servlets/pulls/113/comments","review_comment_url":"https://api.github.com/repos/clouway-incubator/servlets/pulls/comments{/number}","comments_url":"https://api.github.com/repos/clouway-incubator/servlets/issues/113/comments","statuses_url":"https://api.github.com/repos/clouway-incubator/servlets/statuses/e568d1287ef563441fa2efcadd79ff0bc4f736cc","head":{"label":"martinmilev:activeUsersInfo","ref":"activeUsersInfo","sha":"e568d1287ef563441fa2efcadd79ff0bc4f736cc","user":{"login":"martinmilev","id":2754552,"avatar_url":"https://avatars.githubusercontent.com/u/2754552?v=3","gravatar_id":"","url":"https://api.github.com/users/martinmilev","html_url":"https://github.com/martinmilev","followers_url":"https://api.github.com/users/martinmilev/followers","following_url":"https://api.github.com/users/martinmilev/following{/other_user}","gists_url":"https://api.github.com/users/martinmilev/gists{/gist_id}","starred_url":"https://api.github.com/users/martinmilev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinmilev/subscriptions","organizations_url":"https://api.github.com/users/martinmilev/orgs","repos_url":"https://api.github.com/users/martinmilev/repos","events_url":"https://api.github.com/users/martinmilev/events{/privacy}","received_events_url":"https://api.github.com/users/martinmilev/received_events","type":"User","site_admin":false},"repo":{"id":68814061,"name":"servlets","full_name":"martinmilev/servlets","owner":{"login":"martinmilev","id":2754552,"avatar_url":"https://avatars.githubusercontent.com/u/2754552?v=3","gravatar_id":"","url":"https://api.github.com/users/martinmilev","html_url":"https://github.com/martinmilev","followers_url":"https://api.github.com/users/martinmilev/followers","following_url":"https://api.github.com/users/martinmilev/following{/other_user}","gists_url":"https://api.github.com/users/martinmilev/gists{/gist_id}","starred_url":"https://api.github.com/users/martinmilev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinmilev/subscriptions","organizations_url":"https://api.github.com/users/martinmilev/orgs","repos_url":"https://api.github.com/users/martinmilev/repos","events_url":"https://api.github.com/users/martinmilev/events{/privacy}","received_events_url":"https://api.github.com/users/martinmilev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/martinmilev/servlets","description":"Servlets ","fork":true,"url":"https://api.github.com/repos/martinmilev/servlets","forks_url":"https://api.github.com/repos/martinmilev/servlets/forks","keys_url":"https://api.github.com/repos/martinmilev/servlets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martinmilev/servlets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martinmilev/servlets/teams","hooks_url":"https://api.github.com/repos/martinmilev/servlets/hooks","issue_events_url":"https://api.github.com/repos/martinmilev/servlets/issues/events{/number}","events_url":"https://api.github.com/repos/martinmilev/servlets/events","assignees_url":"https://api.github.com/repos/martinmilev/servlets/assignees{/user}","branches_url":"https://api.github.com/repos/martinmilev/servlets/branches{/branch}","tags_url":"https://api.github.com/repos/martinmilev/servlets/tags","blobs_url":"https://api.github.com/repos/martinmilev/servlets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martinmilev/servlets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martinmilev/servlets/git/refs{/sha}","trees_url":"https://api.github.com/repos/martinmilev/servlets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martinmilev/servlets/statuses/{sha}","languages_url":"https://api.github.com/repos/martinmilev/servlets/languages","stargazers_url":"https://api.github.com/repos/martinmilev/servlets/stargazers","contributors_url":"https://api.github.com/repos/martinmilev/servlets/contributors","subscribers_url":"https://api.github.com/repos/martinmilev/servlets/subscribers","subscription_url":"https://api.github.com/repos/martinmilev/servlets/subscription","commits_url":"https://api.github.com/repos/martinmilev/servlets/commits{/sha}","git_commits_url":"https://api.github.com/repos/martinmilev/servlets/git/commits{/sha}","comments_url":"https://api.github.com/repos/martinmilev/servlets/comments{/number}","issue_comment_url":"https://api.github.com/repos/martinmilev/servlets/issues/comments{/number}","contents_url":"https://api.github.com/repos/martinmilev/servlets/contents/{+path}","compare_url":"https://api.github.com/repos/martinmilev/servlets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martinmilev/servlets/merges","archive_url":"https://api.github.com/repos/martinmilev/servlets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martinmilev/servlets/downloads","issues_url":"https://api.github.com/repos/martinmilev/servlets/issues{/number}","pulls_url":"https://api.github.com/repos/martinmilev/servlets/pulls{/number}","milestones_url":"https://api.github.com/repos/martinmilev/servlets/milestones{/number}","notifications_url":"https://api.github.com/repos/martinmilev/servlets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martinmilev/servlets/labels{/name}","releases_url":"https://api.github.com/repos/martinmilev/servlets/releases{/id}","deployments_url":"https://api.github.com/repos/martinmilev/servlets/deployments","created_at":"2016-09-21T12:21:34Z","updated_at":"2015-10-15T06:53:35Z","pushed_at":"2016-11-16T14:30:40Z","git_url":"git://github.com/martinmilev/servlets.git","ssh_url":"git@github.com:martinmilev/servlets.git","clone_url":"https://github.com/martinmilev/servlets.git","svn_url":"https://github.com/martinmilev/servlets","homepage":null,"size":682,"stargazers_count":0,"watchers_count":0,"language":null,"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":"clouway-incubator:master","ref":"master","sha":"7bcfc7b9b92554c1cd2be1e65d428000b67184d7","user":{"login":"clouway-incubator","id":10173098,"avatar_url":"https://avatars.githubusercontent.com/u/10173098?v=3","gravatar_id":"","url":"https://api.github.com/users/clouway-incubator","html_url":"https://github.com/clouway-incubator","followers_url":"https://api.github.com/users/clouway-incubator/followers","following_url":"https://api.github.com/users/clouway-incubator/following{/other_user}","gists_url":"https://api.github.com/users/clouway-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/clouway-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clouway-incubator/subscriptions","organizations_url":"https://api.github.com/users/clouway-incubator/orgs","repos_url":"https://api.github.com/users/clouway-incubator/repos","events_url":"https://api.github.com/users/clouway-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/clouway-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":44299216,"name":"servlets","full_name":"clouway-incubator/servlets","owner":{"login":"clouway-incubator","id":10173098,"avatar_url":"https://avatars.githubusercontent.com/u/10173098?v=3","gravatar_id":"","url":"https://api.github.com/users/clouway-incubator","html_url":"https://github.com/clouway-incubator","followers_url":"https://api.github.com/users/clouway-incubator/followers","following_url":"https://api.github.com/users/clouway-incubator/following{/other_user}","gists_url":"https://api.github.com/users/clouway-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/clouway-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clouway-incubator/subscriptions","organizations_url":"https://api.github.com/users/clouway-incubator/orgs","repos_url":"https://api.github.com/users/clouway-incubator/repos","events_url":"https://api.github.com/users/clouway-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/clouway-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/clouway-incubator/servlets","description":"Servlets ","fork":false,"url":"https://api.github.com/repos/clouway-incubator/servlets","forks_url":"https://api.github.com/repos/clouway-incubator/servlets/forks","keys_url":"https://api.github.com/repos/clouway-incubator/servlets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clouway-incubator/servlets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clouway-incubator/servlets/teams","hooks_url":"https://api.github.com/repos/clouway-incubator/servlets/hooks","issue_events_url":"https://api.github.com/repos/clouway-incubator/servlets/issues/events{/number}","events_url":"https://api.github.com/repos/clouway-incubator/servlets/events","assignees_url":"https://api.github.com/repos/clouway-incubator/servlets/assignees{/user}","branches_url":"https://api.github.com/repos/clouway-incubator/servlets/branches{/branch}","tags_url":"https://api.github.com/repos/clouway-incubator/servlets/tags","blobs_url":"https://api.github.com/repos/clouway-incubator/servlets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clouway-incubator/servlets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clouway-incubator/servlets/git/refs{/sha}","trees_url":"https://api.github.com/repos/clouway-incubator/servlets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clouway-incubator/servlets/statuses/{sha}","languages_url":"https://api.github.com/repos/clouway-incubator/servlets/languages","stargazers_url":"https://api.github.com/repos/clouway-incubator/servlets/stargazers","contributors_url":"https://api.github.com/repos/clouway-incubator/servlets/contributors","subscribers_url":"https://api.github.com/repos/clouway-incubator/servlets/subscribers","subscription_url":"https://api.github.com/repos/clouway-incubator/servlets/subscription","commits_url":"https://api.github.com/repos/clouway-incubator/servlets/commits{/sha}","git_commits_url":"https://api.github.com/repos/clouway-incubator/servlets/git/commits{/sha}","comments_url":"https://api.github.com/repos/clouway-incubator/servlets/comments{/number}","issue_comment_url":"https://api.github.com/repos/clouway-incubator/servlets/issues/comments{/number}","contents_url":"https://api.github.com/repos/clouway-incubator/servlets/contents/{+path}","compare_url":"https://api.github.com/repos/clouway-incubator/servlets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clouway-incubator/servlets/merges","archive_url":"https://api.github.com/repos/clouway-incubator/servlets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clouway-incubator/servlets/downloads","issues_url":"https://api.github.com/repos/clouway-incubator/servlets/issues{/number}","pulls_url":"https://api.github.com/repos/clouway-incubator/servlets/pulls{/number}","milestones_url":"https://api.github.com/repos/clouway-incubator/servlets/milestones{/number}","notifications_url":"https://api.github.com/repos/clouway-incubator/servlets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clouway-incubator/servlets/labels{/name}","releases_url":"https://api.github.com/repos/clouway-incubator/servlets/releases{/id}","deployments_url":"https://api.github.com/repos/clouway-incubator/servlets/deployments","created_at":"2015-10-15T06:53:35Z","updated_at":"2016-11-08T08:02:29Z","pushed_at":"2016-11-16T14:19:06Z","git_url":"git://github.com/clouway-incubator/servlets.git","ssh_url":"git@github.com:clouway-incubator/servlets.git","clone_url":"https://github.com/clouway-incubator/servlets.git","svn_url":"https://github.com/clouway-incubator/servlets","homepage":null,"size":7095,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":8,"forks":9,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/clouway-incubator/servlets/pulls/113"},"html":{"href":"https://github.com/clouway-incubator/servlets/pull/113"},"issue":{"href":"https://api.github.com/repos/clouway-incubator/servlets/issues/113"},"comments":{"href":"https://api.github.com/repos/clouway-incubator/servlets/issues/113/comments"},"review_comments":{"href":"https://api.github.com/repos/clouway-incubator/servlets/pulls/113/comments"},"review_comment":{"href":"https://api.github.com/repos/clouway-incubator/servlets/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/clouway-incubator/servlets/pulls/113/commits"},"statuses":{"href":"https://api.github.com/repos/clouway-incubator/servlets/statuses/e568d1287ef563441fa2efcadd79ff0bc4f736cc"}}}}
{"actor":{"display_login":"freekman"}}