{"action":"created","comment":{"url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/pulls/comments/94285069","pull_request_review_id":14814322,"id":94285069,"diff_hunk":"@@ -116,959 +80,544 @@ public void testViewAllOrders_User() {\n     }\n \n     @Test\n-    public void testViewAllOrders_Admin() {\n-        insertTestOrders();\n-\n-        SessionData login = login(admin.getUsername(), adminCleartextPassword);\n+    public void testGetAllOrdersAsUser() {\n+        insertAnonOrder();\n+        User user = createUser();\n \n         //@formatter:off\n         given().\n-            filter(sessionFilter).\n-            header(login.getCsrfHeader()).\n+            header(getXAuthTokenHeaderForUser(user)).\n         when().\n             get(ORDER_ENDPOINT).\n         then().\n-            statusCode(HttpStatus.SC_OK).\n-            body(\"$\", hasSize(2)).\n-            body(\"user.username\", containsInAnyOrder(admin.getUsername(), user.getUsername())).\n-            body(\"status\", hasItems(\"ASSIGNED\", \"ASSIGNED\"));\n-        //formatter:on\n+            statusCode(HttpStatus.SC_FORBIDDEN).body(\"message\", containsString(\"denied\"));\n+        //@formatter:on\n     }\n \n-    //     @RequestMapping(value = \"/orders\", method = RequestMethod.POST)\n-\n     @Test\n-    public void testCreateSingleOrder_User() {\n-        Map<String, String> order = new HashMap<>();\n-        order.put(\"pickupService\", \"true\");\n-        order.put(\"type\", TicketType.TEST.toString());\n-        order.put(\"chMember\", \"false\");\n-        SessionData login = login(user.getUsername(), userCleartextPassword);\n+    public void testGetAllOrdersAsAdmin() {\n+        insertAnonOrder();\n+        User admin = createUser(true);\n \n         //@formatter:off\n         given().\n-            filter(sessionFilter).\n-            header(login.getCsrfHeader()).\n+            header(getXAuthTokenHeaderForUser(admin)).\n         when().\n-            content(order).contentType(ContentType.JSON).\n-            post(ORDER_ENDPOINT)\n-        .then().\n-            statusCode(HttpStatus.SC_CREATED).\n-            body(\"object.user\", is(nullValue())).\n-            body(\"object.status\", is(\"ANONYMOUS\")).\n-            body(\"object.tickets\", hasSize(1)).\n-            body(\"object.tickets.pickupService\", hasItem(true)).\n-            body(\"object.tickets.type\", hasItem(is(TicketType.TEST.toString()))).\n-            body(\"object.amount\",equalTo(TicketType.TEST.getPrice() + TicketOption.PICKUPSERVICE.getPrice()));\n+            get(ORDER_ENDPOINT).\n+        then().\n+            statusCode(HttpStatus.SC_OK).\n+            body(\"$\", hasSize(Long.valueOf(orderRepository.count()).intValue()));","path":"src/test/java/ch/wisv/areafiftylan/OrderRestIntegrationTest.java","position":187,"original_position":187,"commit_id":"18c2a0bb76f19d2f3366a5d634fbd97ff9e0aa4a","original_commit_id":"18c2a0bb76f19d2f3366a5d634fbd97ff9e0aa4a","user":{"login":"martijnjanssen","id":9624753,"avatar_url":"https://avatars.githubusercontent.com/u/9624753?v=3","gravatar_id":"","url":"https://api.github.com/users/martijnjanssen","html_url":"https://github.com/martijnjanssen","followers_url":"https://api.github.com/users/martijnjanssen/followers","following_url":"https://api.github.com/users/martijnjanssen/following{/other_user}","gists_url":"https://api.github.com/users/martijnjanssen/gists{/gist_id}","starred_url":"https://api.github.com/users/martijnjanssen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martijnjanssen/subscriptions","organizations_url":"https://api.github.com/users/martijnjanssen/orgs","repos_url":"https://api.github.com/users/martijnjanssen/repos","events_url":"https://api.github.com/users/martijnjanssen/events{/privacy}","received_events_url":"https://api.github.com/users/martijnjanssen/received_events","type":"User","site_admin":false},"body":"Do we need to check if expired orders are included in this return method?","created_at":"2017-01-01T15:03:34Z","updated_at":"2017-01-01T15:10:05Z","html_url":"https://github.com/AreaFiftyLAN/lancie-api/pull/325#discussion_r94285069","pull_request_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/pulls/325","_links":{"self":{"href":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/pulls/comments/94285069"},"html":{"href":"https://github.com/AreaFiftyLAN/lancie-api/pull/325#discussion_r94285069"},"pull_request":{"href":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/pulls/325"}}},"pull_request":{"url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/pulls/325","id":99824629,"html_url":"https://github.com/AreaFiftyLAN/lancie-api/pull/325","diff_url":"https://github.com/AreaFiftyLAN/lancie-api/pull/325.diff","patch_url":"https://github.com/AreaFiftyLAN/lancie-api/pull/325.patch","issue_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/issues/325","number":325,"state":"open","locked":false,"title":"Order integration test","user":{"login":"skamoen","id":3198784,"avatar_url":"https://avatars.githubusercontent.com/u/3198784?v=3","gravatar_id":"","url":"https://api.github.com/users/skamoen","html_url":"https://github.com/skamoen","followers_url":"https://api.github.com/users/skamoen/followers","following_url":"https://api.github.com/users/skamoen/following{/other_user}","gists_url":"https://api.github.com/users/skamoen/gists{/gist_id}","starred_url":"https://api.github.com/users/skamoen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skamoen/subscriptions","organizations_url":"https://api.github.com/users/skamoen/orgs","repos_url":"https://api.github.com/users/skamoen/repos","events_url":"https://api.github.com/users/skamoen/events{/privacy}","received_events_url":"https://api.github.com/users/skamoen/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-01-01T14:57:08Z","updated_at":"2017-01-01T15:10:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ec178f89e8f55c92e537e672cc6e29f9997df79d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/pulls/325/commits","review_comments_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/pulls/325/comments","review_comment_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/issues/325/comments","statuses_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/statuses/18c2a0bb76f19d2f3366a5d634fbd97ff9e0aa4a","head":{"label":"AreaFiftyLAN:order-integration-test","ref":"order-integration-test","sha":"18c2a0bb76f19d2f3366a5d634fbd97ff9e0aa4a","user":{"login":"AreaFiftyLAN","id":13952301,"avatar_url":"https://avatars.githubusercontent.com/u/13952301?v=3","gravatar_id":"","url":"https://api.github.com/users/AreaFiftyLAN","html_url":"https://github.com/AreaFiftyLAN","followers_url":"https://api.github.com/users/AreaFiftyLAN/followers","following_url":"https://api.github.com/users/AreaFiftyLAN/following{/other_user}","gists_url":"https://api.github.com/users/AreaFiftyLAN/gists{/gist_id}","starred_url":"https://api.github.com/users/AreaFiftyLAN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AreaFiftyLAN/subscriptions","organizations_url":"https://api.github.com/users/AreaFiftyLAN/orgs","repos_url":"https://api.github.com/users/AreaFiftyLAN/repos","events_url":"https://api.github.com/users/AreaFiftyLAN/events{/privacy}","received_events_url":"https://api.github.com/users/AreaFiftyLAN/received_events","type":"Organization","site_admin":false},"repo":{"id":40057514,"name":"lancie-api","full_name":"AreaFiftyLAN/lancie-api","owner":{"login":"AreaFiftyLAN","id":13952301,"avatar_url":"https://avatars.githubusercontent.com/u/13952301?v=3","gravatar_id":"","url":"https://api.github.com/users/AreaFiftyLAN","html_url":"https://github.com/AreaFiftyLAN","followers_url":"https://api.github.com/users/AreaFiftyLAN/followers","following_url":"https://api.github.com/users/AreaFiftyLAN/following{/other_user}","gists_url":"https://api.github.com/users/AreaFiftyLAN/gists{/gist_id}","starred_url":"https://api.github.com/users/AreaFiftyLAN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AreaFiftyLAN/subscriptions","organizations_url":"https://api.github.com/users/AreaFiftyLAN/orgs","repos_url":"https://api.github.com/users/AreaFiftyLAN/repos","events_url":"https://api.github.com/users/AreaFiftyLAN/events{/privacy}","received_events_url":"https://api.github.com/users/AreaFiftyLAN/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AreaFiftyLAN/lancie-api","description":"Spring based implementation of the LANcie API","fork":false,"url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api","forks_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/forks","keys_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/teams","hooks_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/hooks","issue_events_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/issues/events{/number}","events_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/events","assignees_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/assignees{/user}","branches_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/branches{/branch}","tags_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/tags","blobs_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/statuses/{sha}","languages_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/languages","stargazers_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/stargazers","contributors_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/contributors","subscribers_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/subscribers","subscription_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/subscription","commits_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/contents/{+path}","compare_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/merges","archive_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/downloads","issues_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/issues{/number}","pulls_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/pulls{/number}","milestones_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/milestones{/number}","notifications_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/labels{/name}","releases_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/releases{/id}","deployments_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/deployments","created_at":"2015-08-01T19:20:38Z","updated_at":"2016-10-22T23:16:04Z","pushed_at":"2017-01-01T14:57:09Z","git_url":"git://github.com/AreaFiftyLAN/lancie-api.git","ssh_url":"git@github.com:AreaFiftyLAN/lancie-api.git","clone_url":"https://github.com/AreaFiftyLAN/lancie-api.git","svn_url":"https://github.com/AreaFiftyLAN/lancie-api","homepage":null,"size":10644,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":49,"forks":1,"open_issues":49,"watchers":5,"default_branch":"master"}},"base":{"label":"AreaFiftyLAN:feature-dynamic-tickets","ref":"feature-dynamic-tickets","sha":"09b92dd082b3f1abcc54c261bca350f51c88507e","user":{"login":"AreaFiftyLAN","id":13952301,"avatar_url":"https://avatars.githubusercontent.com/u/13952301?v=3","gravatar_id":"","url":"https://api.github.com/users/AreaFiftyLAN","html_url":"https://github.com/AreaFiftyLAN","followers_url":"https://api.github.com/users/AreaFiftyLAN/followers","following_url":"https://api.github.com/users/AreaFiftyLAN/following{/other_user}","gists_url":"https://api.github.com/users/AreaFiftyLAN/gists{/gist_id}","starred_url":"https://api.github.com/users/AreaFiftyLAN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AreaFiftyLAN/subscriptions","organizations_url":"https://api.github.com/users/AreaFiftyLAN/orgs","repos_url":"https://api.github.com/users/AreaFiftyLAN/repos","events_url":"https://api.github.com/users/AreaFiftyLAN/events{/privacy}","received_events_url":"https://api.github.com/users/AreaFiftyLAN/received_events","type":"Organization","site_admin":false},"repo":{"id":40057514,"name":"lancie-api","full_name":"AreaFiftyLAN/lancie-api","owner":{"login":"AreaFiftyLAN","id":13952301,"avatar_url":"https://avatars.githubusercontent.com/u/13952301?v=3","gravatar_id":"","url":"https://api.github.com/users/AreaFiftyLAN","html_url":"https://github.com/AreaFiftyLAN","followers_url":"https://api.github.com/users/AreaFiftyLAN/followers","following_url":"https://api.github.com/users/AreaFiftyLAN/following{/other_user}","gists_url":"https://api.github.com/users/AreaFiftyLAN/gists{/gist_id}","starred_url":"https://api.github.com/users/AreaFiftyLAN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AreaFiftyLAN/subscriptions","organizations_url":"https://api.github.com/users/AreaFiftyLAN/orgs","repos_url":"https://api.github.com/users/AreaFiftyLAN/repos","events_url":"https://api.github.com/users/AreaFiftyLAN/events{/privacy}","received_events_url":"https://api.github.com/users/AreaFiftyLAN/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AreaFiftyLAN/lancie-api","description":"Spring based implementation of the LANcie API","fork":false,"url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api","forks_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/forks","keys_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/teams","hooks_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/hooks","issue_events_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/issues/events{/number}","events_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/events","assignees_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/assignees{/user}","branches_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/branches{/branch}","tags_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/tags","blobs_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/statuses/{sha}","languages_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/languages","stargazers_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/stargazers","contributors_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/contributors","subscribers_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/subscribers","subscription_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/subscription","commits_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/contents/{+path}","compare_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/merges","archive_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/downloads","issues_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/issues{/number}","pulls_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/pulls{/number}","milestones_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/milestones{/number}","notifications_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/labels{/name}","releases_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/releases{/id}","deployments_url":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/deployments","created_at":"2015-08-01T19:20:38Z","updated_at":"2016-10-22T23:16:04Z","pushed_at":"2017-01-01T14:57:09Z","git_url":"git://github.com/AreaFiftyLAN/lancie-api.git","ssh_url":"git@github.com:AreaFiftyLAN/lancie-api.git","clone_url":"https://github.com/AreaFiftyLAN/lancie-api.git","svn_url":"https://github.com/AreaFiftyLAN/lancie-api","homepage":null,"size":10644,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":49,"forks":1,"open_issues":49,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/pulls/325"},"html":{"href":"https://github.com/AreaFiftyLAN/lancie-api/pull/325"},"issue":{"href":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/issues/325"},"comments":{"href":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/issues/325/comments"},"review_comments":{"href":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/pulls/325/comments"},"review_comment":{"href":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/pulls/325/commits"},"statuses":{"href":"https://api.github.com/repos/AreaFiftyLAN/lancie-api/statuses/18c2a0bb76f19d2f3366a5d634fbd97ff9e0aa4a"}}}}
{"actor":{"display_login":"martijnjanssen"}}