{"action":"created","comment":{"url":"https://api.github.com/repos/TouK/widerest/pulls/comments/84601536","pull_request_review_id":5369704,"id":84601536,"diff_hunk":"@@ -1,67 +1,47 @@\n package pl.touk.widerest.api;\n \n \n-import javaslang.Tuple;\n import org.junit.Test;\n import org.junit.runner.RunWith;\n import org.springframework.test.annotation.DirtiesContext;\n import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;\n-import org.springframework.web.client.HttpServerErrorException;\n+import org.springframework.web.client.HttpClientErrorException;\n import pl.touk.widerest.AbstractTest;\n-import pl.touk.widerest.base.ApiTestUrls;\n import pl.touk.widerest.security.oauth2.Scope;\n \n-import static org.hamcrest.Matchers.equalTo;\n-import static org.hamcrest.Matchers.isEmptyString;\n-import static org.hamcrest.Matchers.not;\n-import static org.junit.Assert.assertThat;\n+import static org.assertj.core.api.Assertions.assertThatExceptionOfType;\n+\n \n @RunWith(SpringJUnit4ClassRunner.class)\n @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)\n public class CurrencyControllerTest extends AbstractTest {\n+    private static final String INVALID_CURRENCY_CODE = \"this_is_definitely_not_a_currency\";\n+    private static final String EUR_CURRENCY_CODE = \"eur\";\n \n     @Test\n-    public void shouldGetDefaultCurrency() throws Throwable {\n-        givenAuthorizationServerClient(authorizationServerClient -> {\n-            whenLoggedInBackoffice(authorizationServerClient, Tuple.of(\"admin\", \"admin\"));\n-            whenAuthorizationRequestedFor(authorizationServerClient, Scope.STAFF, oAuth2RestTemplate -> {\n-\n-                final String currentCurrencyCode = oAuth2RestTemplate.getForObject(ApiTestUrls.DEFAULT_CURRENCY_URL, String.class, serverPort);\n-\n-                assertThat(currentCurrencyCode, not(isEmptyString()));\n-            });\n-        });\n+    public void shouldReturnDefaultCurrencyCode() throws Throwable {\n+        givenAuthorizationFor(Scope.STAFF, adminRestTemplate ->\n+            whenDefaultCurrency.codeRetrieved(defaultCurrencyCode ->\n+                    thenDefaultCurrency.codeEquals(defaultCurrencyCode)\n+            )\n+        );\n     }\n \n     @Test\n-    public void shouldSetDefaultCurrency() throws Throwable {\n-        givenAuthorizationServerClient(authorizationServerClient -> {\n-            whenLoggedInBackoffice(authorizationServerClient, Tuple.of(\"admin\", \"admin\"));\n-            whenAuthorizationRequestedFor(authorizationServerClient, Scope.STAFF, oAuth2RestTemplate -> {\n-\n-                final String eurCurrencyCode = \"eur\";\n-\n-                oAuth2RestTemplate.put(ApiTestUrls.DEFAULT_CURRENCY_URL, eurCurrencyCode, serverPort);\n-\n-                final String currentCurrencyCode = oAuth2RestTemplate.getForObject(ApiTestUrls.DEFAULT_CURRENCY_URL, String.class, serverPort);\n+    public void shouldChangeDefaultCurrencyCode() throws Throwable {","path":"integration-tests/src/test/java/pl/touk/widerest/api/CurrencyControllerTest.java","position":58,"original_position":58,"commit_id":"ad48f423c96c0fab69513b5eb631c062f9a15a27","original_commit_id":"ad48f423c96c0fab69513b5eb631c062f9a15a27","user":{"login":"sputnikci","id":15047461,"avatar_url":"https://avatars.githubusercontent.com/u/15047461?v=3","gravatar_id":"","url":"https://api.github.com/users/sputnikci","html_url":"https://github.com/sputnikci","followers_url":"https://api.github.com/users/sputnikci/followers","following_url":"https://api.github.com/users/sputnikci/following{/other_user}","gists_url":"https://api.github.com/users/sputnikci/gists{/gist_id}","starred_url":"https://api.github.com/users/sputnikci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sputnikci/subscriptions","organizations_url":"https://api.github.com/users/sputnikci/orgs","repos_url":"https://api.github.com/users/sputnikci/repos","events_url":"https://api.github.com/users/sputnikci/events{/privacy}","received_events_url":"https://api.github.com/users/sputnikci/received_events","type":"User","site_admin":false},"body":"\\[Checkstyle\\] ERROR: Throwing 'Throwable' is not allowed\\.","created_at":"2016-10-23T18:43:12Z","updated_at":"2016-10-23T18:43:12Z","html_url":"https://github.com/TouK/widerest/pull/4#discussion_r84601536","pull_request_url":"https://api.github.com/repos/TouK/widerest/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/TouK/widerest/pulls/comments/84601536"},"html":{"href":"https://github.com/TouK/widerest/pull/4#discussion_r84601536"},"pull_request":{"href":"https://api.github.com/repos/TouK/widerest/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/TouK/widerest/pulls/4","id":90523898,"html_url":"https://github.com/TouK/widerest/pull/4","diff_url":"https://github.com/TouK/widerest/pull/4.diff","patch_url":"https://github.com/TouK/widerest/pull/4.patch","issue_url":"https://api.github.com/repos/TouK/widerest/issues/4","number":4,"state":"open","locked":false,"title":"Refactor currency controller","user":{"login":"mstelmas","id":16543582,"avatar_url":"https://avatars.githubusercontent.com/u/16543582?v=3","gravatar_id":"","url":"https://api.github.com/users/mstelmas","html_url":"https://github.com/mstelmas","followers_url":"https://api.github.com/users/mstelmas/followers","following_url":"https://api.github.com/users/mstelmas/following{/other_user}","gists_url":"https://api.github.com/users/mstelmas/gists{/gist_id}","starred_url":"https://api.github.com/users/mstelmas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mstelmas/subscriptions","organizations_url":"https://api.github.com/users/mstelmas/orgs","repos_url":"https://api.github.com/users/mstelmas/repos","events_url":"https://api.github.com/users/mstelmas/events{/privacy}","received_events_url":"https://api.github.com/users/mstelmas/received_events","type":"User","site_admin":false},"body":"Refactored currency controller and its IT tests.","created_at":"2016-10-23T18:16:13Z","updated_at":"2016-10-23T18:43:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5747c6e9b0adb1f81159b0675b09cd8741f987ed","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/TouK/widerest/pulls/4/commits","review_comments_url":"https://api.github.com/repos/TouK/widerest/pulls/4/comments","review_comment_url":"https://api.github.com/repos/TouK/widerest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TouK/widerest/issues/4/comments","statuses_url":"https://api.github.com/repos/TouK/widerest/statuses/ad48f423c96c0fab69513b5eb631c062f9a15a27","head":{"label":"mstelmas:refactor_currency_controller","ref":"refactor_currency_controller","sha":"ad48f423c96c0fab69513b5eb631c062f9a15a27","user":{"login":"mstelmas","id":16543582,"avatar_url":"https://avatars.githubusercontent.com/u/16543582?v=3","gravatar_id":"","url":"https://api.github.com/users/mstelmas","html_url":"https://github.com/mstelmas","followers_url":"https://api.github.com/users/mstelmas/followers","following_url":"https://api.github.com/users/mstelmas/following{/other_user}","gists_url":"https://api.github.com/users/mstelmas/gists{/gist_id}","starred_url":"https://api.github.com/users/mstelmas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mstelmas/subscriptions","organizations_url":"https://api.github.com/users/mstelmas/orgs","repos_url":"https://api.github.com/users/mstelmas/repos","events_url":"https://api.github.com/users/mstelmas/events{/privacy}","received_events_url":"https://api.github.com/users/mstelmas/received_events","type":"User","site_admin":false},"repo":{"id":64688221,"name":"widerest","full_name":"mstelmas/widerest","owner":{"login":"mstelmas","id":16543582,"avatar_url":"https://avatars.githubusercontent.com/u/16543582?v=3","gravatar_id":"","url":"https://api.github.com/users/mstelmas","html_url":"https://github.com/mstelmas","followers_url":"https://api.github.com/users/mstelmas/followers","following_url":"https://api.github.com/users/mstelmas/following{/other_user}","gists_url":"https://api.github.com/users/mstelmas/gists{/gist_id}","starred_url":"https://api.github.com/users/mstelmas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mstelmas/subscriptions","organizations_url":"https://api.github.com/users/mstelmas/orgs","repos_url":"https://api.github.com/users/mstelmas/repos","events_url":"https://api.github.com/users/mstelmas/events{/privacy}","received_events_url":"https://api.github.com/users/mstelmas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mstelmas/widerest","description":null,"fork":true,"url":"https://api.github.com/repos/mstelmas/widerest","forks_url":"https://api.github.com/repos/mstelmas/widerest/forks","keys_url":"https://api.github.com/repos/mstelmas/widerest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mstelmas/widerest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mstelmas/widerest/teams","hooks_url":"https://api.github.com/repos/mstelmas/widerest/hooks","issue_events_url":"https://api.github.com/repos/mstelmas/widerest/issues/events{/number}","events_url":"https://api.github.com/repos/mstelmas/widerest/events","assignees_url":"https://api.github.com/repos/mstelmas/widerest/assignees{/user}","branches_url":"https://api.github.com/repos/mstelmas/widerest/branches{/branch}","tags_url":"https://api.github.com/repos/mstelmas/widerest/tags","blobs_url":"https://api.github.com/repos/mstelmas/widerest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mstelmas/widerest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mstelmas/widerest/git/refs{/sha}","trees_url":"https://api.github.com/repos/mstelmas/widerest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mstelmas/widerest/statuses/{sha}","languages_url":"https://api.github.com/repos/mstelmas/widerest/languages","stargazers_url":"https://api.github.com/repos/mstelmas/widerest/stargazers","contributors_url":"https://api.github.com/repos/mstelmas/widerest/contributors","subscribers_url":"https://api.github.com/repos/mstelmas/widerest/subscribers","subscription_url":"https://api.github.com/repos/mstelmas/widerest/subscription","commits_url":"https://api.github.com/repos/mstelmas/widerest/commits{/sha}","git_commits_url":"https://api.github.com/repos/mstelmas/widerest/git/commits{/sha}","comments_url":"https://api.github.com/repos/mstelmas/widerest/comments{/number}","issue_comment_url":"https://api.github.com/repos/mstelmas/widerest/issues/comments{/number}","contents_url":"https://api.github.com/repos/mstelmas/widerest/contents/{+path}","compare_url":"https://api.github.com/repos/mstelmas/widerest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mstelmas/widerest/merges","archive_url":"https://api.github.com/repos/mstelmas/widerest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mstelmas/widerest/downloads","issues_url":"https://api.github.com/repos/mstelmas/widerest/issues{/number}","pulls_url":"https://api.github.com/repos/mstelmas/widerest/pulls{/number}","milestones_url":"https://api.github.com/repos/mstelmas/widerest/milestones{/number}","notifications_url":"https://api.github.com/repos/mstelmas/widerest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mstelmas/widerest/labels{/name}","releases_url":"https://api.github.com/repos/mstelmas/widerest/releases{/id}","deployments_url":"https://api.github.com/repos/mstelmas/widerest/deployments","created_at":"2016-08-01T17:40:14Z","updated_at":"2016-08-01T17:40:16Z","pushed_at":"2016-10-23T18:35:18Z","git_url":"git://github.com/mstelmas/widerest.git","ssh_url":"git@github.com:mstelmas/widerest.git","clone_url":"https://github.com/mstelmas/widerest.git","svn_url":"https://github.com/mstelmas/widerest","homepage":null,"size":61257,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"TouK:master","ref":"master","sha":"e9d825d68c13b44004b7a7cd7c729787eb5b5581","user":{"login":"TouK","id":136506,"avatar_url":"https://avatars.githubusercontent.com/u/136506?v=3","gravatar_id":"","url":"https://api.github.com/users/TouK","html_url":"https://github.com/TouK","followers_url":"https://api.github.com/users/TouK/followers","following_url":"https://api.github.com/users/TouK/following{/other_user}","gists_url":"https://api.github.com/users/TouK/gists{/gist_id}","starred_url":"https://api.github.com/users/TouK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TouK/subscriptions","organizations_url":"https://api.github.com/users/TouK/orgs","repos_url":"https://api.github.com/users/TouK/repos","events_url":"https://api.github.com/users/TouK/events{/privacy}","received_events_url":"https://api.github.com/users/TouK/received_events","type":"Organization","site_admin":false},"repo":{"id":56679679,"name":"widerest","full_name":"TouK/widerest","owner":{"login":"TouK","id":136506,"avatar_url":"https://avatars.githubusercontent.com/u/136506?v=3","gravatar_id":"","url":"https://api.github.com/users/TouK","html_url":"https://github.com/TouK","followers_url":"https://api.github.com/users/TouK/followers","following_url":"https://api.github.com/users/TouK/following{/other_user}","gists_url":"https://api.github.com/users/TouK/gists{/gist_id}","starred_url":"https://api.github.com/users/TouK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TouK/subscriptions","organizations_url":"https://api.github.com/users/TouK/orgs","repos_url":"https://api.github.com/users/TouK/repos","events_url":"https://api.github.com/users/TouK/events{/privacy}","received_events_url":"https://api.github.com/users/TouK/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TouK/widerest","description":null,"fork":false,"url":"https://api.github.com/repos/TouK/widerest","forks_url":"https://api.github.com/repos/TouK/widerest/forks","keys_url":"https://api.github.com/repos/TouK/widerest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TouK/widerest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TouK/widerest/teams","hooks_url":"https://api.github.com/repos/TouK/widerest/hooks","issue_events_url":"https://api.github.com/repos/TouK/widerest/issues/events{/number}","events_url":"https://api.github.com/repos/TouK/widerest/events","assignees_url":"https://api.github.com/repos/TouK/widerest/assignees{/user}","branches_url":"https://api.github.com/repos/TouK/widerest/branches{/branch}","tags_url":"https://api.github.com/repos/TouK/widerest/tags","blobs_url":"https://api.github.com/repos/TouK/widerest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TouK/widerest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TouK/widerest/git/refs{/sha}","trees_url":"https://api.github.com/repos/TouK/widerest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TouK/widerest/statuses/{sha}","languages_url":"https://api.github.com/repos/TouK/widerest/languages","stargazers_url":"https://api.github.com/repos/TouK/widerest/stargazers","contributors_url":"https://api.github.com/repos/TouK/widerest/contributors","subscribers_url":"https://api.github.com/repos/TouK/widerest/subscribers","subscription_url":"https://api.github.com/repos/TouK/widerest/subscription","commits_url":"https://api.github.com/repos/TouK/widerest/commits{/sha}","git_commits_url":"https://api.github.com/repos/TouK/widerest/git/commits{/sha}","comments_url":"https://api.github.com/repos/TouK/widerest/comments{/number}","issue_comment_url":"https://api.github.com/repos/TouK/widerest/issues/comments{/number}","contents_url":"https://api.github.com/repos/TouK/widerest/contents/{+path}","compare_url":"https://api.github.com/repos/TouK/widerest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TouK/widerest/merges","archive_url":"https://api.github.com/repos/TouK/widerest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TouK/widerest/downloads","issues_url":"https://api.github.com/repos/TouK/widerest/issues{/number}","pulls_url":"https://api.github.com/repos/TouK/widerest/pulls{/number}","milestones_url":"https://api.github.com/repos/TouK/widerest/milestones{/number}","notifications_url":"https://api.github.com/repos/TouK/widerest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TouK/widerest/labels{/name}","releases_url":"https://api.github.com/repos/TouK/widerest/releases{/id}","deployments_url":"https://api.github.com/repos/TouK/widerest/deployments","created_at":"2016-04-20T10:59:28Z","updated_at":"2016-06-01T09:10:52Z","pushed_at":"2016-10-23T18:35:18Z","git_url":"git://github.com/TouK/widerest.git","ssh_url":"git@github.com:TouK/widerest.git","clone_url":"https://github.com/TouK/widerest.git","svn_url":"https://github.com/TouK/widerest","homepage":null,"size":61283,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TouK/widerest/pulls/4"},"html":{"href":"https://github.com/TouK/widerest/pull/4"},"issue":{"href":"https://api.github.com/repos/TouK/widerest/issues/4"},"comments":{"href":"https://api.github.com/repos/TouK/widerest/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/TouK/widerest/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/TouK/widerest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TouK/widerest/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/TouK/widerest/statuses/ad48f423c96c0fab69513b5eb631c062f9a15a27"}}}}
{"actor":{"display_login":"sputnikci"}}