{"action":"created","comment":{"url":"https://api.github.com/repos/adamkral12/PA165/pulls/comments/236223816","pull_request_review_id":178250842,"id":236223816,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjIyMzgxNg==","diff_hunk":"@@ -0,0 +1,136 @@\n+package cz.fi.muni.pa165.secretagency.service.facade;\n+\n+import cz.fi.muni.pa165.secretagency.dto.MissionCreateDTO;\n+import cz.fi.muni.pa165.secretagency.dto.MissionDTO;\n+import cz.fi.muni.pa165.secretagency.entity.Mission;\n+import cz.fi.muni.pa165.secretagency.enums.MissionTypeEnum;\n+import cz.fi.muni.pa165.secretagency.facade.MissionFacade;\n+import cz.fi.muni.pa165.secretagency.service.BeanMappingService;\n+import cz.fi.muni.pa165.secretagency.service.MissionService;\n+import cz.fi.muni.pa165.secretagency.service.config.ServiceConfiguration;\n+import org.mockito.InjectMocks;\n+import org.mockito.Mock;\n+import org.mockito.MockitoAnnotations;\n+import org.mockito.Spy;\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.test.context.ContextConfiguration;\n+import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;\n+import org.testng.Assert;\n+import org.testng.annotations.BeforeMethod;\n+import org.testng.annotations.Test;\n+\n+import java.time.LocalDate;\n+import java.util.Arrays;\n+import java.util.Collections;\n+import java.util.List;\n+\n+import static org.mockito.Mockito.verify;\n+import static org.mockito.Mockito.when;\n+\n+/**\n+ * Tests for mission facade.\n+ * @author Adam Skurla (487588)\n+ */\n+@ContextConfiguration(classes = ServiceConfiguration.class)\n+public class MissionFacadeTest extends AbstractTestNGSpringContextTests {\n+\n+    @Spy\n+    @Autowired\n+    private BeanMappingService beanMappingService;\n+\n+    @Mock\n+    private MissionService missionService;\n+\n+    @InjectMocks\n+    private MissionFacade missionFacade = new MissionFacadeImpl();\n+\n+    private Mission mission1;\n+    private Mission mission2;\n+\n+    @BeforeMethod\n+    public void setEntities() {\n+        mission1 = new Mission();\n+        mission1.setLatitude(14.315424);\n+        mission1.setLongitude(108.339537);\n+        mission1.setStarted(LocalDate.of(1952, 1, 1));\n+        mission1.setEnded(LocalDate.of(1975, 4, 30));\n+        mission1.setMissionType(MissionTypeEnum.ESPIONAGE);\n+\n+        mission2 = new Mission();\n+        mission2.setLatitude(34.543896);\n+        mission2.setLongitude(69.160652);\n+        mission2.setStarted(LocalDate.of(2001, 5, 5));\n+        mission2.setMissionType(MissionTypeEnum.ASSASSINATION);\n+\n+        MockitoAnnotations.initMocks(this);\n+    }\n+\n+    @Test\n+    public void getByIdTest() {\n+        when(missionService.getEntityById(mission1.getId())).thenReturn(mission1);\n+        MissionDTO missionDTO = missionFacade.getMissionById(mission1.getId());\n+        Assert.assertEquals(mission1, beanMappingService.mapTo(missionDTO, Mission.class));\n+    }\n+\n+    @Test\n+    public void getAllTest() {\n+        when(missionService.getAll()).thenReturn(Arrays.asList(mission1, mission2));\n+        List<MissionDTO> missionDTOS = missionFacade.getAllMissions();\n+        List<Mission> missions = beanMappingService.mapTo(missionDTOS, Mission.class);\n+        Assert.assertEquals(missions.size(), 2);\n+        Assert.assertTrue(missions.contains(mission1));\n+        Assert.assertTrue(missions.contains(mission2));\n+    }\n+\n+    @Test\n+    public void createTest() {\n+        /* MissionCreateDTO missionCreateDTO = new MissionCreateDTO();","path":"Secret-agency-service/src/test/java/cz/fi/muni/pa165/secretagency/service/facade/MissionFacadeTest.java","position":87,"original_position":87,"commit_id":"3666c99cbac49dc70d6353098e44d9287c5b8b08","original_commit_id":"3666c99cbac49dc70d6353098e44d9287c5b8b08","user":{"login":"jotyx","id":23653125,"node_id":"MDQ6VXNlcjIzNjUzMTI1","avatar_url":"https://avatars2.githubusercontent.com/u/23653125?v=4","gravatar_id":"","url":"https://api.github.com/users/jotyx","html_url":"https://github.com/jotyx","followers_url":"https://api.github.com/users/jotyx/followers","following_url":"https://api.github.com/users/jotyx/following{/other_user}","gists_url":"https://api.github.com/users/jotyx/gists{/gist_id}","starred_url":"https://api.github.com/users/jotyx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jotyx/subscriptions","organizations_url":"https://api.github.com/users/jotyx/orgs","repos_url":"https://api.github.com/users/jotyx/repos","events_url":"https://api.github.com/users/jotyx/events{/privacy}","received_events_url":"https://api.github.com/users/jotyx/received_events","type":"User","site_admin":false},"body":"A dostávam tento error:\r\n\r\n`1) The destination property cz.fi.muni.pa165.secretagency.entity.Mission.setId() matches multiple source property hierarchies:`","created_at":"2018-11-26T11:51:55Z","updated_at":"2018-11-26T11:51:56Z","html_url":"https://github.com/adamkral12/PA165/pull/73#discussion_r236223816","pull_request_url":"https://api.github.com/repos/adamkral12/PA165/pulls/73","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/adamkral12/PA165/pulls/comments/236223816"},"html":{"href":"https://github.com/adamkral12/PA165/pull/73#discussion_r236223816"},"pull_request":{"href":"https://api.github.com/repos/adamkral12/PA165/pulls/73"}},"in_reply_to_id":236093726},"pull_request":{"url":"https://api.github.com/repos/adamkral12/PA165/pulls/73","id":233404235,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzNDA0MjM1","html_url":"https://github.com/adamkral12/PA165/pull/73","diff_url":"https://github.com/adamkral12/PA165/pull/73.diff","patch_url":"https://github.com/adamkral12/PA165/pull/73.patch","issue_url":"https://api.github.com/repos/adamkral12/PA165/issues/73","number":73,"state":"open","locked":false,"title":"As/mission facade tests","user":{"login":"jotyx","id":23653125,"node_id":"MDQ6VXNlcjIzNjUzMTI1","avatar_url":"https://avatars2.githubusercontent.com/u/23653125?v=4","gravatar_id":"","url":"https://api.github.com/users/jotyx","html_url":"https://github.com/jotyx","followers_url":"https://api.github.com/users/jotyx/followers","following_url":"https://api.github.com/users/jotyx/following{/other_user}","gists_url":"https://api.github.com/users/jotyx/gists{/gist_id}","starred_url":"https://api.github.com/users/jotyx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jotyx/subscriptions","organizations_url":"https://api.github.com/users/jotyx/orgs","repos_url":"https://api.github.com/users/jotyx/repos","events_url":"https://api.github.com/users/jotyx/events{/privacy}","received_events_url":"https://api.github.com/users/jotyx/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-25T22:09:06Z","updated_at":"2018-11-26T11:51:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68e7e3a6b5b2fa33aa38ac4ff0e41cf7b2e35053","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/adamkral12/PA165/pulls/73/commits","review_comments_url":"https://api.github.com/repos/adamkral12/PA165/pulls/73/comments","review_comment_url":"https://api.github.com/repos/adamkral12/PA165/pulls/comments{/number}","comments_url":"https://api.github.com/repos/adamkral12/PA165/issues/73/comments","statuses_url":"https://api.github.com/repos/adamkral12/PA165/statuses/3666c99cbac49dc70d6353098e44d9287c5b8b08","head":{"label":"adamkral12:as/MissionFacadeTests","ref":"as/MissionFacadeTests","sha":"3666c99cbac49dc70d6353098e44d9287c5b8b08","user":{"login":"adamkral12","id":23063691,"node_id":"MDQ6VXNlcjIzMDYzNjkx","avatar_url":"https://avatars1.githubusercontent.com/u/23063691?v=4","gravatar_id":"","url":"https://api.github.com/users/adamkral12","html_url":"https://github.com/adamkral12","followers_url":"https://api.github.com/users/adamkral12/followers","following_url":"https://api.github.com/users/adamkral12/following{/other_user}","gists_url":"https://api.github.com/users/adamkral12/gists{/gist_id}","starred_url":"https://api.github.com/users/adamkral12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamkral12/subscriptions","organizations_url":"https://api.github.com/users/adamkral12/orgs","repos_url":"https://api.github.com/users/adamkral12/repos","events_url":"https://api.github.com/users/adamkral12/events{/privacy}","received_events_url":"https://api.github.com/users/adamkral12/received_events","type":"User","site_admin":false},"repo":{"id":149251206,"node_id":"MDEwOlJlcG9zaXRvcnkxNDkyNTEyMDY=","name":"PA165","full_name":"adamkral12/PA165","private":false,"owner":{"login":"adamkral12","id":23063691,"node_id":"MDQ6VXNlcjIzMDYzNjkx","avatar_url":"https://avatars1.githubusercontent.com/u/23063691?v=4","gravatar_id":"","url":"https://api.github.com/users/adamkral12","html_url":"https://github.com/adamkral12","followers_url":"https://api.github.com/users/adamkral12/followers","following_url":"https://api.github.com/users/adamkral12/following{/other_user}","gists_url":"https://api.github.com/users/adamkral12/gists{/gist_id}","starred_url":"https://api.github.com/users/adamkral12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamkral12/subscriptions","organizations_url":"https://api.github.com/users/adamkral12/orgs","repos_url":"https://api.github.com/users/adamkral12/repos","events_url":"https://api.github.com/users/adamkral12/events{/privacy}","received_events_url":"https://api.github.com/users/adamkral12/received_events","type":"User","site_admin":false},"html_url":"https://github.com/adamkral12/PA165","description":"PA165 2018 seminar","fork":false,"url":"https://api.github.com/repos/adamkral12/PA165","forks_url":"https://api.github.com/repos/adamkral12/PA165/forks","keys_url":"https://api.github.com/repos/adamkral12/PA165/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adamkral12/PA165/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adamkral12/PA165/teams","hooks_url":"https://api.github.com/repos/adamkral12/PA165/hooks","issue_events_url":"https://api.github.com/repos/adamkral12/PA165/issues/events{/number}","events_url":"https://api.github.com/repos/adamkral12/PA165/events","assignees_url":"https://api.github.com/repos/adamkral12/PA165/assignees{/user}","branches_url":"https://api.github.com/repos/adamkral12/PA165/branches{/branch}","tags_url":"https://api.github.com/repos/adamkral12/PA165/tags","blobs_url":"https://api.github.com/repos/adamkral12/PA165/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adamkral12/PA165/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adamkral12/PA165/git/refs{/sha}","trees_url":"https://api.github.com/repos/adamkral12/PA165/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adamkral12/PA165/statuses/{sha}","languages_url":"https://api.github.com/repos/adamkral12/PA165/languages","stargazers_url":"https://api.github.com/repos/adamkral12/PA165/stargazers","contributors_url":"https://api.github.com/repos/adamkral12/PA165/contributors","subscribers_url":"https://api.github.com/repos/adamkral12/PA165/subscribers","subscription_url":"https://api.github.com/repos/adamkral12/PA165/subscription","commits_url":"https://api.github.com/repos/adamkral12/PA165/commits{/sha}","git_commits_url":"https://api.github.com/repos/adamkral12/PA165/git/commits{/sha}","comments_url":"https://api.github.com/repos/adamkral12/PA165/comments{/number}","issue_comment_url":"https://api.github.com/repos/adamkral12/PA165/issues/comments{/number}","contents_url":"https://api.github.com/repos/adamkral12/PA165/contents/{+path}","compare_url":"https://api.github.com/repos/adamkral12/PA165/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adamkral12/PA165/merges","archive_url":"https://api.github.com/repos/adamkral12/PA165/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adamkral12/PA165/downloads","issues_url":"https://api.github.com/repos/adamkral12/PA165/issues{/number}","pulls_url":"https://api.github.com/repos/adamkral12/PA165/pulls{/number}","milestones_url":"https://api.github.com/repos/adamkral12/PA165/milestones{/number}","notifications_url":"https://api.github.com/repos/adamkral12/PA165/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adamkral12/PA165/labels{/name}","releases_url":"https://api.github.com/repos/adamkral12/PA165/releases{/id}","deployments_url":"https://api.github.com/repos/adamkral12/PA165/deployments","created_at":"2018-09-18T08:05:39Z","updated_at":"2018-11-25T22:31:57Z","pushed_at":"2018-11-25T22:31:55Z","git_url":"git://github.com/adamkral12/PA165.git","ssh_url":"git@github.com:adamkral12/PA165.git","clone_url":"https://github.com/adamkral12/PA165.git","svn_url":"https://github.com/adamkral12/PA165","homepage":null,"size":273,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":6,"license":null,"forks":1,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"adamkral12:master","ref":"master","sha":"d8bc88254a0ef7128c47f296d0c15c0888a061b7","user":{"login":"adamkral12","id":23063691,"node_id":"MDQ6VXNlcjIzMDYzNjkx","avatar_url":"https://avatars1.githubusercontent.com/u/23063691?v=4","gravatar_id":"","url":"https://api.github.com/users/adamkral12","html_url":"https://github.com/adamkral12","followers_url":"https://api.github.com/users/adamkral12/followers","following_url":"https://api.github.com/users/adamkral12/following{/other_user}","gists_url":"https://api.github.com/users/adamkral12/gists{/gist_id}","starred_url":"https://api.github.com/users/adamkral12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamkral12/subscriptions","organizations_url":"https://api.github.com/users/adamkral12/orgs","repos_url":"https://api.github.com/users/adamkral12/repos","events_url":"https://api.github.com/users/adamkral12/events{/privacy}","received_events_url":"https://api.github.com/users/adamkral12/received_events","type":"User","site_admin":false},"repo":{"id":149251206,"node_id":"MDEwOlJlcG9zaXRvcnkxNDkyNTEyMDY=","name":"PA165","full_name":"adamkral12/PA165","private":false,"owner":{"login":"adamkral12","id":23063691,"node_id":"MDQ6VXNlcjIzMDYzNjkx","avatar_url":"https://avatars1.githubusercontent.com/u/23063691?v=4","gravatar_id":"","url":"https://api.github.com/users/adamkral12","html_url":"https://github.com/adamkral12","followers_url":"https://api.github.com/users/adamkral12/followers","following_url":"https://api.github.com/users/adamkral12/following{/other_user}","gists_url":"https://api.github.com/users/adamkral12/gists{/gist_id}","starred_url":"https://api.github.com/users/adamkral12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamkral12/subscriptions","organizations_url":"https://api.github.com/users/adamkral12/orgs","repos_url":"https://api.github.com/users/adamkral12/repos","events_url":"https://api.github.com/users/adamkral12/events{/privacy}","received_events_url":"https://api.github.com/users/adamkral12/received_events","type":"User","site_admin":false},"html_url":"https://github.com/adamkral12/PA165","description":"PA165 2018 seminar","fork":false,"url":"https://api.github.com/repos/adamkral12/PA165","forks_url":"https://api.github.com/repos/adamkral12/PA165/forks","keys_url":"https://api.github.com/repos/adamkral12/PA165/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adamkral12/PA165/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adamkral12/PA165/teams","hooks_url":"https://api.github.com/repos/adamkral12/PA165/hooks","issue_events_url":"https://api.github.com/repos/adamkral12/PA165/issues/events{/number}","events_url":"https://api.github.com/repos/adamkral12/PA165/events","assignees_url":"https://api.github.com/repos/adamkral12/PA165/assignees{/user}","branches_url":"https://api.github.com/repos/adamkral12/PA165/branches{/branch}","tags_url":"https://api.github.com/repos/adamkral12/PA165/tags","blobs_url":"https://api.github.com/repos/adamkral12/PA165/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adamkral12/PA165/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adamkral12/PA165/git/refs{/sha}","trees_url":"https://api.github.com/repos/adamkral12/PA165/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adamkral12/PA165/statuses/{sha}","languages_url":"https://api.github.com/repos/adamkral12/PA165/languages","stargazers_url":"https://api.github.com/repos/adamkral12/PA165/stargazers","contributors_url":"https://api.github.com/repos/adamkral12/PA165/contributors","subscribers_url":"https://api.github.com/repos/adamkral12/PA165/subscribers","subscription_url":"https://api.github.com/repos/adamkral12/PA165/subscription","commits_url":"https://api.github.com/repos/adamkral12/PA165/commits{/sha}","git_commits_url":"https://api.github.com/repos/adamkral12/PA165/git/commits{/sha}","comments_url":"https://api.github.com/repos/adamkral12/PA165/comments{/number}","issue_comment_url":"https://api.github.com/repos/adamkral12/PA165/issues/comments{/number}","contents_url":"https://api.github.com/repos/adamkral12/PA165/contents/{+path}","compare_url":"https://api.github.com/repos/adamkral12/PA165/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adamkral12/PA165/merges","archive_url":"https://api.github.com/repos/adamkral12/PA165/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adamkral12/PA165/downloads","issues_url":"https://api.github.com/repos/adamkral12/PA165/issues{/number}","pulls_url":"https://api.github.com/repos/adamkral12/PA165/pulls{/number}","milestones_url":"https://api.github.com/repos/adamkral12/PA165/milestones{/number}","notifications_url":"https://api.github.com/repos/adamkral12/PA165/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adamkral12/PA165/labels{/name}","releases_url":"https://api.github.com/repos/adamkral12/PA165/releases{/id}","deployments_url":"https://api.github.com/repos/adamkral12/PA165/deployments","created_at":"2018-09-18T08:05:39Z","updated_at":"2018-11-25T22:31:57Z","pushed_at":"2018-11-25T22:31:55Z","git_url":"git://github.com/adamkral12/PA165.git","ssh_url":"git@github.com:adamkral12/PA165.git","clone_url":"https://github.com/adamkral12/PA165.git","svn_url":"https://github.com/adamkral12/PA165","homepage":null,"size":273,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":6,"license":null,"forks":1,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/adamkral12/PA165/pulls/73"},"html":{"href":"https://github.com/adamkral12/PA165/pull/73"},"issue":{"href":"https://api.github.com/repos/adamkral12/PA165/issues/73"},"comments":{"href":"https://api.github.com/repos/adamkral12/PA165/issues/73/comments"},"review_comments":{"href":"https://api.github.com/repos/adamkral12/PA165/pulls/73/comments"},"review_comment":{"href":"https://api.github.com/repos/adamkral12/PA165/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/adamkral12/PA165/pulls/73/commits"},"statuses":{"href":"https://api.github.com/repos/adamkral12/PA165/statuses/3666c99cbac49dc70d6353098e44d9287c5b8b08"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"jotyx"}}