Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump compileSdkVersion, buildToolsVersion and targetSdkVersion #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ env:

android:
components:
- android-22
- android-21
- android-26
- build-tools-26.0.2
- sys-img-armeabi-v7a-android-22
- android-22
- android-28
- build-tools-28.0.2
- sys-img-armeabi-v7a-android-21
- sys-img-armeabi-v7a-android-22

cache:
directories:
Expand Down
9 changes: 6 additions & 3 deletions src/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ apply plugin: 'com.github.dcendents.android-maven'
group='com.github.uphold'

android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
compileSdkVersion 28
buildToolsVersion '28.0.2'
publishNonDefault true
testBuildType "debug"

Expand All @@ -18,7 +18,7 @@ android {

defaultConfig {
minSdkVersion 16
targetSdkVersion 26
targetSdkVersion 28
versionCode 20
versionName "0.16.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -53,6 +53,9 @@ android {
buildConfigField 'String', 'AUTHORIZATION_SERVER_URL', '"https://sandbox.uphold.com"'
}
}

useLibrary 'android.test.base'
useLibrary 'android.test.mock'
}

if(android.productFlavors.size() > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ public void invalidateSession() {

if (com.uphold.uphold_android_sdk.client.UpholdClient.getApplicationContext() != null) {
initSharedPreferences();
sharedPreferences.edit().remove(CACHED_ACCESS_TOKEN_KEY).apply();

if (sharedPreferences != null) {
sharedPreferences.edit().remove(CACHED_ACCESS_TOKEN_KEY).apply();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package com.uphold.uphold_android_sdk.test.unit.client;

import android.content.Context;
import android.net.Uri;
import android.test.mock.MockContext;
import android.text.TextUtils;

import com.uphold.uphold_android_sdk.BuildConfig;
import com.uphold.uphold_android_sdk.client.UpholdClient;
import com.uphold.uphold_android_sdk.test.unit.util.MockSharedPreferencesContext;
import com.uphold.uphold_android_sdk.util.Header;

import org.junit.Test;
Expand All @@ -29,7 +28,7 @@ public class UpholdClientTest {

@Test
public void beginAuthorizationShouldCallUriParse() throws Exception {
UpholdClient.initialize(new MockSharedPreferencesContext());
UpholdClient.initialize(PowerMockito.mock(Context.class));

UpholdClient upholdClient = new UpholdClient();
ArrayList<String> scopes = new ArrayList<String>() {{
Expand All @@ -40,7 +39,7 @@ public void beginAuthorizationShouldCallUriParse() throws Exception {
PowerMockito.when(TextUtils.join(" ", scopes)).thenReturn("foo");

PowerMockito.mockStatic(Uri.class);
upholdClient.beginAuthorization(new MockContext(), "foo", scopes, "bar");
upholdClient.beginAuthorization(PowerMockito.mock(Context.class), "foo", scopes, "bar");

PowerMockito.verifyStatic();
Uri.parse(String.format("%s/authorize/foo?scope=foo&state=bar", BuildConfig.AUTHORIZATION_SERVER_URL));
Expand Down