{"action":"created","comment":{"url":"https://api.github.com/repos/klarna/klarna-on-demand-android/pulls/comments/22945266","id":22945266,"diff_hunk":"@@ -0,0 +1,82 @@\n+package com.klarna.ondemand;\n+\n+import org.junit.After;\n+import org.junit.Assert;\n+import org.junit.Before;\n+import org.junit.Rule;\n+import org.junit.Test;\n+import org.junit.runner.RunWith;\n+import org.mockito.Mockito;\n+import org.powermock.api.mockito.PowerMockito;\n+import org.powermock.core.classloader.annotations.PowerMockIgnore;\n+import org.powermock.core.classloader.annotations.PrepareForTest;\n+import org.powermock.modules.junit4.rule.PowerMockRule;\n+import org.robolectric.RobolectricTestRunner;\n+import org.robolectric.annotation.Config;\n+\n+import java.util.Locale;\n+\n+\n+@RunWith(RobolectricTestRunner.class)\n+@Config(emulateSdk = 18)\n+@PrepareForTest(Context.class)\n+@PowerMockIgnore({ \"org.mockito.*\", \"org.robolectric.*\", \"android.*\" })\n+public class UrlHelperTest {\n+\n+    private String token = \"my_token\";\n+\n+    @Rule\n+    public PowerMockRule rule = new PowerMockRule();\n+\n+    @Before\n+    public void beforeEach() {\n+        PowerMockito.mockStatic(Context.class);\n+        Mockito.when(Context.getApiKey()).thenReturn(\"test_skadoo\");\n+    }\n+\n+    //region .registrationUrl\n+    @Test\n+    public void registrationUrl_ShouldReturnPlaygroundUrl_WhenTokenIsForPlayground() {\n+        Assert.assertTrue(UrlHelper.registrationUrl().startsWith(\"https://inapp.playground.klarna.com/registration/new\"));\n+    }\n+\n+    @Test\n+    public void registrationUrl_ShouldReturnProductionUrl_WhenTokenIsForProduction() {\n+        PowerMockito.mockStatic(Context.class);","path":"klarna-on-demand/src/test/java/com/klarna/ondemand/UrlHelperTest.java","position":45,"original_position":45,"commit_id":"504dd630758fc1ce9dfd18478fde0a904478adb9","original_commit_id":"d35c7ee23be762f2d434364ef686957275b1dc5b","user":{"login":"tomerlevi444","id":7806514,"avatar_url":"https://avatars.githubusercontent.com/u/7806514?v=3","gravatar_id":"","url":"https://api.github.com/users/tomerlevi444","html_url":"https://github.com/tomerlevi444","followers_url":"https://api.github.com/users/tomerlevi444/followers","following_url":"https://api.github.com/users/tomerlevi444/following{/other_user}","gists_url":"https://api.github.com/users/tomerlevi444/gists{/gist_id}","starred_url":"https://api.github.com/users/tomerlevi444/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomerlevi444/subscriptions","organizations_url":"https://api.github.com/users/tomerlevi444/orgs","repos_url":"https://api.github.com/users/tomerlevi444/repos","events_url":"https://api.github.com/users/tomerlevi444/events{/privacy}","received_events_url":"https://api.github.com/users/tomerlevi444/received_events","type":"User","site_admin":false},"body":"When you mock something that's already mocked, it replaces the return values. \r\nYes, mocks clear after each test (both static and non-static mocks).\r\nI've also revalidated this.","created_at":"2015-01-14T15:51:31Z","updated_at":"2015-01-14T15:51:31Z","html_url":"https://github.com/klarna/klarna-on-demand-android/pull/2#discussion_r22945266","pull_request_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/klarna/klarna-on-demand-android/pulls/comments/22945266"},"html":{"href":"https://github.com/klarna/klarna-on-demand-android/pull/2#discussion_r22945266"},"pull_request":{"href":"https://api.github.com/repos/klarna/klarna-on-demand-android/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/klarna/klarna-on-demand-android/pulls/2","id":27284741,"html_url":"https://github.com/klarna/klarna-on-demand-android/pull/2","diff_url":"https://github.com/klarna/klarna-on-demand-android/pull/2.diff","patch_url":"https://github.com/klarna/klarna-on-demand-android/pull/2.patch","issue_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/issues/2","number":2,"state":"open","locked":false,"title":"Iaco 586 handle jockey events","user":{"login":"tomerlevi444","id":7806514,"avatar_url":"https://avatars.githubusercontent.com/u/7806514?v=3","gravatar_id":"","url":"https://api.github.com/users/tomerlevi444","html_url":"https://github.com/tomerlevi444","followers_url":"https://api.github.com/users/tomerlevi444/followers","following_url":"https://api.github.com/users/tomerlevi444/following{/other_user}","gists_url":"https://api.github.com/users/tomerlevi444/gists{/gist_id}","starred_url":"https://api.github.com/users/tomerlevi444/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomerlevi444/subscriptions","organizations_url":"https://api.github.com/users/tomerlevi444/orgs","repos_url":"https://api.github.com/users/tomerlevi444/repos","events_url":"https://api.github.com/users/tomerlevi444/events{/privacy}","received_events_url":"https://api.github.com/users/tomerlevi444/received_events","type":"User","site_admin":false},"body":"- Handle Jockey events.\r\n- Preferences page.\r\n- Unit test framework: Junit4 + Robolectric + PowerMock + Mockito.\r\n- Tests.","created_at":"2015-01-13T16:40:24Z","updated_at":"2015-01-14T15:51:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8669b6c5066496609df6db88d9c54618c779cd53","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/pulls/2/commits","review_comments_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/pulls/2/comments","review_comment_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/pulls/comments/{number}","comments_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/issues/2/comments","statuses_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/statuses/504dd630758fc1ce9dfd18478fde0a904478adb9","head":{"label":"klarna:iaco-586-handle-jockey-events","ref":"iaco-586-handle-jockey-events","sha":"504dd630758fc1ce9dfd18478fde0a904478adb9","user":{"login":"klarna","id":394540,"avatar_url":"https://avatars.githubusercontent.com/u/394540?v=3","gravatar_id":"","url":"https://api.github.com/users/klarna","html_url":"https://github.com/klarna","followers_url":"https://api.github.com/users/klarna/followers","following_url":"https://api.github.com/users/klarna/following{/other_user}","gists_url":"https://api.github.com/users/klarna/gists{/gist_id}","starred_url":"https://api.github.com/users/klarna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klarna/subscriptions","organizations_url":"https://api.github.com/users/klarna/orgs","repos_url":"https://api.github.com/users/klarna/repos","events_url":"https://api.github.com/users/klarna/events{/privacy}","received_events_url":"https://api.github.com/users/klarna/received_events","type":"Organization","site_admin":false},"repo":{"id":29127570,"name":"klarna-on-demand-android","full_name":"klarna/klarna-on-demand-android","owner":{"login":"klarna","id":394540,"avatar_url":"https://avatars.githubusercontent.com/u/394540?v=3","gravatar_id":"","url":"https://api.github.com/users/klarna","html_url":"https://github.com/klarna","followers_url":"https://api.github.com/users/klarna/followers","following_url":"https://api.github.com/users/klarna/following{/other_user}","gists_url":"https://api.github.com/users/klarna/gists{/gist_id}","starred_url":"https://api.github.com/users/klarna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klarna/subscriptions","organizations_url":"https://api.github.com/users/klarna/orgs","repos_url":"https://api.github.com/users/klarna/repos","events_url":"https://api.github.com/users/klarna/events{/privacy}","received_events_url":"https://api.github.com/users/klarna/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/klarna/klarna-on-demand-android","description":"Klarna On Demand SDK for Android","fork":false,"url":"https://api.github.com/repos/klarna/klarna-on-demand-android","forks_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/forks","keys_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/teams","hooks_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/hooks","issue_events_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/issues/events{/number}","events_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/events","assignees_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/assignees{/user}","branches_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/branches{/branch}","tags_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/tags","blobs_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/statuses/{sha}","languages_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/languages","stargazers_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/stargazers","contributors_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/contributors","subscribers_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/subscribers","subscription_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/subscription","commits_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/issues/comments/{number}","contents_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/contents/{+path}","compare_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/merges","archive_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/downloads","issues_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/issues{/number}","pulls_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/pulls{/number}","milestones_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/milestones{/number}","notifications_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/labels{/name}","releases_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/releases{/id}","created_at":"2015-01-12T09:13:58Z","updated_at":"2015-01-14T07:33:10Z","pushed_at":"2015-01-14T14:33:35Z","git_url":"git://github.com/klarna/klarna-on-demand-android.git","ssh_url":"git@github.com:klarna/klarna-on-demand-android.git","clone_url":"https://github.com/klarna/klarna-on-demand-android.git","svn_url":"https://github.com/klarna/klarna-on-demand-android","homepage":null,"size":0,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"klarna:master","ref":"master","sha":"a75efd4277eca3b89d4d33eb68c0bc304386d5f7","user":{"login":"klarna","id":394540,"avatar_url":"https://avatars.githubusercontent.com/u/394540?v=3","gravatar_id":"","url":"https://api.github.com/users/klarna","html_url":"https://github.com/klarna","followers_url":"https://api.github.com/users/klarna/followers","following_url":"https://api.github.com/users/klarna/following{/other_user}","gists_url":"https://api.github.com/users/klarna/gists{/gist_id}","starred_url":"https://api.github.com/users/klarna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klarna/subscriptions","organizations_url":"https://api.github.com/users/klarna/orgs","repos_url":"https://api.github.com/users/klarna/repos","events_url":"https://api.github.com/users/klarna/events{/privacy}","received_events_url":"https://api.github.com/users/klarna/received_events","type":"Organization","site_admin":false},"repo":{"id":29127570,"name":"klarna-on-demand-android","full_name":"klarna/klarna-on-demand-android","owner":{"login":"klarna","id":394540,"avatar_url":"https://avatars.githubusercontent.com/u/394540?v=3","gravatar_id":"","url":"https://api.github.com/users/klarna","html_url":"https://github.com/klarna","followers_url":"https://api.github.com/users/klarna/followers","following_url":"https://api.github.com/users/klarna/following{/other_user}","gists_url":"https://api.github.com/users/klarna/gists{/gist_id}","starred_url":"https://api.github.com/users/klarna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klarna/subscriptions","organizations_url":"https://api.github.com/users/klarna/orgs","repos_url":"https://api.github.com/users/klarna/repos","events_url":"https://api.github.com/users/klarna/events{/privacy}","received_events_url":"https://api.github.com/users/klarna/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/klarna/klarna-on-demand-android","description":"Klarna On Demand SDK for Android","fork":false,"url":"https://api.github.com/repos/klarna/klarna-on-demand-android","forks_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/forks","keys_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/teams","hooks_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/hooks","issue_events_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/issues/events{/number}","events_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/events","assignees_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/assignees{/user}","branches_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/branches{/branch}","tags_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/tags","blobs_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/statuses/{sha}","languages_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/languages","stargazers_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/stargazers","contributors_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/contributors","subscribers_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/subscribers","subscription_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/subscription","commits_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/issues/comments/{number}","contents_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/contents/{+path}","compare_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/merges","archive_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/downloads","issues_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/issues{/number}","pulls_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/pulls{/number}","milestones_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/milestones{/number}","notifications_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/labels{/name}","releases_url":"https://api.github.com/repos/klarna/klarna-on-demand-android/releases{/id}","created_at":"2015-01-12T09:13:58Z","updated_at":"2015-01-14T07:33:10Z","pushed_at":"2015-01-14T14:33:35Z","git_url":"git://github.com/klarna/klarna-on-demand-android.git","ssh_url":"git@github.com:klarna/klarna-on-demand-android.git","clone_url":"https://github.com/klarna/klarna-on-demand-android.git","svn_url":"https://github.com/klarna/klarna-on-demand-android","homepage":null,"size":0,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/klarna/klarna-on-demand-android/pulls/2"},"html":{"href":"https://github.com/klarna/klarna-on-demand-android/pull/2"},"issue":{"href":"https://api.github.com/repos/klarna/klarna-on-demand-android/issues/2"},"comments":{"href":"https://api.github.com/repos/klarna/klarna-on-demand-android/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/klarna/klarna-on-demand-android/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/klarna/klarna-on-demand-android/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/klarna/klarna-on-demand-android/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/klarna/klarna-on-demand-android/statuses/504dd630758fc1ce9dfd18478fde0a904478adb9"}}}}