Skip to content

Commit 275131c

Browse files
authored
Merge branch 'master' into feature/security-workflows
2 parents 5d96af2 + 8d7a656 commit 275131c

File tree

15 files changed

+63
-21
lines changed

15 files changed

+63
-21
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
java-version: [ 11 ]
22+
java-version: [ 17 ]
2323

2424
steps:
2525
- uses: actions/checkout@v4
2626

2727
- name: Setup JDK ${{ matrix.java }}
2828
uses: actions/setup-java@v4
2929
with:
30-
distribution: 'zulu'
30+
distribution: 'temurin'
3131
java-version: ${{ matrix.java-version }}
3232

3333
- name: Setup Android SDK
34-
uses: android-actions/setup-android@v2
34+
uses: android-actions/setup-android@v3
3535

3636
- name: Build CORE SDK ${{ matrix.java-version }}
3737
run: ./gradlew --scan clean lint testDebugUnitTest jacocoTestCoverageVerification

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
mavenLocal()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.6.4'
9+
classpath 'com.android.tools.build:gradle:7.4.2'
1010
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7"
1111
// NOTE: Do not place your application dependencies here; they belong
1212
// in the individual module build.gradle files
@@ -19,7 +19,7 @@ allprojects {
1919
mavenCentral()
2020
mavenLocal()
2121
}
22-
project.version = "1.0.2"
22+
project.version = "1.0.3"
2323
}
2424

2525
task clean(type: Delete) {

core/build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ android {
1111
minSdkVersion 21
1212
targetSdkVersion 34
1313
versionCode 4
14-
versionName version
1514
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
15+
buildConfigField("String", "VERSION_NAME", "\"$version\"")
1616
}
1717

1818
buildTypes {
@@ -24,7 +24,7 @@ android {
2424
// Rename the artifact to core-<version>.aar, required since gradle 7
2525
libraryVariants.all { variant ->
2626
variant.outputs.all { output ->
27-
outputFileName = "${archivesBaseName}-${defaultConfig.versionName}.aar"
27+
outputFileName = "${archivesBaseName}-${version}.aar"
2828
}
2929
}
3030
}
@@ -43,16 +43,16 @@ android {
4343

4444
dependencies {
4545

46-
implementation "androidx.appcompat:appcompat:1.2.0"
47-
implementation "androidx.annotation:annotation:1.8.2"
46+
implementation 'androidx.appcompat:appcompat:1.3.1'
47+
implementation 'androidx.annotation:annotation:1.8.2'
4848

4949
testImplementation 'junit:junit:4.13.2'
50-
testImplementation 'org.robolectric:robolectric:4.12.2'
51-
testImplementation "org.mockito:mockito-core:3.2.0"
50+
testImplementation 'org.robolectric:robolectric:4.14.1'
51+
testImplementation 'org.mockito:mockito-core:5.15.2'
5252
testImplementation "com.squareup.okhttp3:mockwebserver:4.12.0"
5353
testImplementation group: 'pl.pragmatists', name: 'JUnitParams', version: "1.1.1"
54-
testImplementation 'org.hamcrest:hamcrest:2.1'
55-
testImplementation 'org.hamcrest:hamcrest-library:2.1'
54+
testImplementation 'org.hamcrest:hamcrest:3.0'
55+
testImplementation 'org.hamcrest:hamcrest-library:3.0'
5656
}
5757

5858

core/config/jacoco-settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apply plugin: 'jacoco'
22

3-
final def jacocoVersion = "0.8.2"
3+
final def jacocoVersion = "0.8.8"
44

55
jacoco {
66
toolVersion = jacocoVersion

core/src/main/java/com/hyperwallet/android/model/graphql/keyed/Country.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public class Country implements KeyedNode {
3838
private static final String CURRENCIES = "currencies";
3939

4040
private final Set<Currency> mCurrencies;
41+
42+
private final String mDefaultCurrencyCode;
4143
private final String mCode;
4244
private final MappedConnection<Currency> mCurrencyMappedConnection;
4345
private final String mName;
@@ -52,6 +54,7 @@ public Country(@NonNull final JSONObject country) throws JSONException, NoSuchMe
5254
mCode = country.optString(COUNTRY_CODE);
5355
mName = country.optString(COUNTRY_NAME);
5456
mCurrencies = new LinkedHashSet<>(1);
57+
mDefaultCurrencyCode = country.optString("defaultCurrencyCode");
5558
JSONObject currencies = country.optJSONObject(CURRENCIES);
5659
if (currencies != null && currencies.length() != 0) {
5760
mCurrencyMappedConnection = new MappedConnection<>(currencies, Currency.class);
@@ -78,6 +81,14 @@ public String getName() {
7881
return mName;
7982
}
8083

84+
/**
85+
* @return Currency code represented in ISO 4217 three-letter code format
86+
*/
87+
88+
public String getDefaultCurrency() {
89+
return mDefaultCurrencyCode;
90+
}
91+
8192
/**
8293
* @return set of {@code Currency} represented by this {@code Country} instance
8394
*/

core/src/main/java/com/hyperwallet/android/model/graphql/query/TransferMethodConfigurationKeysQuery.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public class TransferMethodConfigurationKeysQuery implements GqlQuery {
3535
+ "\t\tnodes {\n"
3636
+ "\t\t\tcode\n"
3737
+ "\t\t\tname\n"
38+
+ "\t\t\tdefaultCurrencyCode\n"
3839
+ "\t\t\tcurrencies {\n"
3940
+ "\t\t\t\tnodes {\n"
4041
+ "\t\t\t\t\tcode\n"

core/src/test/java/com/hyperwallet/android/ConfigurationTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,21 @@
66
import static org.hamcrest.Matchers.notNullValue;
77
import static org.junit.Assert.fail;
88

9+
import com.hyperwallet.android.util.MockShadowSystemClock;
10+
911
import org.json.JSONException;
1012
import org.junit.BeforeClass;
1113
import org.junit.Rule;
1214
import org.junit.Test;
1315
import org.junit.rules.ExpectedException;
1416
import org.junit.runner.RunWith;
1517
import org.robolectric.RobolectricTestRunner;
18+
import org.robolectric.annotation.Config;
1619

1720
import java.util.Date;
1821

1922
@RunWith(RobolectricTestRunner.class)
23+
@Config(shadows = { MockShadowSystemClock.class})
2024
public class ConfigurationTest {
2125

2226
private static Configuration mConfiguration;

core/src/test/java/com/hyperwallet/android/GqlTransactionBuilderTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public void testBuild_withRequiredParametersOnly() {
5757
+ "\t\tnodes {\n"
5858
+ "\t\t\tcode\n"
5959
+ "\t\t\tname\n"
60+
+ "\t\t\tdefaultCurrencyCode\n"
6061
+ "\t\t\tcurrencies {\n"
6162
+ "\t\t\t\tnodes {\n"
6263
+ "\t\t\t\t\tcode\n"

core/src/test/java/com/hyperwallet/android/GqlTransactionTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public void testPerformRequest_usingHttpPost() throws IOException {
8282
+ "\t\tnodes {\n"
8383
+ "\t\t\tcode\n"
8484
+ "\t\t\tname\n"
85+
+ "\t\t\tdefaultCurrencyCode\n"
8586
+ "\t\t\tcurrencies {\n"
8687
+ "\t\t\t\tnodes {\n"
8788
+ "\t\t\t\t\tcode\n"

core/src/test/java/com/hyperwallet/android/RestTransactionBuilderTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void testBuild_withRequiredParametersOnly() throws JSONException {
6767
assertThat(headers.get("Content-Type"), is("application/json"));
6868
assertThat(headers.get("User-Agent"), is("HyperwalletSDK/Android/" + BuildConfig.VERSION_NAME +
6969
"; App: HyperwalletSDK; Android: " + Build.VERSION.RELEASE));
70-
assertThat(headers.get("X-Sdk-Version"), is("1.0.2"));
70+
assertThat(headers.get("X-Sdk-Version"), is("1.0.3"));
7171
assertThat(headers.get("X-Sdk-Type"), is("android"));
7272
assertThat(headers.get("X-Sdk-ContextId"), is(notNullValue()));
7373
assertThat(headers.get("X-Sdk-ContextId"), is(contextId));
@@ -104,7 +104,7 @@ public void testBuild_withJsonModelOptionalParameter() throws JSONException {
104104
assertThat(headers.get("Content-Type"), is("application/json"));
105105
assertThat(headers.get("User-Agent"), is("HyperwalletSDK/Android/" + BuildConfig.VERSION_NAME +
106106
"; App: HyperwalletSDK; Android: " + Build.VERSION.RELEASE));
107-
assertThat(headers.get("X-Sdk-Version"), is("1.0.2"));
107+
assertThat(headers.get("X-Sdk-Version"), is("1.0.3"));
108108
assertThat(headers.get("X-Sdk-Type"), is("android"));
109109
assertThat(headers.get("X-Sdk-ContextId"), is(notNullValue()));
110110
assertThat(headers.get("X-Sdk-ContextId"), is(contextId));
@@ -140,7 +140,7 @@ public void testBuild_withQueryModelOptionalParameter() throws JSONException {
140140
assertThat(headers.get("Content-Type"), is("application/json"));
141141
assertThat(headers.get("User-Agent"), is("HyperwalletSDK/Android/" + BuildConfig.VERSION_NAME +
142142
"; App: HyperwalletSDK; Android: " + Build.VERSION.RELEASE));
143-
assertThat(headers.get("X-Sdk-Version"), is("1.0.2"));
143+
assertThat(headers.get("X-Sdk-Version"), is("1.0.3"));
144144
assertThat(headers.get("X-Sdk-Type"), is("android"));
145145
assertThat(headers.get("X-Sdk-ContextId"), is(notNullValue()));
146146
assertThat(headers.get("X-Sdk-ContextId"), is(contextId));

0 commit comments

Comments
 (0)