{"action":"created","comment":{"url":"https://api.github.com/repos/Danila5803/TestSpringWeb/pulls/comments/262079589","pull_request_review_id":210163602,"id":262079589,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2MjA3OTU4OQ==","diff_hunk":"@@ -90,43 +82,116 @@ public void delete() {\n     @Test\n     public void saveFestival() throws Exception {\n         String url = \"/festival\";\n-        jsonOne = mapper.writeValueAsString(festivalDTOOne);\n+        String jsonOne = mapper.writeValueAsString(festivalDTOOne);\n \n         MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.post(url)\n                 .contentType(MediaType.APPLICATION_JSON)\n                 .content(jsonOne))\n+                .andExpect(status().isOk())\n                 .andDo(print())\n                 .andReturn();\n \n-        int status = mvcResult.getResponse().getStatus();\n-        assertEquals(201, status);\n-\n-        String content = mvcResult.getResponse().getContentAsString();\n+        String json = mvcResult.getResponse().getContentAsString();\n+        FestivalDTO actual = mapper.readValue(json, FestivalDTO.class);\n+        FestivalDTO expected = festivalMapper.convertToDto(festivalRepository.findAll().get(0));\n \n-        assertEquals(content, jsonOne);\n+        Assertions.assertThat(expected).isEqualToIgnoringGivenFields(actual, \"activityId\");\n     }\n \n     @Test\n     public void getAllFestival() throws Exception {\n-        String uri = \"/festival\";\n-        MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.get(uri)\n+        String url = \"/festival\";\n+\n+        festivalRepository.save(festivalMapper.convertToEntity(festivalDTOOne));\n+        festivalRepository.save(festivalMapper.convertToEntity(festivalDTOTwo));\n+\n+        MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.get(url)\n                 .contentType(MediaType.APPLICATION_JSON))\n-                .andExpect(jsonPath(\"$\", hasSize(4)))\n+                .andExpect(jsonPath(\"$\", hasSize(2)))\n+                .andExpect(status().isOk())\n                 .andDo(print())\n                 .andReturn();\n \n-        int status = mvcResult.getResponse().getStatus();\n-        assertEquals(200, status);\n+        List<FestivalDTO> expected = festivalMapper.convertToDto(festivalRepository.findAll());\n+\n+        String json = mvcResult.getResponse().getContentAsString();\n+\n+        List<FestivalDTO> actual = mapper\n+                .readValue(json, new TypeReference<List<FestivalDTO>>() {\n+                });\n \n-        int size = mvcResult.getResponse().getContentLength();\n-        assertTrue(size > 0);\n+        Assertions.assertThat(expected.size()).isEqualTo(actual.size());\n+        Assertions.assertThat(expected).usingFieldByFieldElementComparator().containsAll(actual);\n     }\n \n     @Test\n-    public void deleteShow() throws Exception {\n-        String uri = \"festival/3\";\n-        mvc.perform(MockMvcRequestBuilders.delete(uri))\n+    public void deleteFestival() throws Exception {\n+        Festival festival = festivalRepository.save(festivalMapper.convertToEntity(festivalDTOTwo));\n+\n+        String url = String.format(\"/festival/%d\", festival.getActivityId());\n+\n+        mvc.perform(MockMvcRequestBuilders.delete(url)\n+                .contentType(MediaType.APPLICATION_JSON))\n+                .andExpect(status().isOk())\n+                .andDo(print());\n+    }\n+\n+    @Test\n+    public void editFestival() throws Exception {\n+        Festival festival = festivalRepository.save(festivalMapper.convertToEntity(festivalDTOOne));\n+\n+        String url = String.format(\"/festival/%d\", festival.getActivityId());\n+\n+        festivalDTOOne.setTitle(\"gfdsc\");\n+\n+        MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.put(url)","path":"src/test/java/tinkoff/activity/activityCollector/controller/FestivalControllerTest.java","position":147,"original_position":157,"commit_id":"21498b1f2d6c2b90376435db5299a9b02cce50d0","original_commit_id":"21498b1f2d6c2b90376435db5299a9b02cce50d0","user":{"login":"TuvaevAndrey","id":20026064,"node_id":"MDQ6VXNlcjIwMDI2MDY0","avatar_url":"https://avatars3.githubusercontent.com/u/20026064?v=4","gravatar_id":"","url":"https://api.github.com/users/TuvaevAndrey","html_url":"https://github.com/TuvaevAndrey","followers_url":"https://api.github.com/users/TuvaevAndrey/followers","following_url":"https://api.github.com/users/TuvaevAndrey/following{/other_user}","gists_url":"https://api.github.com/users/TuvaevAndrey/gists{/gist_id}","starred_url":"https://api.github.com/users/TuvaevAndrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TuvaevAndrey/subscriptions","organizations_url":"https://api.github.com/users/TuvaevAndrey/orgs","repos_url":"https://api.github.com/users/TuvaevAndrey/repos","events_url":"https://api.github.com/users/TuvaevAndrey/events{/privacy}","received_events_url":"https://api.github.com/users/TuvaevAndrey/received_events","type":"User","site_admin":false},"body":"put(\"/festival/{id}\",festival.getActivityId())","created_at":"2019-03-04T14:27:56Z","updated_at":"2019-03-04T14:34:06Z","html_url":"https://github.com/Danila5803/TestSpringWeb/pull/1#discussion_r262079589","pull_request_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/pulls/1","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Danila5803/TestSpringWeb/pulls/comments/262079589"},"html":{"href":"https://github.com/Danila5803/TestSpringWeb/pull/1#discussion_r262079589"},"pull_request":{"href":"https://api.github.com/repos/Danila5803/TestSpringWeb/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/Danila5803/TestSpringWeb/pulls/1","id":257128605,"node_id":"MDExOlB1bGxSZXF1ZXN0MjU3MTI4NjA1","html_url":"https://github.com/Danila5803/TestSpringWeb/pull/1","diff_url":"https://github.com/Danila5803/TestSpringWeb/pull/1.diff","patch_url":"https://github.com/Danila5803/TestSpringWeb/pull/1.patch","issue_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/issues/1","number":1,"state":"open","locked":false,"title":"add scheme, CRUD api","user":{"login":"Danila5803","id":43188845,"node_id":"MDQ6VXNlcjQzMTg4ODQ1","avatar_url":"https://avatars0.githubusercontent.com/u/43188845?v=4","gravatar_id":"","url":"https://api.github.com/users/Danila5803","html_url":"https://github.com/Danila5803","followers_url":"https://api.github.com/users/Danila5803/followers","following_url":"https://api.github.com/users/Danila5803/following{/other_user}","gists_url":"https://api.github.com/users/Danila5803/gists{/gist_id}","starred_url":"https://api.github.com/users/Danila5803/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Danila5803/subscriptions","organizations_url":"https://api.github.com/users/Danila5803/orgs","repos_url":"https://api.github.com/users/Danila5803/repos","events_url":"https://api.github.com/users/Danila5803/events{/privacy}","received_events_url":"https://api.github.com/users/Danila5803/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-02-28T16:02:46Z","updated_at":"2019-03-04T14:34:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3d729068c070737c3915add18e6efae07af52ba5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/pulls/1/commits","review_comments_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/pulls/1/comments","review_comment_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/issues/1/comments","statuses_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/statuses/21498b1f2d6c2b90376435db5299a9b02cce50d0","head":{"label":"Danila5803:develop","ref":"develop","sha":"21498b1f2d6c2b90376435db5299a9b02cce50d0","user":{"login":"Danila5803","id":43188845,"node_id":"MDQ6VXNlcjQzMTg4ODQ1","avatar_url":"https://avatars0.githubusercontent.com/u/43188845?v=4","gravatar_id":"","url":"https://api.github.com/users/Danila5803","html_url":"https://github.com/Danila5803","followers_url":"https://api.github.com/users/Danila5803/followers","following_url":"https://api.github.com/users/Danila5803/following{/other_user}","gists_url":"https://api.github.com/users/Danila5803/gists{/gist_id}","starred_url":"https://api.github.com/users/Danila5803/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Danila5803/subscriptions","organizations_url":"https://api.github.com/users/Danila5803/orgs","repos_url":"https://api.github.com/users/Danila5803/repos","events_url":"https://api.github.com/users/Danila5803/events{/privacy}","received_events_url":"https://api.github.com/users/Danila5803/received_events","type":"User","site_admin":false},"repo":{"id":173136674,"node_id":"MDEwOlJlcG9zaXRvcnkxNzMxMzY2NzQ=","name":"TestSpringWeb","full_name":"Danila5803/TestSpringWeb","private":false,"owner":{"login":"Danila5803","id":43188845,"node_id":"MDQ6VXNlcjQzMTg4ODQ1","avatar_url":"https://avatars0.githubusercontent.com/u/43188845?v=4","gravatar_id":"","url":"https://api.github.com/users/Danila5803","html_url":"https://github.com/Danila5803","followers_url":"https://api.github.com/users/Danila5803/followers","following_url":"https://api.github.com/users/Danila5803/following{/other_user}","gists_url":"https://api.github.com/users/Danila5803/gists{/gist_id}","starred_url":"https://api.github.com/users/Danila5803/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Danila5803/subscriptions","organizations_url":"https://api.github.com/users/Danila5803/orgs","repos_url":"https://api.github.com/users/Danila5803/repos","events_url":"https://api.github.com/users/Danila5803/events{/privacy}","received_events_url":"https://api.github.com/users/Danila5803/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Danila5803/TestSpringWeb","description":null,"fork":false,"url":"https://api.github.com/repos/Danila5803/TestSpringWeb","forks_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/forks","keys_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/teams","hooks_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/hooks","issue_events_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/issues/events{/number}","events_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/events","assignees_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/assignees{/user}","branches_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/branches{/branch}","tags_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/tags","blobs_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/git/refs{/sha}","trees_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/statuses/{sha}","languages_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/languages","stargazers_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/stargazers","contributors_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/contributors","subscribers_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/subscribers","subscription_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/subscription","commits_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/commits{/sha}","git_commits_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/git/commits{/sha}","comments_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/comments{/number}","issue_comment_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/issues/comments{/number}","contents_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/contents/{+path}","compare_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/merges","archive_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/downloads","issues_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/issues{/number}","pulls_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/pulls{/number}","milestones_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/milestones{/number}","notifications_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/labels{/name}","releases_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/releases{/id}","deployments_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/deployments","created_at":"2019-02-28T15:26:07Z","updated_at":"2019-02-28T15:40:32Z","pushed_at":"2019-03-04T12:37:53Z","git_url":"git://github.com/Danila5803/TestSpringWeb.git","ssh_url":"git@github.com:Danila5803/TestSpringWeb.git","clone_url":"https://github.com/Danila5803/TestSpringWeb.git","svn_url":"https://github.com/Danila5803/TestSpringWeb","homepage":null,"size":12513,"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":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Danila5803:master","ref":"master","sha":"38ff00d8e49897ae44df7ffbdbb4f0ed6d88ff8c","user":{"login":"Danila5803","id":43188845,"node_id":"MDQ6VXNlcjQzMTg4ODQ1","avatar_url":"https://avatars0.githubusercontent.com/u/43188845?v=4","gravatar_id":"","url":"https://api.github.com/users/Danila5803","html_url":"https://github.com/Danila5803","followers_url":"https://api.github.com/users/Danila5803/followers","following_url":"https://api.github.com/users/Danila5803/following{/other_user}","gists_url":"https://api.github.com/users/Danila5803/gists{/gist_id}","starred_url":"https://api.github.com/users/Danila5803/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Danila5803/subscriptions","organizations_url":"https://api.github.com/users/Danila5803/orgs","repos_url":"https://api.github.com/users/Danila5803/repos","events_url":"https://api.github.com/users/Danila5803/events{/privacy}","received_events_url":"https://api.github.com/users/Danila5803/received_events","type":"User","site_admin":false},"repo":{"id":173136674,"node_id":"MDEwOlJlcG9zaXRvcnkxNzMxMzY2NzQ=","name":"TestSpringWeb","full_name":"Danila5803/TestSpringWeb","private":false,"owner":{"login":"Danila5803","id":43188845,"node_id":"MDQ6VXNlcjQzMTg4ODQ1","avatar_url":"https://avatars0.githubusercontent.com/u/43188845?v=4","gravatar_id":"","url":"https://api.github.com/users/Danila5803","html_url":"https://github.com/Danila5803","followers_url":"https://api.github.com/users/Danila5803/followers","following_url":"https://api.github.com/users/Danila5803/following{/other_user}","gists_url":"https://api.github.com/users/Danila5803/gists{/gist_id}","starred_url":"https://api.github.com/users/Danila5803/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Danila5803/subscriptions","organizations_url":"https://api.github.com/users/Danila5803/orgs","repos_url":"https://api.github.com/users/Danila5803/repos","events_url":"https://api.github.com/users/Danila5803/events{/privacy}","received_events_url":"https://api.github.com/users/Danila5803/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Danila5803/TestSpringWeb","description":null,"fork":false,"url":"https://api.github.com/repos/Danila5803/TestSpringWeb","forks_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/forks","keys_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/teams","hooks_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/hooks","issue_events_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/issues/events{/number}","events_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/events","assignees_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/assignees{/user}","branches_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/branches{/branch}","tags_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/tags","blobs_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/git/refs{/sha}","trees_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/statuses/{sha}","languages_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/languages","stargazers_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/stargazers","contributors_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/contributors","subscribers_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/subscribers","subscription_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/subscription","commits_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/commits{/sha}","git_commits_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/git/commits{/sha}","comments_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/comments{/number}","issue_comment_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/issues/comments{/number}","contents_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/contents/{+path}","compare_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/merges","archive_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/downloads","issues_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/issues{/number}","pulls_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/pulls{/number}","milestones_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/milestones{/number}","notifications_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/labels{/name}","releases_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/releases{/id}","deployments_url":"https://api.github.com/repos/Danila5803/TestSpringWeb/deployments","created_at":"2019-02-28T15:26:07Z","updated_at":"2019-02-28T15:40:32Z","pushed_at":"2019-03-04T12:37:53Z","git_url":"git://github.com/Danila5803/TestSpringWeb.git","ssh_url":"git@github.com:Danila5803/TestSpringWeb.git","clone_url":"https://github.com/Danila5803/TestSpringWeb.git","svn_url":"https://github.com/Danila5803/TestSpringWeb","homepage":null,"size":12513,"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":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Danila5803/TestSpringWeb/pulls/1"},"html":{"href":"https://github.com/Danila5803/TestSpringWeb/pull/1"},"issue":{"href":"https://api.github.com/repos/Danila5803/TestSpringWeb/issues/1"},"comments":{"href":"https://api.github.com/repos/Danila5803/TestSpringWeb/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/Danila5803/TestSpringWeb/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/Danila5803/TestSpringWeb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Danila5803/TestSpringWeb/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/Danila5803/TestSpringWeb/statuses/21498b1f2d6c2b90376435db5299a9b02cce50d0"}},"author_association":"OWNER"}}
{"actor":{"display_login":"TuvaevAndrey"}}