{"action":"created","comment":{"url":"https://api.github.com/repos/AboudS777/AMA/pulls/comments/109080384","pull_request_review_id":30158079,"id":109080384,"diff_hunk":"@@ -0,0 +1,56 @@\n+package tests.UnitTests;\n+\n+import ama.Application;\n+import ama.account.User;\n+import ama.account.UserService;\n+import org.junit.After;\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.boot.test.context.SpringBootTest;\n+import org.springframework.security.core.userdetails.UserDetails;\n+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;\n+\n+import static org.junit.Assert.*;\n+\n+@RunWith(SpringJUnit4ClassRunner.class)\n+@SpringBootTest(classes = Application.class)\n+public class TestUserService {\n+\n+    @Autowired\n+    private UserService userService;\n+\n+    private User ryan;\n+    private User sarran;\n+    @Before\n+    public void setUp() throws Exception {\n+        ryan = new User(\"ryan\",\"theman\");\n+        sarran = new User(\"sarran\",\"theman\");\n+    }\n+\n+    @After\n+    public void tearDown() throws Exception {\n+        ryan = null;\n+    }\n+\n+    @Test\n+    public void testRegisterNewUserAccount() throws Exception {\n+        User registeredUser = userService.registerNewUserAccount(sarran);\n+        assertEquals(registeredUser.getUsername(),sarran.getUsername());\n+        assertEquals(registeredUser.getPassword(),sarran.getPassword());\n+    }\n+\n+    @Test(expected= NullPointerException.class)\n+    public void testLoadUserThatDoesNotExistByUsername() throws Exception {\n+        UserDetails loadedUser = userService.loadUserByUsername(ryan.getUsername());\n+        assertEquals(loadedUser.getUsername(),ryan.getUsername());","path":"src/main/java/tests/UnitTests/TestUserService.java","position":47,"original_position":47,"commit_id":"7c6cf8a359463d411f736fd477f1fd4bb57d8679","original_commit_id":"7c6cf8a359463d411f736fd477f1fd4bb57d8679","user":{"login":"RyanBillard","id":4722280,"avatar_url":"https://avatars0.githubusercontent.com/u/4722280?v=3","gravatar_id":"","url":"https://api.github.com/users/RyanBillard","html_url":"https://github.com/RyanBillard","followers_url":"https://api.github.com/users/RyanBillard/followers","following_url":"https://api.github.com/users/RyanBillard/following{/other_user}","gists_url":"https://api.github.com/users/RyanBillard/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanBillard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanBillard/subscriptions","organizations_url":"https://api.github.com/users/RyanBillard/orgs","repos_url":"https://api.github.com/users/RyanBillard/repos","events_url":"https://api.github.com/users/RyanBillard/events{/privacy}","received_events_url":"https://api.github.com/users/RyanBillard/received_events","type":"User","site_admin":false},"body":"can't you just assert that loadedUser == null?","created_at":"2017-03-31T03:08:51Z","updated_at":"2017-03-31T03:09:04Z","html_url":"https://github.com/AboudS777/AMA/pull/30#discussion_r109080384","pull_request_url":"https://api.github.com/repos/AboudS777/AMA/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/AboudS777/AMA/pulls/comments/109080384"},"html":{"href":"https://github.com/AboudS777/AMA/pull/30#discussion_r109080384"},"pull_request":{"href":"https://api.github.com/repos/AboudS777/AMA/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/AboudS777/AMA/pulls/30","id":113498038,"html_url":"https://github.com/AboudS777/AMA/pull/30","diff_url":"https://github.com/AboudS777/AMA/pull/30.diff","patch_url":"https://github.com/AboudS777/AMA/pull/30.patch","issue_url":"https://api.github.com/repos/AboudS777/AMA/issues/30","number":30,"state":"open","locked":false,"title":"Test/unit tests","user":{"login":"SarrankanPathmanathan","id":8919416,"avatar_url":"https://avatars1.githubusercontent.com/u/8919416?v=3","gravatar_id":"","url":"https://api.github.com/users/SarrankanPathmanathan","html_url":"https://github.com/SarrankanPathmanathan","followers_url":"https://api.github.com/users/SarrankanPathmanathan/followers","following_url":"https://api.github.com/users/SarrankanPathmanathan/following{/other_user}","gists_url":"https://api.github.com/users/SarrankanPathmanathan/gists{/gist_id}","starred_url":"https://api.github.com/users/SarrankanPathmanathan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SarrankanPathmanathan/subscriptions","organizations_url":"https://api.github.com/users/SarrankanPathmanathan/orgs","repos_url":"https://api.github.com/users/SarrankanPathmanathan/repos","events_url":"https://api.github.com/users/SarrankanPathmanathan/events{/privacy}","received_events_url":"https://api.github.com/users/SarrankanPathmanathan/received_events","type":"User","site_admin":false},"body":"Unit tests for all classes except for controllers since the testing the controllers will be part of Integration Testing.","created_at":"2017-03-30T18:47:01Z","updated_at":"2017-03-31T03:09:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"74b1c53cf8b6c242e3445d99b26e36ddbecd3936","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/AboudS777/AMA/milestones/3","html_url":"https://github.com/AboudS777/AMA/milestone/3","labels_url":"https://api.github.com/repos/AboudS777/AMA/milestones/3/labels","id":2407155,"number":3,"title":"Milestone 3","description":"Finish all functionality of the app, including viewing user profiles, search, and ordering of questions on AMA","creator":{"login":"RyanBillard","id":4722280,"avatar_url":"https://avatars0.githubusercontent.com/u/4722280?v=3","gravatar_id":"","url":"https://api.github.com/users/RyanBillard","html_url":"https://github.com/RyanBillard","followers_url":"https://api.github.com/users/RyanBillard/followers","following_url":"https://api.github.com/users/RyanBillard/following{/other_user}","gists_url":"https://api.github.com/users/RyanBillard/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanBillard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanBillard/subscriptions","organizations_url":"https://api.github.com/users/RyanBillard/orgs","repos_url":"https://api.github.com/users/RyanBillard/repos","events_url":"https://api.github.com/users/RyanBillard/events{/privacy}","received_events_url":"https://api.github.com/users/RyanBillard/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":1,"state":"open","created_at":"2017-03-23T15:28:52Z","updated_at":"2017-03-30T18:47:01Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/AboudS777/AMA/pulls/30/commits","review_comments_url":"https://api.github.com/repos/AboudS777/AMA/pulls/30/comments","review_comment_url":"https://api.github.com/repos/AboudS777/AMA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AboudS777/AMA/issues/30/comments","statuses_url":"https://api.github.com/repos/AboudS777/AMA/statuses/7c6cf8a359463d411f736fd477f1fd4bb57d8679","head":{"label":"AboudS777:test/UnitTests","ref":"test/UnitTests","sha":"7c6cf8a359463d411f736fd477f1fd4bb57d8679","user":{"login":"AboudS777","id":14824569,"avatar_url":"https://avatars1.githubusercontent.com/u/14824569?v=3","gravatar_id":"","url":"https://api.github.com/users/AboudS777","html_url":"https://github.com/AboudS777","followers_url":"https://api.github.com/users/AboudS777/followers","following_url":"https://api.github.com/users/AboudS777/following{/other_user}","gists_url":"https://api.github.com/users/AboudS777/gists{/gist_id}","starred_url":"https://api.github.com/users/AboudS777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AboudS777/subscriptions","organizations_url":"https://api.github.com/users/AboudS777/orgs","repos_url":"https://api.github.com/users/AboudS777/repos","events_url":"https://api.github.com/users/AboudS777/events{/privacy}","received_events_url":"https://api.github.com/users/AboudS777/received_events","type":"User","site_admin":false},"repo":{"id":83917116,"name":"AMA","full_name":"AboudS777/AMA","owner":{"login":"AboudS777","id":14824569,"avatar_url":"https://avatars1.githubusercontent.com/u/14824569?v=3","gravatar_id":"","url":"https://api.github.com/users/AboudS777","html_url":"https://github.com/AboudS777","followers_url":"https://api.github.com/users/AboudS777/followers","following_url":"https://api.github.com/users/AboudS777/following{/other_user}","gists_url":"https://api.github.com/users/AboudS777/gists{/gist_id}","starred_url":"https://api.github.com/users/AboudS777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AboudS777/subscriptions","organizations_url":"https://api.github.com/users/AboudS777/orgs","repos_url":"https://api.github.com/users/AboudS777/repos","events_url":"https://api.github.com/users/AboudS777/events{/privacy}","received_events_url":"https://api.github.com/users/AboudS777/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AboudS777/AMA","description":"An \"Ask me anything\" web-based app","fork":false,"url":"https://api.github.com/repos/AboudS777/AMA","forks_url":"https://api.github.com/repos/AboudS777/AMA/forks","keys_url":"https://api.github.com/repos/AboudS777/AMA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AboudS777/AMA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AboudS777/AMA/teams","hooks_url":"https://api.github.com/repos/AboudS777/AMA/hooks","issue_events_url":"https://api.github.com/repos/AboudS777/AMA/issues/events{/number}","events_url":"https://api.github.com/repos/AboudS777/AMA/events","assignees_url":"https://api.github.com/repos/AboudS777/AMA/assignees{/user}","branches_url":"https://api.github.com/repos/AboudS777/AMA/branches{/branch}","tags_url":"https://api.github.com/repos/AboudS777/AMA/tags","blobs_url":"https://api.github.com/repos/AboudS777/AMA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AboudS777/AMA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AboudS777/AMA/git/refs{/sha}","trees_url":"https://api.github.com/repos/AboudS777/AMA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AboudS777/AMA/statuses/{sha}","languages_url":"https://api.github.com/repos/AboudS777/AMA/languages","stargazers_url":"https://api.github.com/repos/AboudS777/AMA/stargazers","contributors_url":"https://api.github.com/repos/AboudS777/AMA/contributors","subscribers_url":"https://api.github.com/repos/AboudS777/AMA/subscribers","subscription_url":"https://api.github.com/repos/AboudS777/AMA/subscription","commits_url":"https://api.github.com/repos/AboudS777/AMA/commits{/sha}","git_commits_url":"https://api.github.com/repos/AboudS777/AMA/git/commits{/sha}","comments_url":"https://api.github.com/repos/AboudS777/AMA/comments{/number}","issue_comment_url":"https://api.github.com/repos/AboudS777/AMA/issues/comments{/number}","contents_url":"https://api.github.com/repos/AboudS777/AMA/contents/{+path}","compare_url":"https://api.github.com/repos/AboudS777/AMA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AboudS777/AMA/merges","archive_url":"https://api.github.com/repos/AboudS777/AMA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AboudS777/AMA/downloads","issues_url":"https://api.github.com/repos/AboudS777/AMA/issues{/number}","pulls_url":"https://api.github.com/repos/AboudS777/AMA/pulls{/number}","milestones_url":"https://api.github.com/repos/AboudS777/AMA/milestones{/number}","notifications_url":"https://api.github.com/repos/AboudS777/AMA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AboudS777/AMA/labels{/name}","releases_url":"https://api.github.com/repos/AboudS777/AMA/releases{/id}","deployments_url":"https://api.github.com/repos/AboudS777/AMA/deployments","created_at":"2017-03-04T18:57:01Z","updated_at":"2017-03-21T22:07:30Z","pushed_at":"2017-03-30T21:04:15Z","git_url":"git://github.com/AboudS777/AMA.git","ssh_url":"git@github.com:AboudS777/AMA.git","clone_url":"https://github.com/AboudS777/AMA.git","svn_url":"https://github.com/AboudS777/AMA","homepage":null,"size":141,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":14,"forks":0,"open_issues":14,"watchers":0,"default_branch":"master"}},"base":{"label":"AboudS777:master","ref":"master","sha":"516670988a74e524e5c2c8a1052032a11b976280","user":{"login":"AboudS777","id":14824569,"avatar_url":"https://avatars1.githubusercontent.com/u/14824569?v=3","gravatar_id":"","url":"https://api.github.com/users/AboudS777","html_url":"https://github.com/AboudS777","followers_url":"https://api.github.com/users/AboudS777/followers","following_url":"https://api.github.com/users/AboudS777/following{/other_user}","gists_url":"https://api.github.com/users/AboudS777/gists{/gist_id}","starred_url":"https://api.github.com/users/AboudS777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AboudS777/subscriptions","organizations_url":"https://api.github.com/users/AboudS777/orgs","repos_url":"https://api.github.com/users/AboudS777/repos","events_url":"https://api.github.com/users/AboudS777/events{/privacy}","received_events_url":"https://api.github.com/users/AboudS777/received_events","type":"User","site_admin":false},"repo":{"id":83917116,"name":"AMA","full_name":"AboudS777/AMA","owner":{"login":"AboudS777","id":14824569,"avatar_url":"https://avatars1.githubusercontent.com/u/14824569?v=3","gravatar_id":"","url":"https://api.github.com/users/AboudS777","html_url":"https://github.com/AboudS777","followers_url":"https://api.github.com/users/AboudS777/followers","following_url":"https://api.github.com/users/AboudS777/following{/other_user}","gists_url":"https://api.github.com/users/AboudS777/gists{/gist_id}","starred_url":"https://api.github.com/users/AboudS777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AboudS777/subscriptions","organizations_url":"https://api.github.com/users/AboudS777/orgs","repos_url":"https://api.github.com/users/AboudS777/repos","events_url":"https://api.github.com/users/AboudS777/events{/privacy}","received_events_url":"https://api.github.com/users/AboudS777/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AboudS777/AMA","description":"An \"Ask me anything\" web-based app","fork":false,"url":"https://api.github.com/repos/AboudS777/AMA","forks_url":"https://api.github.com/repos/AboudS777/AMA/forks","keys_url":"https://api.github.com/repos/AboudS777/AMA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AboudS777/AMA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AboudS777/AMA/teams","hooks_url":"https://api.github.com/repos/AboudS777/AMA/hooks","issue_events_url":"https://api.github.com/repos/AboudS777/AMA/issues/events{/number}","events_url":"https://api.github.com/repos/AboudS777/AMA/events","assignees_url":"https://api.github.com/repos/AboudS777/AMA/assignees{/user}","branches_url":"https://api.github.com/repos/AboudS777/AMA/branches{/branch}","tags_url":"https://api.github.com/repos/AboudS777/AMA/tags","blobs_url":"https://api.github.com/repos/AboudS777/AMA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AboudS777/AMA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AboudS777/AMA/git/refs{/sha}","trees_url":"https://api.github.com/repos/AboudS777/AMA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AboudS777/AMA/statuses/{sha}","languages_url":"https://api.github.com/repos/AboudS777/AMA/languages","stargazers_url":"https://api.github.com/repos/AboudS777/AMA/stargazers","contributors_url":"https://api.github.com/repos/AboudS777/AMA/contributors","subscribers_url":"https://api.github.com/repos/AboudS777/AMA/subscribers","subscription_url":"https://api.github.com/repos/AboudS777/AMA/subscription","commits_url":"https://api.github.com/repos/AboudS777/AMA/commits{/sha}","git_commits_url":"https://api.github.com/repos/AboudS777/AMA/git/commits{/sha}","comments_url":"https://api.github.com/repos/AboudS777/AMA/comments{/number}","issue_comment_url":"https://api.github.com/repos/AboudS777/AMA/issues/comments{/number}","contents_url":"https://api.github.com/repos/AboudS777/AMA/contents/{+path}","compare_url":"https://api.github.com/repos/AboudS777/AMA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AboudS777/AMA/merges","archive_url":"https://api.github.com/repos/AboudS777/AMA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AboudS777/AMA/downloads","issues_url":"https://api.github.com/repos/AboudS777/AMA/issues{/number}","pulls_url":"https://api.github.com/repos/AboudS777/AMA/pulls{/number}","milestones_url":"https://api.github.com/repos/AboudS777/AMA/milestones{/number}","notifications_url":"https://api.github.com/repos/AboudS777/AMA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AboudS777/AMA/labels{/name}","releases_url":"https://api.github.com/repos/AboudS777/AMA/releases{/id}","deployments_url":"https://api.github.com/repos/AboudS777/AMA/deployments","created_at":"2017-03-04T18:57:01Z","updated_at":"2017-03-21T22:07:30Z","pushed_at":"2017-03-30T21:04:15Z","git_url":"git://github.com/AboudS777/AMA.git","ssh_url":"git@github.com:AboudS777/AMA.git","clone_url":"https://github.com/AboudS777/AMA.git","svn_url":"https://github.com/AboudS777/AMA","homepage":null,"size":141,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":14,"forks":0,"open_issues":14,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AboudS777/AMA/pulls/30"},"html":{"href":"https://github.com/AboudS777/AMA/pull/30"},"issue":{"href":"https://api.github.com/repos/AboudS777/AMA/issues/30"},"comments":{"href":"https://api.github.com/repos/AboudS777/AMA/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/AboudS777/AMA/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/AboudS777/AMA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AboudS777/AMA/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/AboudS777/AMA/statuses/7c6cf8a359463d411f736fd477f1fd4bb57d8679"}}}}
{"actor":{"display_login":"RyanBillard"}}