{"action":"created","comment":{"url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/pulls/comments/53563057","id":53563057,"diff_hunk":"@@ -0,0 +1,45 @@\n+package com.stormpath.sdk;\n+\n+import org.junit.Test;\n+\n+import static org.assertj.core.api.Assertions.assertThat;\n+\n+public class StormpathConfigurationTest extends BaseTest {\n+\n+    @Test(expected = IllegalStateException.class)\n+    public void exceptionThrownIfBaseUrlNotSet() throws Exception {\n+        new StormpathConfiguration.Builder().build();\n+    }\n+\n+    @Test\n+    public void pathsStartWithSlash() throws Exception {\n+        StormpathConfiguration stormpath = new StormpathConfiguration.Builder()\n+                .baseUrl(\"https://api.stormpath.com/v1\")\n+                .oauthPath(\"my-oauth\")\n+                .registerPath(\"my-register\")\n+                .passwordResetPath(\"my-password-reset\")\n+                .verifyEmailPath(\"my-verify-email\")\n+                .userProfilePath(\"my-me-path\")\n+                .logoutPath(\"my-logout-path\")\n+                .build();\n+\n+        assertThat(stormpath.oauthPath()).isEqualTo(\"/my-oauth\");\n+        assertThat(stormpath.registerPath()).isEqualTo(\"/my-register\");\n+        assertThat(stormpath.passwordResetPath()).isEqualTo(\"/my-password-reset\");\n+        assertThat(stormpath.verifyEmailPath()).isEqualTo(\"/my-verify-email\");\n+        assertThat(stormpath.userProfilePath()).isEqualTo(\"/my-me-path\");\n+        assertThat(stormpath.logoutPath()).isEqualTo(\"/my-logout-path\");\n+    }\n+\n+    @Test\n+    public void baseUrlWithoutTrailingSlash() throws Exception {\n+        StormpathConfiguration stormpath = new StormpathConfiguration.Builder().baseUrl(\"https://example.com/\").build();","path":"sdk/src/test/java/com/stormpath/sdk/StormpathConfigurationTest.java","position":36,"original_position":36,"commit_id":"f3bd5c04cad7d6ceba227211f9ea8302a7d27387","original_commit_id":"acc1765fcc077fab64f239bc2c103b8c68ac69fe","user":{"login":"reisub","id":992835,"avatar_url":"https://avatars.githubusercontent.com/u/992835?v=3","gravatar_id":"","url":"https://api.github.com/users/reisub","html_url":"https://github.com/reisub","followers_url":"https://api.github.com/users/reisub/followers","following_url":"https://api.github.com/users/reisub/following{/other_user}","gists_url":"https://api.github.com/users/reisub/gists{/gist_id}","starred_url":"https://api.github.com/users/reisub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reisub/subscriptions","organizations_url":"https://api.github.com/users/reisub/orgs","repos_url":"https://api.github.com/users/reisub/repos","events_url":"https://api.github.com/users/reisub/events{/privacy}","received_events_url":"https://api.github.com/users/reisub/received_events","type":"User","site_admin":false},"body":"Different environments are easily achieved by leveraging the gradle build system. The Android gradle plugin generates a `BuildConfig` class at compile time:\r\n\r\n```java\r\n/**\r\n * Automatically generated file. DO NOT MODIFY\r\n */\r\npackage com.stormpath.sdk;\r\n\r\npublic final class BuildConfig {\r\n  public static final boolean DEBUG = Boolean.parseBoolean(\"true\");\r\n  public static final String APPLICATION_ID = \"com.stormpath.sdk\";\r\n  public static final String BUILD_TYPE = \"debug\";\r\n  public static final String FLAVOR = \"\";\r\n  public static final int VERSION_CODE = -1;\r\n  public static final String VERSION_NAME = \"322baf4\";\r\n}\r\n```\r\n\r\nAnd there is also a way to define a custom field for this class which is different in each buildType in `build.gradle`:\r\n\r\n```groovy\r\n    buildTypes {\r\n        debug {\r\n            buildConfigField 'String', 'API_URL', '\"https://api.test.example.com\"'\r\n        }\r\n        release {\r\n            minifyEnabled false\r\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\r\n            buildConfigField 'String', 'API_URL', '\"https://api.example.com\"'\r\n        }\r\n    }\r\n```\r\nThat way the constant `BuildConfig.API_URL` is generated and we can use it to initialize the Stormpath SDK and the correct one will be used depending on which buildType we are building.\r\n\r\nIf you think it would help, we can add an example of this in the example app. I don't think we need to do anything in the SDK itself for this.","created_at":"2016-02-21T08:00:29Z","updated_at":"2016-02-21T08:00:29Z","html_url":"https://github.com/stormpath/stormpath-sdk-android/pull/6#discussion_r53563057","pull_request_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/stormpath/stormpath-sdk-android/pulls/comments/53563057"},"html":{"href":"https://github.com/stormpath/stormpath-sdk-android/pull/6#discussion_r53563057"},"pull_request":{"href":"https://api.github.com/repos/stormpath/stormpath-sdk-android/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/pulls/6","id":60053905,"html_url":"https://github.com/stormpath/stormpath-sdk-android/pull/6","diff_url":"https://github.com/stormpath/stormpath-sdk-android/pull/6.diff","patch_url":"https://github.com/stormpath/stormpath-sdk-android/pull/6.patch","issue_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/issues/6","number":6,"state":"open","locked":false,"title":"MVP","user":{"login":"reisub","id":992835,"avatar_url":"https://avatars.githubusercontent.com/u/992835?v=3","gravatar_id":"","url":"https://api.github.com/users/reisub","html_url":"https://github.com/reisub","followers_url":"https://api.github.com/users/reisub/followers","following_url":"https://api.github.com/users/reisub/following{/other_user}","gists_url":"https://api.github.com/users/reisub/gists{/gist_id}","starred_url":"https://api.github.com/users/reisub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reisub/subscriptions","organizations_url":"https://api.github.com/users/reisub/orgs","repos_url":"https://api.github.com/users/reisub/repos","events_url":"https://api.github.com/users/reisub/events{/privacy}","received_events_url":"https://api.github.com/users/reisub/received_events","type":"User","site_admin":false},"body":"Implements the functionality listed in #1.","created_at":"2016-02-20T17:13:49Z","updated_at":"2016-02-21T08:00:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"64068e436751e0108185403d0e023c23f785f138","assignee":{"login":"dogeared","id":364562,"avatar_url":"https://avatars.githubusercontent.com/u/364562?v=3","gravatar_id":"","url":"https://api.github.com/users/dogeared","html_url":"https://github.com/dogeared","followers_url":"https://api.github.com/users/dogeared/followers","following_url":"https://api.github.com/users/dogeared/following{/other_user}","gists_url":"https://api.github.com/users/dogeared/gists{/gist_id}","starred_url":"https://api.github.com/users/dogeared/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dogeared/subscriptions","organizations_url":"https://api.github.com/users/dogeared/orgs","repos_url":"https://api.github.com/users/dogeared/repos","events_url":"https://api.github.com/users/dogeared/events{/privacy}","received_events_url":"https://api.github.com/users/dogeared/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/pulls/6/commits","review_comments_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/pulls/6/comments","review_comment_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/issues/6/comments","statuses_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/statuses/f3bd5c04cad7d6ceba227211f9ea8302a7d27387","head":{"label":"stormpath:mvp","ref":"mvp","sha":"f3bd5c04cad7d6ceba227211f9ea8302a7d27387","user":{"login":"stormpath","id":1377453,"avatar_url":"https://avatars.githubusercontent.com/u/1377453?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpath","html_url":"https://github.com/stormpath","followers_url":"https://api.github.com/users/stormpath/followers","following_url":"https://api.github.com/users/stormpath/following{/other_user}","gists_url":"https://api.github.com/users/stormpath/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpath/subscriptions","organizations_url":"https://api.github.com/users/stormpath/orgs","repos_url":"https://api.github.com/users/stormpath/repos","events_url":"https://api.github.com/users/stormpath/events{/privacy}","received_events_url":"https://api.github.com/users/stormpath/received_events","type":"Organization","site_admin":false},"repo":{"id":50927803,"name":"stormpath-sdk-android","full_name":"stormpath/stormpath-sdk-android","owner":{"login":"stormpath","id":1377453,"avatar_url":"https://avatars.githubusercontent.com/u/1377453?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpath","html_url":"https://github.com/stormpath","followers_url":"https://api.github.com/users/stormpath/followers","following_url":"https://api.github.com/users/stormpath/following{/other_user}","gists_url":"https://api.github.com/users/stormpath/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpath/subscriptions","organizations_url":"https://api.github.com/users/stormpath/orgs","repos_url":"https://api.github.com/users/stormpath/repos","events_url":"https://api.github.com/users/stormpath/events{/privacy}","received_events_url":"https://api.github.com/users/stormpath/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stormpath/stormpath-sdk-android","description":"","fork":false,"url":"https://api.github.com/repos/stormpath/stormpath-sdk-android","forks_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/forks","keys_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/teams","hooks_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/hooks","issue_events_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/issues/events{/number}","events_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/events","assignees_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/assignees{/user}","branches_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/branches{/branch}","tags_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/tags","blobs_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/statuses/{sha}","languages_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/languages","stargazers_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/stargazers","contributors_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/contributors","subscribers_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/subscribers","subscription_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/subscription","commits_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/contents/{+path}","compare_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/merges","archive_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/downloads","issues_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/issues{/number}","pulls_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/pulls{/number}","milestones_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/milestones{/number}","notifications_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/labels{/name}","releases_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/releases{/id}","deployments_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/deployments","created_at":"2016-02-02T14:53:34Z","updated_at":"2016-02-20T17:34:36Z","pushed_at":"2016-02-21T07:43:55Z","git_url":"git://github.com/stormpath/stormpath-sdk-android.git","ssh_url":"git@github.com:stormpath/stormpath-sdk-android.git","clone_url":"https://github.com/stormpath/stormpath-sdk-android.git","svn_url":"https://github.com/stormpath/stormpath-sdk-android","homepage":null,"size":169,"stargazers_count":3,"watchers_count":3,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":3,"default_branch":"master"}},"base":{"label":"stormpath:dev","ref":"dev","sha":"9c22561dbf2a38046fde77001dfcc89a9b36e60d","user":{"login":"stormpath","id":1377453,"avatar_url":"https://avatars.githubusercontent.com/u/1377453?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpath","html_url":"https://github.com/stormpath","followers_url":"https://api.github.com/users/stormpath/followers","following_url":"https://api.github.com/users/stormpath/following{/other_user}","gists_url":"https://api.github.com/users/stormpath/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpath/subscriptions","organizations_url":"https://api.github.com/users/stormpath/orgs","repos_url":"https://api.github.com/users/stormpath/repos","events_url":"https://api.github.com/users/stormpath/events{/privacy}","received_events_url":"https://api.github.com/users/stormpath/received_events","type":"Organization","site_admin":false},"repo":{"id":50927803,"name":"stormpath-sdk-android","full_name":"stormpath/stormpath-sdk-android","owner":{"login":"stormpath","id":1377453,"avatar_url":"https://avatars.githubusercontent.com/u/1377453?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpath","html_url":"https://github.com/stormpath","followers_url":"https://api.github.com/users/stormpath/followers","following_url":"https://api.github.com/users/stormpath/following{/other_user}","gists_url":"https://api.github.com/users/stormpath/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpath/subscriptions","organizations_url":"https://api.github.com/users/stormpath/orgs","repos_url":"https://api.github.com/users/stormpath/repos","events_url":"https://api.github.com/users/stormpath/events{/privacy}","received_events_url":"https://api.github.com/users/stormpath/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stormpath/stormpath-sdk-android","description":"","fork":false,"url":"https://api.github.com/repos/stormpath/stormpath-sdk-android","forks_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/forks","keys_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/teams","hooks_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/hooks","issue_events_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/issues/events{/number}","events_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/events","assignees_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/assignees{/user}","branches_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/branches{/branch}","tags_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/tags","blobs_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/statuses/{sha}","languages_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/languages","stargazers_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/stargazers","contributors_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/contributors","subscribers_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/subscribers","subscription_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/subscription","commits_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/contents/{+path}","compare_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/merges","archive_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/downloads","issues_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/issues{/number}","pulls_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/pulls{/number}","milestones_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/milestones{/number}","notifications_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/labels{/name}","releases_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/releases{/id}","deployments_url":"https://api.github.com/repos/stormpath/stormpath-sdk-android/deployments","created_at":"2016-02-02T14:53:34Z","updated_at":"2016-02-20T17:34:36Z","pushed_at":"2016-02-21T07:43:55Z","git_url":"git://github.com/stormpath/stormpath-sdk-android.git","ssh_url":"git@github.com:stormpath/stormpath-sdk-android.git","clone_url":"https://github.com/stormpath/stormpath-sdk-android.git","svn_url":"https://github.com/stormpath/stormpath-sdk-android","homepage":null,"size":169,"stargazers_count":3,"watchers_count":3,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stormpath/stormpath-sdk-android/pulls/6"},"html":{"href":"https://github.com/stormpath/stormpath-sdk-android/pull/6"},"issue":{"href":"https://api.github.com/repos/stormpath/stormpath-sdk-android/issues/6"},"comments":{"href":"https://api.github.com/repos/stormpath/stormpath-sdk-android/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/stormpath/stormpath-sdk-android/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/stormpath/stormpath-sdk-android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stormpath/stormpath-sdk-android/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/stormpath/stormpath-sdk-android/statuses/f3bd5c04cad7d6ceba227211f9ea8302a7d27387"}}}}