{"action":"created","comment":{"url":"https://api.github.com/repos/rxn1d/courses/pulls/comments/63326066","id":63326066,"diff_hunk":"@@ -0,0 +1,83 @@\n+package ua.com.partzone.carmarket_topic21.test;\n+\n+import org.hibernate.SessionFactory;\n+import org.hibernate.cfg.Configuration;\n+import org.junit.AfterClass;\n+import org.junit.BeforeClass;\n+import org.junit.Test;\n+import org.junit.runner.RunWith;\n+import org.junit.runners.JUnit4;\n+import ua.com.partzone.carmarket_topic21.dao.UserDao;\n+import ua.com.partzone.carmarket_topic21.domain.User;\n+import ua.com.partzone.carmarket_topic21.exception.CarMarketException;\n+\n+import java.util.List;\n+\n+import static org.junit.Assert.*;\n+\n+\n+/**\n+ * @author Denis Loshkarev on 13.05.2016.\n+ */\n+@RunWith(JUnit4.class)\n+public class UserDaoTest {\n+    private static SessionFactory factory;\n+    private static UserDao userDao;\n+    private static User user;\n+    private static volatile boolean isGetAllTested;\n+\n+    @BeforeClass\n+    public static void setUp() {\n+        isGetAllTested = false;\n+        factory = new Configuration().configure().buildSessionFactory();\n+        userDao = new UserDao(factory);\n+        user = new User(\"FN\", \"LN\", \"555\");\n+    }\n+\n+    @AfterClass\n+    public static void exit() throws InterruptedException {\n+        Thread.sleep(50);\n+        factory.close();\n+    }\n+\n+    private synchronized void testGetAll() {\n+        if (!isGetAllTested) {\n+            List<User> users = null;\n+            try {\n+                users = userDao.getAll();\n+            } catch (CarMarketException e) {\n+                fail(e.getMessage());\n+            }\n+            assertNotNull(users);\n+            isGetAllTested = true;\n+        }\n+    }\n+\n+    @Test\n+    public void testInsertCar() {\n+        testGetAll();\n+        try {\n+            List<User> beforeInsert = userDao.getAll();\n+            userDao.insert(user);\n+            List<User> afterInsert = userDao.getAll();\n+            assertTrue(afterInsert.size() - beforeInsert.size() == 1);\n+        } catch (CarMarketException e) {\n+            fail(e.getMessage());","path":"topic21/src/test/java/ua/com/partzone/carmarket_topic21/test/UserDaoTest.java","position":65,"original_position":65,"commit_id":"69479249d1483261a76152409ce9d28f4a79ecd7","original_commit_id":"69479249d1483261a76152409ce9d28f4a79ecd7","user":{"login":"rxn1d","id":3824602,"avatar_url":"https://avatars.githubusercontent.com/u/3824602?v=3","gravatar_id":"","url":"https://api.github.com/users/rxn1d","html_url":"https://github.com/rxn1d","followers_url":"https://api.github.com/users/rxn1d/followers","following_url":"https://api.github.com/users/rxn1d/following{/other_user}","gists_url":"https://api.github.com/users/rxn1d/gists{/gist_id}","starred_url":"https://api.github.com/users/rxn1d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rxn1d/subscriptions","organizations_url":"https://api.github.com/users/rxn1d/orgs","repos_url":"https://api.github.com/users/rxn1d/repos","events_url":"https://api.github.com/users/rxn1d/events{/privacy}","received_events_url":"https://api.github.com/users/rxn1d/received_events","type":"User","site_admin":false},"body":"Ага)","created_at":"2016-05-16T08:59:45Z","updated_at":"2016-05-16T08:59:45Z","html_url":"https://github.com/rxn1d/courses/pull/39#discussion_r63326066","pull_request_url":"https://api.github.com/repos/rxn1d/courses/pulls/39","_links":{"self":{"href":"https://api.github.com/repos/rxn1d/courses/pulls/comments/63326066"},"html":{"href":"https://github.com/rxn1d/courses/pull/39#discussion_r63326066"},"pull_request":{"href":"https://api.github.com/repos/rxn1d/courses/pulls/39"}}},"pull_request":{"url":"https://api.github.com/repos/rxn1d/courses/pulls/39","id":66495075,"html_url":"https://github.com/rxn1d/courses/pull/39","diff_url":"https://github.com/rxn1d/courses/pull/39.diff","patch_url":"https://github.com/rxn1d/courses/pull/39.patch","issue_url":"https://api.github.com/repos/rxn1d/courses/issues/39","number":39,"state":"closed","locked":false,"title":"Topic 18 & Topic 19 & Topic 20 & Topic 21","user":{"login":"denisko21","id":5048760,"avatar_url":"https://avatars.githubusercontent.com/u/5048760?v=3","gravatar_id":"","url":"https://api.github.com/users/denisko21","html_url":"https://github.com/denisko21","followers_url":"https://api.github.com/users/denisko21/followers","following_url":"https://api.github.com/users/denisko21/following{/other_user}","gists_url":"https://api.github.com/users/denisko21/gists{/gist_id}","starred_url":"https://api.github.com/users/denisko21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denisko21/subscriptions","organizations_url":"https://api.github.com/users/denisko21/orgs","repos_url":"https://api.github.com/users/denisko21/repos","events_url":"https://api.github.com/users/denisko21/events{/privacy}","received_events_url":"https://api.github.com/users/denisko21/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-14T14:36:23Z","updated_at":"2016-05-16T08:59:45Z","closed_at":"2016-05-15T13:30:01Z","merged_at":"2016-05-15T13:30:01Z","merge_commit_sha":"64fabc1a90801444b5813450c8290b3b6d54eda3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rxn1d/courses/pulls/39/commits","review_comments_url":"https://api.github.com/repos/rxn1d/courses/pulls/39/comments","review_comment_url":"https://api.github.com/repos/rxn1d/courses/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rxn1d/courses/issues/39/comments","statuses_url":"https://api.github.com/repos/rxn1d/courses/statuses/69479249d1483261a76152409ce9d28f4a79ecd7","head":{"label":"denisko21:master","ref":"master","sha":"69479249d1483261a76152409ce9d28f4a79ecd7","user":{"login":"denisko21","id":5048760,"avatar_url":"https://avatars.githubusercontent.com/u/5048760?v=3","gravatar_id":"","url":"https://api.github.com/users/denisko21","html_url":"https://github.com/denisko21","followers_url":"https://api.github.com/users/denisko21/followers","following_url":"https://api.github.com/users/denisko21/following{/other_user}","gists_url":"https://api.github.com/users/denisko21/gists{/gist_id}","starred_url":"https://api.github.com/users/denisko21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denisko21/subscriptions","organizations_url":"https://api.github.com/users/denisko21/orgs","repos_url":"https://api.github.com/users/denisko21/repos","events_url":"https://api.github.com/users/denisko21/events{/privacy}","received_events_url":"https://api.github.com/users/denisko21/received_events","type":"User","site_admin":false},"repo":{"id":54654328,"name":"courses","full_name":"denisko21/courses","owner":{"login":"denisko21","id":5048760,"avatar_url":"https://avatars.githubusercontent.com/u/5048760?v=3","gravatar_id":"","url":"https://api.github.com/users/denisko21","html_url":"https://github.com/denisko21","followers_url":"https://api.github.com/users/denisko21/followers","following_url":"https://api.github.com/users/denisko21/following{/other_user}","gists_url":"https://api.github.com/users/denisko21/gists{/gist_id}","starred_url":"https://api.github.com/users/denisko21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denisko21/subscriptions","organizations_url":"https://api.github.com/users/denisko21/orgs","repos_url":"https://api.github.com/users/denisko21/repos","events_url":"https://api.github.com/users/denisko21/events{/privacy}","received_events_url":"https://api.github.com/users/denisko21/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/denisko21/courses","description":"Java courses materials","fork":true,"url":"https://api.github.com/repos/denisko21/courses","forks_url":"https://api.github.com/repos/denisko21/courses/forks","keys_url":"https://api.github.com/repos/denisko21/courses/keys{/key_id}","collaborators_url":"https://api.github.com/repos/denisko21/courses/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/denisko21/courses/teams","hooks_url":"https://api.github.com/repos/denisko21/courses/hooks","issue_events_url":"https://api.github.com/repos/denisko21/courses/issues/events{/number}","events_url":"https://api.github.com/repos/denisko21/courses/events","assignees_url":"https://api.github.com/repos/denisko21/courses/assignees{/user}","branches_url":"https://api.github.com/repos/denisko21/courses/branches{/branch}","tags_url":"https://api.github.com/repos/denisko21/courses/tags","blobs_url":"https://api.github.com/repos/denisko21/courses/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/denisko21/courses/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/denisko21/courses/git/refs{/sha}","trees_url":"https://api.github.com/repos/denisko21/courses/git/trees{/sha}","statuses_url":"https://api.github.com/repos/denisko21/courses/statuses/{sha}","languages_url":"https://api.github.com/repos/denisko21/courses/languages","stargazers_url":"https://api.github.com/repos/denisko21/courses/stargazers","contributors_url":"https://api.github.com/repos/denisko21/courses/contributors","subscribers_url":"https://api.github.com/repos/denisko21/courses/subscribers","subscription_url":"https://api.github.com/repos/denisko21/courses/subscription","commits_url":"https://api.github.com/repos/denisko21/courses/commits{/sha}","git_commits_url":"https://api.github.com/repos/denisko21/courses/git/commits{/sha}","comments_url":"https://api.github.com/repos/denisko21/courses/comments{/number}","issue_comment_url":"https://api.github.com/repos/denisko21/courses/issues/comments{/number}","contents_url":"https://api.github.com/repos/denisko21/courses/contents/{+path}","compare_url":"https://api.github.com/repos/denisko21/courses/compare/{base}...{head}","merges_url":"https://api.github.com/repos/denisko21/courses/merges","archive_url":"https://api.github.com/repos/denisko21/courses/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/denisko21/courses/downloads","issues_url":"https://api.github.com/repos/denisko21/courses/issues{/number}","pulls_url":"https://api.github.com/repos/denisko21/courses/pulls{/number}","milestones_url":"https://api.github.com/repos/denisko21/courses/milestones{/number}","notifications_url":"https://api.github.com/repos/denisko21/courses/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/denisko21/courses/labels{/name}","releases_url":"https://api.github.com/repos/denisko21/courses/releases{/id}","deployments_url":"https://api.github.com/repos/denisko21/courses/deployments","created_at":"2016-03-24T15:49:00Z","updated_at":"2016-03-24T15:49:01Z","pushed_at":"2016-05-15T21:41:29Z","git_url":"git://github.com/denisko21/courses.git","ssh_url":"git@github.com:denisko21/courses.git","clone_url":"https://github.com/denisko21/courses.git","svn_url":"https://github.com/denisko21/courses","homepage":null,"size":568,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"rxn1d:courses/denisko21","ref":"courses/denisko21","sha":"64e46327f67fd0205f652b3061efc39d9c29b9bc","user":{"login":"rxn1d","id":3824602,"avatar_url":"https://avatars.githubusercontent.com/u/3824602?v=3","gravatar_id":"","url":"https://api.github.com/users/rxn1d","html_url":"https://github.com/rxn1d","followers_url":"https://api.github.com/users/rxn1d/followers","following_url":"https://api.github.com/users/rxn1d/following{/other_user}","gists_url":"https://api.github.com/users/rxn1d/gists{/gist_id}","starred_url":"https://api.github.com/users/rxn1d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rxn1d/subscriptions","organizations_url":"https://api.github.com/users/rxn1d/orgs","repos_url":"https://api.github.com/users/rxn1d/repos","events_url":"https://api.github.com/users/rxn1d/events{/privacy}","received_events_url":"https://api.github.com/users/rxn1d/received_events","type":"User","site_admin":false},"repo":{"id":50372781,"name":"courses","full_name":"rxn1d/courses","owner":{"login":"rxn1d","id":3824602,"avatar_url":"https://avatars.githubusercontent.com/u/3824602?v=3","gravatar_id":"","url":"https://api.github.com/users/rxn1d","html_url":"https://github.com/rxn1d","followers_url":"https://api.github.com/users/rxn1d/followers","following_url":"https://api.github.com/users/rxn1d/following{/other_user}","gists_url":"https://api.github.com/users/rxn1d/gists{/gist_id}","starred_url":"https://api.github.com/users/rxn1d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rxn1d/subscriptions","organizations_url":"https://api.github.com/users/rxn1d/orgs","repos_url":"https://api.github.com/users/rxn1d/repos","events_url":"https://api.github.com/users/rxn1d/events{/privacy}","received_events_url":"https://api.github.com/users/rxn1d/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rxn1d/courses","description":"Java courses materials","fork":false,"url":"https://api.github.com/repos/rxn1d/courses","forks_url":"https://api.github.com/repos/rxn1d/courses/forks","keys_url":"https://api.github.com/repos/rxn1d/courses/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rxn1d/courses/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rxn1d/courses/teams","hooks_url":"https://api.github.com/repos/rxn1d/courses/hooks","issue_events_url":"https://api.github.com/repos/rxn1d/courses/issues/events{/number}","events_url":"https://api.github.com/repos/rxn1d/courses/events","assignees_url":"https://api.github.com/repos/rxn1d/courses/assignees{/user}","branches_url":"https://api.github.com/repos/rxn1d/courses/branches{/branch}","tags_url":"https://api.github.com/repos/rxn1d/courses/tags","blobs_url":"https://api.github.com/repos/rxn1d/courses/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rxn1d/courses/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rxn1d/courses/git/refs{/sha}","trees_url":"https://api.github.com/repos/rxn1d/courses/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rxn1d/courses/statuses/{sha}","languages_url":"https://api.github.com/repos/rxn1d/courses/languages","stargazers_url":"https://api.github.com/repos/rxn1d/courses/stargazers","contributors_url":"https://api.github.com/repos/rxn1d/courses/contributors","subscribers_url":"https://api.github.com/repos/rxn1d/courses/subscribers","subscription_url":"https://api.github.com/repos/rxn1d/courses/subscription","commits_url":"https://api.github.com/repos/rxn1d/courses/commits{/sha}","git_commits_url":"https://api.github.com/repos/rxn1d/courses/git/commits{/sha}","comments_url":"https://api.github.com/repos/rxn1d/courses/comments{/number}","issue_comment_url":"https://api.github.com/repos/rxn1d/courses/issues/comments{/number}","contents_url":"https://api.github.com/repos/rxn1d/courses/contents/{+path}","compare_url":"https://api.github.com/repos/rxn1d/courses/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rxn1d/courses/merges","archive_url":"https://api.github.com/repos/rxn1d/courses/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rxn1d/courses/downloads","issues_url":"https://api.github.com/repos/rxn1d/courses/issues{/number}","pulls_url":"https://api.github.com/repos/rxn1d/courses/pulls{/number}","milestones_url":"https://api.github.com/repos/rxn1d/courses/milestones{/number}","notifications_url":"https://api.github.com/repos/rxn1d/courses/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rxn1d/courses/labels{/name}","releases_url":"https://api.github.com/repos/rxn1d/courses/releases{/id}","deployments_url":"https://api.github.com/repos/rxn1d/courses/deployments","created_at":"2016-01-25T18:50:28Z","updated_at":"2016-05-15T10:32:25Z","pushed_at":"2016-05-15T21:31:57Z","git_url":"git://github.com/rxn1d/courses.git","ssh_url":"git@github.com:rxn1d/courses.git","clone_url":"https://github.com/rxn1d/courses.git","svn_url":"https://github.com/rxn1d/courses","homepage":null,"size":3051,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":3,"forks":8,"open_issues":3,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rxn1d/courses/pulls/39"},"html":{"href":"https://github.com/rxn1d/courses/pull/39"},"issue":{"href":"https://api.github.com/repos/rxn1d/courses/issues/39"},"comments":{"href":"https://api.github.com/repos/rxn1d/courses/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/rxn1d/courses/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/rxn1d/courses/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rxn1d/courses/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/rxn1d/courses/statuses/69479249d1483261a76152409ce9d28f4a79ecd7"}}}}