Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ jobs:
strategy:
fail-fast: false
matrix:
java-version: [ 11 ]
java-version: [ 17 ]

steps:
- uses: actions/checkout@v4

- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'zulu'
distribution: 'temurin'
java-version: ${{ matrix.java-version }}

- name: Setup Android SDK
uses: android-actions/setup-android@v2
uses: android-actions/setup-android@v3

- name: Build CORE SDK ${{ matrix.java-version }}
run: ./gradlew --scan clean lint testDebugUnitTest jacocoTestCoverageVerification
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.4'
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -19,7 +19,7 @@ allprojects {
mavenCentral()
mavenLocal()
}
project.version = "1.0.2"
project.version = "1.0.3-beta-1"
}

task clean(type: Delete) {
Expand Down
16 changes: 8 additions & 8 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
minSdkVersion 21
targetSdkVersion 34
versionCode 4
versionName version
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField("String", "VERSION_NAME", "\"$version\"")
}

buildTypes {
Expand All @@ -24,7 +24,7 @@ android {
// Rename the artifact to core-<version>.aar, required since gradle 7
libraryVariants.all { variant ->
variant.outputs.all { output ->
outputFileName = "${archivesBaseName}-${defaultConfig.versionName}.aar"
outputFileName = "${archivesBaseName}-${version}.aar"
}
}
}
Expand All @@ -43,16 +43,16 @@ android {

dependencies {

implementation "androidx.appcompat:appcompat:1.2.0"
implementation "androidx.annotation:annotation:1.8.2"
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.annotation:annotation:1.9.1'

testImplementation 'junit:junit:4.13.2'
testImplementation 'org.robolectric:robolectric:4.12.2'
testImplementation "org.mockito:mockito-core:3.2.0"
testImplementation 'org.robolectric:robolectric:4.14.1'
testImplementation 'org.mockito:mockito-core:5.15.2'
testImplementation "com.squareup.okhttp3:mockwebserver:4.12.0"
testImplementation group: 'pl.pragmatists', name: 'JUnitParams', version: "1.1.1"
testImplementation 'org.hamcrest:hamcrest:2.1'
testImplementation 'org.hamcrest:hamcrest-library:2.1'
testImplementation 'org.hamcrest:hamcrest:3.0'
testImplementation 'org.hamcrest:hamcrest-library:3.0'
}


Expand Down
2 changes: 1 addition & 1 deletion core/config/jacoco-settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apply plugin: 'jacoco'

final def jacocoVersion = "0.8.2"
final def jacocoVersion = "0.8.8"

jacoco {
toolVersion = jacocoVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@
import static org.hamcrest.Matchers.notNullValue;
import static org.junit.Assert.fail;

import com.hyperwallet.android.util.MockShadowSystemClock;

import org.json.JSONException;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

import java.util.Date;

@RunWith(RobolectricTestRunner.class)
@Config(shadows = { MockShadowSystemClock.class})
public class ConfigurationTest {

private static Configuration mConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void testBuild_withRequiredParametersOnly() throws JSONException {
assertThat(headers.get("Content-Type"), is("application/json"));
assertThat(headers.get("User-Agent"), is("HyperwalletSDK/Android/" + BuildConfig.VERSION_NAME +
"; App: HyperwalletSDK; Android: " + Build.VERSION.RELEASE));
assertThat(headers.get("X-Sdk-Version"), is("1.0.2"));
assertThat(headers.get("X-Sdk-Version"), is("1.0.3-beta-1"));
assertThat(headers.get("X-Sdk-Type"), is("android"));
assertThat(headers.get("X-Sdk-ContextId"), is(notNullValue()));
assertThat(headers.get("X-Sdk-ContextId"), is(contextId));
Expand Down Expand Up @@ -104,7 +104,7 @@ public void testBuild_withJsonModelOptionalParameter() throws JSONException {
assertThat(headers.get("Content-Type"), is("application/json"));
assertThat(headers.get("User-Agent"), is("HyperwalletSDK/Android/" + BuildConfig.VERSION_NAME +
"; App: HyperwalletSDK; Android: " + Build.VERSION.RELEASE));
assertThat(headers.get("X-Sdk-Version"), is("1.0.2"));
assertThat(headers.get("X-Sdk-Version"), is("1.0.3-beta-1"));
assertThat(headers.get("X-Sdk-Type"), is("android"));
assertThat(headers.get("X-Sdk-ContextId"), is(notNullValue()));
assertThat(headers.get("X-Sdk-ContextId"), is(contextId));
Expand Down Expand Up @@ -140,7 +140,7 @@ public void testBuild_withQueryModelOptionalParameter() throws JSONException {
assertThat(headers.get("Content-Type"), is("application/json"));
assertThat(headers.get("User-Agent"), is("HyperwalletSDK/Android/" + BuildConfig.VERSION_NAME +
"; App: HyperwalletSDK; Android: " + Build.VERSION.RELEASE));
assertThat(headers.get("X-Sdk-Version"), is("1.0.2"));
assertThat(headers.get("X-Sdk-Version"), is("1.0.3-beta-1"));
assertThat(headers.get("X-Sdk-Type"), is("android"));
assertThat(headers.get("X-Sdk-ContextId"), is(notNullValue()));
assertThat(headers.get("X-Sdk-ContextId"), is(contextId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import com.hyperwallet.android.Hyperwallet;
import com.hyperwallet.android.exception.HyperwalletException;
import com.hyperwallet.android.exception.HyperwalletRestException;
import com.hyperwallet.android.listener.HyperwalletListener;
import com.hyperwallet.android.model.Error;
import com.hyperwallet.android.model.Errors;
Expand All @@ -32,6 +31,7 @@
import com.hyperwallet.android.rule.HyperwalletMockWebServer;
import com.hyperwallet.android.rule.HyperwalletSdkMock;
import com.hyperwallet.android.sdk.R;
import com.hyperwallet.android.util.MockShadowSystemClock;

import org.junit.Rule;
import org.junit.Test;
Expand All @@ -42,13 +42,15 @@
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

import okhttp3.mockwebserver.RecordedRequest;

@RunWith(RobolectricTestRunner.class)
@Config(shadows = { MockShadowSystemClock.class})
public class ListBalancesTest {
@Rule
public ExternalResourceManager mExternalResourceManager = new ExternalResourceManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import static org.hamcrest.Matchers.endsWith;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Matchers.any;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.hyperwallet.android.util;

import android.os.SystemClock;

import org.robolectric.annotation.Implements;

/**
* Simple SystemClock Shadow representation
* <p>
* Since Gradle 7, the Shadows SystemClock no longer supported
* by Android Shadow provided by Robolectric
*/
@Implements(value = SystemClock.class, callThroughByDefault = true)
public final class MockShadowSystemClock {
private MockShadowSystemClock() {
}

public static long elapsedRealtime() {
return 0;
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Jun 04 07:20:15 PDT 2024
#Tue Feb 18 18:24:15 EST 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists