{"action":"created","comment":{"url":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/comments/115153639","pull_request_review_id":36673164,"id":115153639,"diff_hunk":"@@ -0,0 +1,77 @@\n+package com.bounswe.bounswe2017group3.Model;\n+import com.bounswe.bounswe2017group3.Application;\n+import com.bounswe.bounswe2017group3.Model.User;\n+import com.bounswe.bounswe2017group3.Controller.UserController;\n+import com.bounswe.bounswe2017group3.Repository.UserRepository;\n+import com.jayway.restassured.RestAssured;\n+import static com.jayway.restassured.RestAssured.when;\n+import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc;\n+import static com.jayway.restassured.module.mockmvc.RestAssuredMockMvc.given;\n+import java.util.Arrays;\n+import org.apache.http.HttpStatus;\n+import org.hamcrest.Matchers;\n+import org.junit.Before;\n+import org.junit.Test;\n+import org.junit.runner.RunWith;\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.beans.factory.annotation.Value;\n+import org.springframework.boot.test.context.SpringBootTest;\n+import org.springframework.test.context.ContextConfiguration;\n+import org.springframework.test.context.junit4.SpringRunner;\n+@RunWith(SpringRunner.class)\n+@ContextConfiguration(classes = Application.class)\n+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)\n+public class UserControllerTest {\n+ \n+    @Autowired   \n+    UserRepository repository;\n+    User usr1;\n+    User usr2;\n+    User usr3;\n+    @Value(\"${local.server.port}\")   \n+    int port;\n+ \n+    @Before\n+    public void setUp() {\n+        \n+        usr1 = new User(\"gokce\",\"Gökçe Uludoğan\", \"gokce@gmail.com\",\"123123\");\n+        usr2 = new User(\"samed\",\"Samed Düzçay\",\"smddzcy@gmail.com\",\"123456\");\n+        usr3 = new User(\"esra\",\"Esra Aydemir\",\"esra-aydemir@gmail.com\",\"222333\");        \n+        repository.deleteAll();\n+        repository.save(Arrays.asList(usr1,usr2,usr3));\n+        RestAssuredMockMvc.standaloneSetup(new UserController(repository));\n+        RestAssured.port = port;\n+    }\n+ \n+    @Test\n+    public void canGetByUsername() {","path":"events-application-rest-api/src/test/java/com/bounswe/bounswe2017group3/Model/UserControllerTest.java","position":47,"original_position":47,"commit_id":"97fe3911dbffc9589dd8ec16405d11dcd58ce0a2","original_commit_id":"97fe3911dbffc9589dd8ec16405d11dcd58ce0a2","user":{"login":"smddzcy","id":13895224,"avatar_url":"https://avatars0.githubusercontent.com/u/13895224?v=3","gravatar_id":"","url":"https://api.github.com/users/smddzcy","html_url":"https://github.com/smddzcy","followers_url":"https://api.github.com/users/smddzcy/followers","following_url":"https://api.github.com/users/smddzcy/following{/other_user}","gists_url":"https://api.github.com/users/smddzcy/gists{/gist_id}","starred_url":"https://api.github.com/users/smddzcy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smddzcy/subscriptions","organizations_url":"https://api.github.com/users/smddzcy/orgs","repos_url":"https://api.github.com/users/smddzcy/repos","events_url":"https://api.github.com/users/smddzcy/events{/privacy}","received_events_url":"https://api.github.com/users/smddzcy/received_events","type":"User","site_admin":false},"body":"Maybe we can include a short comment to describe what this function tests.","created_at":"2017-05-07T20:52:17Z","updated_at":"2017-05-07T20:57:06Z","html_url":"https://github.com/bounswe/bounswe2017group3/pull/87#discussion_r115153639","pull_request_url":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/87","_links":{"self":{"href":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/comments/115153639"},"html":{"href":"https://github.com/bounswe/bounswe2017group3/pull/87#discussion_r115153639"},"pull_request":{"href":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/87"}}},"pull_request":{"url":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/87","id":119337412,"html_url":"https://github.com/bounswe/bounswe2017group3/pull/87","diff_url":"https://github.com/bounswe/bounswe2017group3/pull/87.diff","patch_url":"https://github.com/bounswe/bounswe2017group3/pull/87.patch","issue_url":"https://api.github.com/repos/bounswe/bounswe2017group3/issues/87","number":87,"state":"open","locked":false,"title":"Add user controller test","user":{"login":"gokceuludogan","id":9639399,"avatar_url":"https://avatars0.githubusercontent.com/u/9639399?v=3","gravatar_id":"","url":"https://api.github.com/users/gokceuludogan","html_url":"https://github.com/gokceuludogan","followers_url":"https://api.github.com/users/gokceuludogan/followers","following_url":"https://api.github.com/users/gokceuludogan/following{/other_user}","gists_url":"https://api.github.com/users/gokceuludogan/gists{/gist_id}","starred_url":"https://api.github.com/users/gokceuludogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gokceuludogan/subscriptions","organizations_url":"https://api.github.com/users/gokceuludogan/orgs","repos_url":"https://api.github.com/users/gokceuludogan/repos","events_url":"https://api.github.com/users/gokceuludogan/events{/privacy}","received_events_url":"https://api.github.com/users/gokceuludogan/received_events","type":"User","site_admin":false},"body":"## About\r\n\r\n* **Other Related Links:** https://blog.jayway.com/2014/07/04/integration-testing-a-spring-boot-application/\r\n\r\nSince we should create unit tests for our API, I have created some unit tests of UserController using Rest Assured Mock Mvc library.   \r\n\r\n### Changes\r\n\r\n- Added constructors to User\r\n- Added test class for UserController.\r\n- Tested some endpoints:\r\n  - `GET /user`\r\n  - `DELETE /user`\r\n  - `GET /user?username=' '` \r\n\r\n\r\n","created_at":"2017-05-07T12:45:02Z","updated_at":"2017-05-07T20:57:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ab88959b2404656d2a32a63e68ac7638001afecf","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/87/commits","review_comments_url":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/87/comments","review_comment_url":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bounswe/bounswe2017group3/issues/87/comments","statuses_url":"https://api.github.com/repos/bounswe/bounswe2017group3/statuses/97fe3911dbffc9589dd8ec16405d11dcd58ce0a2","head":{"label":"bounswe:add-user-controller-test","ref":"add-user-controller-test","sha":"97fe3911dbffc9589dd8ec16405d11dcd58ce0a2","user":{"login":"bounswe","id":12229719,"avatar_url":"https://avatars3.githubusercontent.com/u/12229719?v=3","gravatar_id":"","url":"https://api.github.com/users/bounswe","html_url":"https://github.com/bounswe","followers_url":"https://api.github.com/users/bounswe/followers","following_url":"https://api.github.com/users/bounswe/following{/other_user}","gists_url":"https://api.github.com/users/bounswe/gists{/gist_id}","starred_url":"https://api.github.com/users/bounswe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bounswe/subscriptions","organizations_url":"https://api.github.com/users/bounswe/orgs","repos_url":"https://api.github.com/users/bounswe/repos","events_url":"https://api.github.com/users/bounswe/events{/privacy}","received_events_url":"https://api.github.com/users/bounswe/received_events","type":"Organization","site_admin":false},"repo":{"id":81464391,"name":"bounswe2017group3","full_name":"bounswe/bounswe2017group3","owner":{"login":"bounswe","id":12229719,"avatar_url":"https://avatars3.githubusercontent.com/u/12229719?v=3","gravatar_id":"","url":"https://api.github.com/users/bounswe","html_url":"https://github.com/bounswe","followers_url":"https://api.github.com/users/bounswe/followers","following_url":"https://api.github.com/users/bounswe/following{/other_user}","gists_url":"https://api.github.com/users/bounswe/gists{/gist_id}","starred_url":"https://api.github.com/users/bounswe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bounswe/subscriptions","organizations_url":"https://api.github.com/users/bounswe/orgs","repos_url":"https://api.github.com/users/bounswe/repos","events_url":"https://api.github.com/users/bounswe/events{/privacy}","received_events_url":"https://api.github.com/users/bounswe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bounswe/bounswe2017group3","description":"This is a course project repository for the courses CmpE352/451 at Boğaziçi University.","fork":false,"url":"https://api.github.com/repos/bounswe/bounswe2017group3","forks_url":"https://api.github.com/repos/bounswe/bounswe2017group3/forks","keys_url":"https://api.github.com/repos/bounswe/bounswe2017group3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bounswe/bounswe2017group3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bounswe/bounswe2017group3/teams","hooks_url":"https://api.github.com/repos/bounswe/bounswe2017group3/hooks","issue_events_url":"https://api.github.com/repos/bounswe/bounswe2017group3/issues/events{/number}","events_url":"https://api.github.com/repos/bounswe/bounswe2017group3/events","assignees_url":"https://api.github.com/repos/bounswe/bounswe2017group3/assignees{/user}","branches_url":"https://api.github.com/repos/bounswe/bounswe2017group3/branches{/branch}","tags_url":"https://api.github.com/repos/bounswe/bounswe2017group3/tags","blobs_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/refs{/sha}","trees_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bounswe/bounswe2017group3/statuses/{sha}","languages_url":"https://api.github.com/repos/bounswe/bounswe2017group3/languages","stargazers_url":"https://api.github.com/repos/bounswe/bounswe2017group3/stargazers","contributors_url":"https://api.github.com/repos/bounswe/bounswe2017group3/contributors","subscribers_url":"https://api.github.com/repos/bounswe/bounswe2017group3/subscribers","subscription_url":"https://api.github.com/repos/bounswe/bounswe2017group3/subscription","commits_url":"https://api.github.com/repos/bounswe/bounswe2017group3/commits{/sha}","git_commits_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/commits{/sha}","comments_url":"https://api.github.com/repos/bounswe/bounswe2017group3/comments{/number}","issue_comment_url":"https://api.github.com/repos/bounswe/bounswe2017group3/issues/comments{/number}","contents_url":"https://api.github.com/repos/bounswe/bounswe2017group3/contents/{+path}","compare_url":"https://api.github.com/repos/bounswe/bounswe2017group3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bounswe/bounswe2017group3/merges","archive_url":"https://api.github.com/repos/bounswe/bounswe2017group3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bounswe/bounswe2017group3/downloads","issues_url":"https://api.github.com/repos/bounswe/bounswe2017group3/issues{/number}","pulls_url":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls{/number}","milestones_url":"https://api.github.com/repos/bounswe/bounswe2017group3/milestones{/number}","notifications_url":"https://api.github.com/repos/bounswe/bounswe2017group3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bounswe/bounswe2017group3/labels{/name}","releases_url":"https://api.github.com/repos/bounswe/bounswe2017group3/releases{/id}","deployments_url":"https://api.github.com/repos/bounswe/bounswe2017group3/deployments","created_at":"2017-02-09T15:26:53Z","updated_at":"2017-04-17T19:11:32Z","pushed_at":"2017-05-07T17:46:06Z","git_url":"git://github.com/bounswe/bounswe2017group3.git","ssh_url":"git@github.com:bounswe/bounswe2017group3.git","clone_url":"https://github.com/bounswe/bounswe2017group3.git","svn_url":"https://github.com/bounswe/bounswe2017group3","homepage":"","size":413,"stargazers_count":7,"watchers_count":7,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":7,"default_branch":"master"}},"base":{"label":"bounswe:master","ref":"master","sha":"e39b5092d7fc27f8a634fde377f73ed9a1c766ed","user":{"login":"bounswe","id":12229719,"avatar_url":"https://avatars3.githubusercontent.com/u/12229719?v=3","gravatar_id":"","url":"https://api.github.com/users/bounswe","html_url":"https://github.com/bounswe","followers_url":"https://api.github.com/users/bounswe/followers","following_url":"https://api.github.com/users/bounswe/following{/other_user}","gists_url":"https://api.github.com/users/bounswe/gists{/gist_id}","starred_url":"https://api.github.com/users/bounswe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bounswe/subscriptions","organizations_url":"https://api.github.com/users/bounswe/orgs","repos_url":"https://api.github.com/users/bounswe/repos","events_url":"https://api.github.com/users/bounswe/events{/privacy}","received_events_url":"https://api.github.com/users/bounswe/received_events","type":"Organization","site_admin":false},"repo":{"id":81464391,"name":"bounswe2017group3","full_name":"bounswe/bounswe2017group3","owner":{"login":"bounswe","id":12229719,"avatar_url":"https://avatars3.githubusercontent.com/u/12229719?v=3","gravatar_id":"","url":"https://api.github.com/users/bounswe","html_url":"https://github.com/bounswe","followers_url":"https://api.github.com/users/bounswe/followers","following_url":"https://api.github.com/users/bounswe/following{/other_user}","gists_url":"https://api.github.com/users/bounswe/gists{/gist_id}","starred_url":"https://api.github.com/users/bounswe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bounswe/subscriptions","organizations_url":"https://api.github.com/users/bounswe/orgs","repos_url":"https://api.github.com/users/bounswe/repos","events_url":"https://api.github.com/users/bounswe/events{/privacy}","received_events_url":"https://api.github.com/users/bounswe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bounswe/bounswe2017group3","description":"This is a course project repository for the courses CmpE352/451 at Boğaziçi University.","fork":false,"url":"https://api.github.com/repos/bounswe/bounswe2017group3","forks_url":"https://api.github.com/repos/bounswe/bounswe2017group3/forks","keys_url":"https://api.github.com/repos/bounswe/bounswe2017group3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bounswe/bounswe2017group3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bounswe/bounswe2017group3/teams","hooks_url":"https://api.github.com/repos/bounswe/bounswe2017group3/hooks","issue_events_url":"https://api.github.com/repos/bounswe/bounswe2017group3/issues/events{/number}","events_url":"https://api.github.com/repos/bounswe/bounswe2017group3/events","assignees_url":"https://api.github.com/repos/bounswe/bounswe2017group3/assignees{/user}","branches_url":"https://api.github.com/repos/bounswe/bounswe2017group3/branches{/branch}","tags_url":"https://api.github.com/repos/bounswe/bounswe2017group3/tags","blobs_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/refs{/sha}","trees_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bounswe/bounswe2017group3/statuses/{sha}","languages_url":"https://api.github.com/repos/bounswe/bounswe2017group3/languages","stargazers_url":"https://api.github.com/repos/bounswe/bounswe2017group3/stargazers","contributors_url":"https://api.github.com/repos/bounswe/bounswe2017group3/contributors","subscribers_url":"https://api.github.com/repos/bounswe/bounswe2017group3/subscribers","subscription_url":"https://api.github.com/repos/bounswe/bounswe2017group3/subscription","commits_url":"https://api.github.com/repos/bounswe/bounswe2017group3/commits{/sha}","git_commits_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/commits{/sha}","comments_url":"https://api.github.com/repos/bounswe/bounswe2017group3/comments{/number}","issue_comment_url":"https://api.github.com/repos/bounswe/bounswe2017group3/issues/comments{/number}","contents_url":"https://api.github.com/repos/bounswe/bounswe2017group3/contents/{+path}","compare_url":"https://api.github.com/repos/bounswe/bounswe2017group3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bounswe/bounswe2017group3/merges","archive_url":"https://api.github.com/repos/bounswe/bounswe2017group3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bounswe/bounswe2017group3/downloads","issues_url":"https://api.github.com/repos/bounswe/bounswe2017group3/issues{/number}","pulls_url":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls{/number}","milestones_url":"https://api.github.com/repos/bounswe/bounswe2017group3/milestones{/number}","notifications_url":"https://api.github.com/repos/bounswe/bounswe2017group3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bounswe/bounswe2017group3/labels{/name}","releases_url":"https://api.github.com/repos/bounswe/bounswe2017group3/releases{/id}","deployments_url":"https://api.github.com/repos/bounswe/bounswe2017group3/deployments","created_at":"2017-02-09T15:26:53Z","updated_at":"2017-04-17T19:11:32Z","pushed_at":"2017-05-07T17:46:06Z","git_url":"git://github.com/bounswe/bounswe2017group3.git","ssh_url":"git@github.com:bounswe/bounswe2017group3.git","clone_url":"https://github.com/bounswe/bounswe2017group3.git","svn_url":"https://github.com/bounswe/bounswe2017group3","homepage":"","size":413,"stargazers_count":7,"watchers_count":7,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/87"},"html":{"href":"https://github.com/bounswe/bounswe2017group3/pull/87"},"issue":{"href":"https://api.github.com/repos/bounswe/bounswe2017group3/issues/87"},"comments":{"href":"https://api.github.com/repos/bounswe/bounswe2017group3/issues/87/comments"},"review_comments":{"href":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/87/comments"},"review_comment":{"href":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/87/commits"},"statuses":{"href":"https://api.github.com/repos/bounswe/bounswe2017group3/statuses/97fe3911dbffc9589dd8ec16405d11dcd58ce0a2"}}}}
{"actor":{"display_login":"smddzcy"}}