Skip to content

Commit b0d7fde

Browse files
committed
fix CI issues on JDK11
1 parent 5c4159f commit b0d7fde

File tree

5 files changed

+24
-22
lines changed

5 files changed

+24
-22
lines changed

.circleci/config.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ version: 2
22
jobs:
33
build:
44
environment:
5-
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"
6-
_JAVA_OPTIONS: -Xms512m -Xmx1024m
5+
JVM_OPTS: -Xmx3200m
76
docker:
87
- image: circleci/android:api-28
98

lib/build.gradle

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id "com.auth0.gradle.oss-library.android" version "0.10.0"
2+
id "com.auth0.gradle.oss-library.android" version "0.12.1"
33
}
44

55
logger.lifecycle("Using version ${version} for ${name}")
@@ -36,6 +36,11 @@ android {
3636
testOptions {
3737
unitTests {
3838
includeAndroidResources = true
39+
// https://github.com/robolectric/robolectric/issues/5115
40+
all {
41+
systemProperty("javax.net.ssl.trustStoreType", "JKS")
42+
maxHeapSize = "1024m"
43+
}
3944
}
4045
}
4146
}

lib/src/main/java/com/auth0/android/lock/LockActivity.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -546,16 +546,16 @@ public void onSuccess(Credentials credentials) {
546546
@Override
547547
public void onFailure(final AuthenticationException error) {
548548
Log.e(TAG, "Failed to authenticate the user: " + error.getMessage(), error);
549+
final AuthenticationError authError = loginErrorBuilder.buildFrom(error);
550+
if (error.isVerificationRequired()) {
551+
completeDatabaseAuthenticationOnBrowser();
552+
return;
553+
}
554+
549555
handler.post(new Runnable() {
550556
@Override
551557
public void run() {
552558
lockView.showProgress(false);
553-
554-
final AuthenticationError authError = loginErrorBuilder.buildFrom(error);
555-
if (error.isVerificationRequired()) {
556-
completeDatabaseAuthenticationOnBrowser();
557-
return;
558-
}
559559
if (error.isMultifactorRequired()) {
560560
String mfaToken = (String) error.getValue(KEY_MFA_TOKEN);
561561
if (!TextUtils.isEmpty(mfaToken)) {

lib/src/test/java/com/auth0/android/lock/LockActivityTest.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@
3636
import org.robolectric.RobolectricTestRunner;
3737
import org.robolectric.annotation.Config;
3838

39+
import java.util.Collections;
3940
import java.util.HashMap;
4041
import java.util.Map;
4142

42-
import edu.emory.mathcs.backport.java.util.Collections;
43-
4443
import static org.hamcrest.CoreMatchers.is;
4544
import static org.hamcrest.CoreMatchers.notNullValue;
4645
import static org.hamcrest.CoreMatchers.nullValue;
@@ -541,7 +540,7 @@ public void shouldCallOAuthAuthenticationWithCustomProvider() {
541540
verify(lockView, never()).showProgress(true);
542541
verify(customProvider).setParameters(mapCaptor.capture());
543542
verify(customProvider).start(eq(activity), any(AuthCallback.class), eq(REQ_CODE_PERMISSIONS), eq(REQ_CODE_CUSTOM_PROVIDER));
544-
AuthResolver.setAuthHandlers(Collections.emptyList());
543+
AuthResolver.setAuthHandlers(Collections.<AuthHandler>emptyList());
545544

546545
Map<String, String> reqParams = mapCaptor.getValue();
547546
assertThat(reqParams, is(notNullValue()));
@@ -579,7 +578,7 @@ public void shouldCallOAuthAuthenticationWithCustomProviderAndAudience() {
579578
verify(lockView, never()).showProgress(true);
580579
verify(customProvider).setParameters(mapCaptor.capture());
581580
verify(customProvider).start(eq(activity), any(AuthCallback.class), eq(REQ_CODE_PERMISSIONS), eq(REQ_CODE_CUSTOM_PROVIDER));
582-
AuthResolver.setAuthHandlers(Collections.emptyList());
581+
AuthResolver.setAuthHandlers(Collections.<AuthHandler>emptyList());
583582

584583
Map<String, String> reqParams = mapCaptor.getValue();
585584
assertThat(reqParams, is(notNullValue()));
@@ -616,7 +615,7 @@ public void shouldCallEnterpriseOAuthAuthenticationWithCustomProvider() {
616615
verify(lockView, never()).showProgress(true);
617616
verify(customProvider).setParameters(mapCaptor.capture());
618617
verify(customProvider).start(eq(activity), any(AuthCallback.class), eq(REQ_CODE_PERMISSIONS), eq(REQ_CODE_CUSTOM_PROVIDER));
619-
AuthResolver.setAuthHandlers(Collections.emptyList());
618+
AuthResolver.setAuthHandlers(Collections.<AuthHandler>emptyList());
620619

621620
Map<String, String> reqParams = mapCaptor.getValue();
622621
assertThat(reqParams, is(notNullValue()));
@@ -705,7 +704,7 @@ public void shouldResumeOAuthAuthenticationWithCustomProviderOnActivityResult()
705704

706705
verify(lockView).showProgress(false);
707706
verify(customProvider).authorize(REQ_CODE_CUSTOM_PROVIDER, Activity.RESULT_OK, intent);
708-
AuthResolver.setAuthHandlers(Collections.emptyList());
707+
AuthResolver.setAuthHandlers(Collections.<AuthHandler>emptyList());
709708
}
710709

711710
@Test
@@ -739,7 +738,7 @@ public void shouldResumeOAuthAuthenticationWithCustomProviderOnNewIntent() {
739738

740739
verify(lockView).showProgress(false);
741740
verify(customProvider).authorize(intent);
742-
AuthResolver.setAuthHandlers(Collections.emptyList());
741+
AuthResolver.setAuthHandlers(Collections.<AuthHandler>emptyList());
743742
}
744743

745744
@Test

lib/src/test/java/com/auth0/android/lock/PasswordlessLockActivityTest.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@
3333
import org.robolectric.RobolectricTestRunner;
3434
import org.robolectric.annotation.Config;
3535

36+
import java.util.Collections;
3637
import java.util.HashMap;
3738
import java.util.Map;
3839

39-
import edu.emory.mathcs.backport.java.util.Collections;
40-
4140
import static org.hamcrest.CoreMatchers.is;
4241
import static org.hamcrest.CoreMatchers.notNullValue;
4342
import static org.hamcrest.CoreMatchers.nullValue;
@@ -229,7 +228,7 @@ public void shouldCallOAuthAuthenticationWithCustomProvider() {
229228
verify(lockView, never()).showProgress(true);
230229
verify(customProvider).setParameters(mapCaptor.capture());
231230
verify(customProvider).start(eq(activity), any(AuthCallback.class), eq(REQ_CODE_PERMISSIONS), eq(REQ_CODE_CUSTOM_PROVIDER));
232-
AuthResolver.setAuthHandlers(Collections.emptyList());
231+
AuthResolver.setAuthHandlers(Collections.<AuthHandler>emptyList());
233232

234233
Map<String, String> reqParams = mapCaptor.getValue();
235234
assertThat(reqParams, is(notNullValue()));
@@ -269,7 +268,7 @@ public void shouldCallOAuthAuthenticationWithCustomProviderAndAudience() {
269268
verify(lockView, never()).showProgress(true);
270269
verify(customProvider).setParameters(mapCaptor.capture());
271270
verify(customProvider).start(eq(activity), any(AuthCallback.class), eq(REQ_CODE_PERMISSIONS), eq(REQ_CODE_CUSTOM_PROVIDER));
272-
AuthResolver.setAuthHandlers(Collections.emptyList());
271+
AuthResolver.setAuthHandlers(Collections.<AuthHandler>emptyList());
273272

274273
Map<String, String> reqParams = mapCaptor.getValue();
275274
assertThat(reqParams, is(notNullValue()));
@@ -327,7 +326,7 @@ public void shouldResumeOAuthAuthenticationWithCustomProviderOnActivityResult()
327326

328327
verify(lockView).showProgress(false);
329328
verify(customProvider).authorize(eq(REQ_CODE_CUSTOM_PROVIDER), eq(Activity.RESULT_OK), eq(intent));
330-
AuthResolver.setAuthHandlers(Collections.emptyList());
329+
AuthResolver.setAuthHandlers(Collections.<AuthHandler>emptyList());
331330
}
332331

333332
@Test
@@ -361,6 +360,6 @@ public void shouldResumeOAuthAuthenticationWithCustomProviderOnNewIntent() {
361360

362361
verify(lockView).showProgress(false);
363362
verify(customProvider).authorize(eq(intent));
364-
AuthResolver.setAuthHandlers(Collections.emptyList());
363+
AuthResolver.setAuthHandlers(Collections.<AuthHandler>emptyList());
365364
}
366365
}

0 commit comments

Comments
 (0)