{"action":"created","comment":{"url":"https://api.github.com/repos/Holdo/travel-agency/pulls/comments/43486536","id":43486536,"diff_hunk":"@@ -0,0 +1,109 @@\n+package cz.fi.muni.pa165.travelagency.dao;\n+\n+import cz.fi.muni.pa165.travelagency.EmbeddedDatabaseSpringConfig;\n+import cz.fi.muni.pa165.travelagency.entity.Customer;\n+import cz.fi.muni.pa165.travelagency.entity.Excursion;\n+import cz.fi.muni.pa165.travelagency.entity.Reservation;\n+import cz.fi.muni.pa165.travelagency.entity.Trip;\n+import java.math.BigDecimal;\n+import java.sql.Date;\n+import java.text.SimpleDateFormat;\n+import java.util.HashSet;\n+import java.util.Set;\n+import javax.persistence.EntityManager;\n+import javax.persistence.PersistenceContext;\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.test.context.ContextConfiguration;\n+import org.springframework.test.context.TestExecutionListeners;\n+import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;\n+import org.springframework.test.context.support.DirtiesContextTestExecutionListener;\n+import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;\n+import org.springframework.test.context.transaction.TransactionalTestExecutionListener;\n+import org.springframework.transaction.annotation.Transactional;\n+import org.testng.Assert;\n+import org.testng.annotations.BeforeMethod;\n+import org.testng.annotations.Test;\n+\n+/**\n+ *\n+ * @author Diana Vilkolakova\n+ */\n+@ContextConfiguration(locations = \"/SpringXMLConfig.xml\")\n+@TestExecutionListeners(inheritListeners = false, listeners = {DependencyInjectionTestExecutionListener.class, DirtiesContextTestExecutionListener.class, TransactionalTestExecutionListener.class})\n+@Transactional\n+public class ReservationDaoTest extends AbstractTestNGSpringContextTests {\n+\n+    @PersistenceContext\n+    private EntityManager em;\n+\n+    @Autowired\n+    private ReservationDao reservationDao;\n+\n+    private Reservation reservation;\n+    private Customer customer;\n+    private Trip trip1;\n+    private Trip trip2;\n+    private final BigDecimal price = new BigDecimal(5000);\n+\n+    @BeforeMethod\n+    public void createReservations() {\n+        reservation = new Reservation();\n+        customer = new Customer();\n+        \n+        String dateFromFormat = \"2000-11-01\"; ","path":"travel-agency-persistence/src/test/java/cz/fi/muni/pa165/travelagency/dao/ReservationDaoTest.java","position":53,"original_position":53,"commit_id":"f7329af2a873dfb3d1d12b543cc1f91e2c7b344e","original_commit_id":"f7329af2a873dfb3d1d12b543cc1f91e2c7b344e","user":{"login":"Holdo","id":10115368,"avatar_url":"https://avatars.githubusercontent.com/u/10115368?v=3","gravatar_id":"","url":"https://api.github.com/users/Holdo","html_url":"https://github.com/Holdo","followers_url":"https://api.github.com/users/Holdo/followers","following_url":"https://api.github.com/users/Holdo/following{/other_user}","gists_url":"https://api.github.com/users/Holdo/gists{/gist_id}","starred_url":"https://api.github.com/users/Holdo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Holdo/subscriptions","organizations_url":"https://api.github.com/users/Holdo/orgs","repos_url":"https://api.github.com/users/Holdo/repos","events_url":"https://api.github.com/users/Holdo/events{/privacy}","received_events_url":"https://api.github.com/users/Holdo/received_events","type":"User","site_admin":false},"body":"dateFromFormat premenuj na date","created_at":"2015-10-30T10:00:31Z","updated_at":"2015-10-30T10:00:31Z","html_url":"https://github.com/Holdo/travel-agency/pull/2#discussion_r43486536","pull_request_url":"https://api.github.com/repos/Holdo/travel-agency/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/Holdo/travel-agency/pulls/comments/43486536"},"html":{"href":"https://github.com/Holdo/travel-agency/pull/2#discussion_r43486536"},"pull_request":{"href":"https://api.github.com/repos/Holdo/travel-agency/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/Holdo/travel-agency/pulls/2","id":49203491,"html_url":"https://github.com/Holdo/travel-agency/pull/2","diff_url":"https://github.com/Holdo/travel-agency/pull/2.diff","patch_url":"https://github.com/Holdo/travel-agency/pull/2.patch","issue_url":"https://api.github.com/repos/Holdo/travel-agency/issues/2","number":2,"state":"open","locked":false,"title":"Reservation and ReservationDaoTest added","user":{"login":"Skyllarr","id":15111558,"avatar_url":"https://avatars.githubusercontent.com/u/15111558?v=3","gravatar_id":"","url":"https://api.github.com/users/Skyllarr","html_url":"https://github.com/Skyllarr","followers_url":"https://api.github.com/users/Skyllarr/followers","following_url":"https://api.github.com/users/Skyllarr/following{/other_user}","gists_url":"https://api.github.com/users/Skyllarr/gists{/gist_id}","starred_url":"https://api.github.com/users/Skyllarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skyllarr/subscriptions","organizations_url":"https://api.github.com/users/Skyllarr/orgs","repos_url":"https://api.github.com/users/Skyllarr/repos","events_url":"https://api.github.com/users/Skyllarr/events{/privacy}","received_events_url":"https://api.github.com/users/Skyllarr/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-29T21:35:19Z","updated_at":"2015-10-30T10:00:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b6f67f06aba810591487d461cea3d9568767f1e9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Holdo/travel-agency/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Holdo/travel-agency/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Holdo/travel-agency/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Holdo/travel-agency/issues/2/comments","statuses_url":"https://api.github.com/repos/Holdo/travel-agency/statuses/f7329af2a873dfb3d1d12b543cc1f91e2c7b344e","head":{"label":"Skyllarr:reservationTest","ref":"reservationTest","sha":"f7329af2a873dfb3d1d12b543cc1f91e2c7b344e","user":{"login":"Skyllarr","id":15111558,"avatar_url":"https://avatars.githubusercontent.com/u/15111558?v=3","gravatar_id":"","url":"https://api.github.com/users/Skyllarr","html_url":"https://github.com/Skyllarr","followers_url":"https://api.github.com/users/Skyllarr/followers","following_url":"https://api.github.com/users/Skyllarr/following{/other_user}","gists_url":"https://api.github.com/users/Skyllarr/gists{/gist_id}","starred_url":"https://api.github.com/users/Skyllarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skyllarr/subscriptions","organizations_url":"https://api.github.com/users/Skyllarr/orgs","repos_url":"https://api.github.com/users/Skyllarr/repos","events_url":"https://api.github.com/users/Skyllarr/events{/privacy}","received_events_url":"https://api.github.com/users/Skyllarr/received_events","type":"User","site_admin":false},"repo":{"id":45178747,"name":"travel-agency","full_name":"Skyllarr/travel-agency","owner":{"login":"Skyllarr","id":15111558,"avatar_url":"https://avatars.githubusercontent.com/u/15111558?v=3","gravatar_id":"","url":"https://api.github.com/users/Skyllarr","html_url":"https://github.com/Skyllarr","followers_url":"https://api.github.com/users/Skyllarr/followers","following_url":"https://api.github.com/users/Skyllarr/following{/other_user}","gists_url":"https://api.github.com/users/Skyllarr/gists{/gist_id}","starred_url":"https://api.github.com/users/Skyllarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skyllarr/subscriptions","organizations_url":"https://api.github.com/users/Skyllarr/orgs","repos_url":"https://api.github.com/users/Skyllarr/repos","events_url":"https://api.github.com/users/Skyllarr/events{/privacy}","received_events_url":"https://api.github.com/users/Skyllarr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Skyllarr/travel-agency","description":"A system for online holidays booking.","fork":true,"url":"https://api.github.com/repos/Skyllarr/travel-agency","forks_url":"https://api.github.com/repos/Skyllarr/travel-agency/forks","keys_url":"https://api.github.com/repos/Skyllarr/travel-agency/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Skyllarr/travel-agency/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Skyllarr/travel-agency/teams","hooks_url":"https://api.github.com/repos/Skyllarr/travel-agency/hooks","issue_events_url":"https://api.github.com/repos/Skyllarr/travel-agency/issues/events{/number}","events_url":"https://api.github.com/repos/Skyllarr/travel-agency/events","assignees_url":"https://api.github.com/repos/Skyllarr/travel-agency/assignees{/user}","branches_url":"https://api.github.com/repos/Skyllarr/travel-agency/branches{/branch}","tags_url":"https://api.github.com/repos/Skyllarr/travel-agency/tags","blobs_url":"https://api.github.com/repos/Skyllarr/travel-agency/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Skyllarr/travel-agency/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Skyllarr/travel-agency/git/refs{/sha}","trees_url":"https://api.github.com/repos/Skyllarr/travel-agency/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Skyllarr/travel-agency/statuses/{sha}","languages_url":"https://api.github.com/repos/Skyllarr/travel-agency/languages","stargazers_url":"https://api.github.com/repos/Skyllarr/travel-agency/stargazers","contributors_url":"https://api.github.com/repos/Skyllarr/travel-agency/contributors","subscribers_url":"https://api.github.com/repos/Skyllarr/travel-agency/subscribers","subscription_url":"https://api.github.com/repos/Skyllarr/travel-agency/subscription","commits_url":"https://api.github.com/repos/Skyllarr/travel-agency/commits{/sha}","git_commits_url":"https://api.github.com/repos/Skyllarr/travel-agency/git/commits{/sha}","comments_url":"https://api.github.com/repos/Skyllarr/travel-agency/comments{/number}","issue_comment_url":"https://api.github.com/repos/Skyllarr/travel-agency/issues/comments{/number}","contents_url":"https://api.github.com/repos/Skyllarr/travel-agency/contents/{+path}","compare_url":"https://api.github.com/repos/Skyllarr/travel-agency/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Skyllarr/travel-agency/merges","archive_url":"https://api.github.com/repos/Skyllarr/travel-agency/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Skyllarr/travel-agency/downloads","issues_url":"https://api.github.com/repos/Skyllarr/travel-agency/issues{/number}","pulls_url":"https://api.github.com/repos/Skyllarr/travel-agency/pulls{/number}","milestones_url":"https://api.github.com/repos/Skyllarr/travel-agency/milestones{/number}","notifications_url":"https://api.github.com/repos/Skyllarr/travel-agency/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Skyllarr/travel-agency/labels{/name}","releases_url":"https://api.github.com/repos/Skyllarr/travel-agency/releases{/id}","created_at":"2015-10-29T11:24:45Z","updated_at":"2015-10-29T11:24:46Z","pushed_at":"2015-10-29T23:39:49Z","git_url":"git://github.com/Skyllarr/travel-agency.git","ssh_url":"git@github.com:Skyllarr/travel-agency.git","clone_url":"https://github.com/Skyllarr/travel-agency.git","svn_url":"https://github.com/Skyllarr/travel-agency","homepage":null,"size":0,"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":"Holdo:master","ref":"master","sha":"5ad60341433a9e214f754b58d885da3f4641de69","user":{"login":"Holdo","id":10115368,"avatar_url":"https://avatars.githubusercontent.com/u/10115368?v=3","gravatar_id":"","url":"https://api.github.com/users/Holdo","html_url":"https://github.com/Holdo","followers_url":"https://api.github.com/users/Holdo/followers","following_url":"https://api.github.com/users/Holdo/following{/other_user}","gists_url":"https://api.github.com/users/Holdo/gists{/gist_id}","starred_url":"https://api.github.com/users/Holdo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Holdo/subscriptions","organizations_url":"https://api.github.com/users/Holdo/orgs","repos_url":"https://api.github.com/users/Holdo/repos","events_url":"https://api.github.com/users/Holdo/events{/privacy}","received_events_url":"https://api.github.com/users/Holdo/received_events","type":"User","site_admin":false},"repo":{"id":44932057,"name":"travel-agency","full_name":"Holdo/travel-agency","owner":{"login":"Holdo","id":10115368,"avatar_url":"https://avatars.githubusercontent.com/u/10115368?v=3","gravatar_id":"","url":"https://api.github.com/users/Holdo","html_url":"https://github.com/Holdo","followers_url":"https://api.github.com/users/Holdo/followers","following_url":"https://api.github.com/users/Holdo/following{/other_user}","gists_url":"https://api.github.com/users/Holdo/gists{/gist_id}","starred_url":"https://api.github.com/users/Holdo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Holdo/subscriptions","organizations_url":"https://api.github.com/users/Holdo/orgs","repos_url":"https://api.github.com/users/Holdo/repos","events_url":"https://api.github.com/users/Holdo/events{/privacy}","received_events_url":"https://api.github.com/users/Holdo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Holdo/travel-agency","description":"A system for online holidays booking.","fork":false,"url":"https://api.github.com/repos/Holdo/travel-agency","forks_url":"https://api.github.com/repos/Holdo/travel-agency/forks","keys_url":"https://api.github.com/repos/Holdo/travel-agency/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Holdo/travel-agency/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Holdo/travel-agency/teams","hooks_url":"https://api.github.com/repos/Holdo/travel-agency/hooks","issue_events_url":"https://api.github.com/repos/Holdo/travel-agency/issues/events{/number}","events_url":"https://api.github.com/repos/Holdo/travel-agency/events","assignees_url":"https://api.github.com/repos/Holdo/travel-agency/assignees{/user}","branches_url":"https://api.github.com/repos/Holdo/travel-agency/branches{/branch}","tags_url":"https://api.github.com/repos/Holdo/travel-agency/tags","blobs_url":"https://api.github.com/repos/Holdo/travel-agency/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Holdo/travel-agency/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Holdo/travel-agency/git/refs{/sha}","trees_url":"https://api.github.com/repos/Holdo/travel-agency/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Holdo/travel-agency/statuses/{sha}","languages_url":"https://api.github.com/repos/Holdo/travel-agency/languages","stargazers_url":"https://api.github.com/repos/Holdo/travel-agency/stargazers","contributors_url":"https://api.github.com/repos/Holdo/travel-agency/contributors","subscribers_url":"https://api.github.com/repos/Holdo/travel-agency/subscribers","subscription_url":"https://api.github.com/repos/Holdo/travel-agency/subscription","commits_url":"https://api.github.com/repos/Holdo/travel-agency/commits{/sha}","git_commits_url":"https://api.github.com/repos/Holdo/travel-agency/git/commits{/sha}","comments_url":"https://api.github.com/repos/Holdo/travel-agency/comments{/number}","issue_comment_url":"https://api.github.com/repos/Holdo/travel-agency/issues/comments{/number}","contents_url":"https://api.github.com/repos/Holdo/travel-agency/contents/{+path}","compare_url":"https://api.github.com/repos/Holdo/travel-agency/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Holdo/travel-agency/merges","archive_url":"https://api.github.com/repos/Holdo/travel-agency/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Holdo/travel-agency/downloads","issues_url":"https://api.github.com/repos/Holdo/travel-agency/issues{/number}","pulls_url":"https://api.github.com/repos/Holdo/travel-agency/pulls{/number}","milestones_url":"https://api.github.com/repos/Holdo/travel-agency/milestones{/number}","notifications_url":"https://api.github.com/repos/Holdo/travel-agency/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Holdo/travel-agency/labels{/name}","releases_url":"https://api.github.com/repos/Holdo/travel-agency/releases{/id}","created_at":"2015-10-25T22:03:27Z","updated_at":"2015-10-25T22:51:07Z","pushed_at":"2015-10-30T01:33:29Z","git_url":"git://github.com/Holdo/travel-agency.git","ssh_url":"git@github.com:Holdo/travel-agency.git","clone_url":"https://github.com/Holdo/travel-agency.git","svn_url":"https://github.com/Holdo/travel-agency","homepage":null,"size":0,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Holdo/travel-agency/pulls/2"},"html":{"href":"https://github.com/Holdo/travel-agency/pull/2"},"issue":{"href":"https://api.github.com/repos/Holdo/travel-agency/issues/2"},"comments":{"href":"https://api.github.com/repos/Holdo/travel-agency/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Holdo/travel-agency/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Holdo/travel-agency/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Holdo/travel-agency/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Holdo/travel-agency/statuses/f7329af2a873dfb3d1d12b543cc1f91e2c7b344e"}}}}