Skip to content

Commit

Permalink
feat: update various dependencies (#1172)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The Facebook Login SDK is upgraded to 13.x; this is a transitive dependency, so if you are directly calling the Facebook Login SDK in your app then this may be a braking change; this release of the Parse Android SDK adds a version range to the Facebook Login SDK dependency for correct gradle dependency resolving
  • Loading branch information
rommansabbir committed Jun 10, 2022
1 parent c658995 commit 779dc0b
Show file tree
Hide file tree
Showing 38 changed files with 92 additions and 97 deletions.
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = "1.5.31"
ext.kotlin_version = "1.6.20"
ext.jacocoVersion = '0.8.7'
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
classpath 'com.android.tools.build:gradle:7.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jacoco:org.jacoco.core:$jacocoVersion"
classpath "com.dicedmelon.gradle:jacoco-android:0.1.5"
Expand Down Expand Up @@ -66,7 +66,8 @@ ext {
minSdkVersion = 21
targetSdkVersion = 31

mockitoCoreVersion = "3.12.4"
mockitoCoreVersion = '4.6.1'
junitVersion = "4.13.2"
jupiterVersion = "5.6.0"
robolectricVersion = "4.7"
}
2 changes: 1 addition & 1 deletion coroutines/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ android {
}

ext {
coroutinesVersion = "1.5.2"
coroutinesVersion = "1.6.1"
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion facebook/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {
}

dependencies {
api "com.facebook.android:facebook-login:12.1.0"
api "com.facebook.android:facebook-login:[13.2.0, 14.0["
implementation project(":parse")

testImplementation "junit:junit:$rootProject.ext.junitVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyList;
import static org.mockito.ArgumentMatchers.anyMap;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
Expand Down
2 changes: 1 addition & 1 deletion fcm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ android {
}

dependencies {
api "com.google.firebase:firebase-messaging:23.0.0"
api 'com.google.firebase:firebase-messaging:23.0.3'
implementation project(":parse")
}

Expand Down
6 changes: 3 additions & 3 deletions google/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ android {

dependencies {
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
api "com.google.android.gms:play-services-auth:19.2.0"
api "androidx.activity:activity-ktx:1.3.1"
api "androidx.fragment:fragment-ktx:1.3.1"
api "com.google.android.gms:play-services-auth:20.1.0"
api "androidx.activity:activity-ktx:1.4.0"
api "androidx.fragment:fragment-ktx:1.4.1"
implementation project(":parse")
}

Expand Down
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 Nov 16 15:15:09 EET 2021
#Sat Apr 16 09:27:50 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
7 changes: 6 additions & 1 deletion parse/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ ext {

dependencies {
api "androidx.annotation:annotation:1.3.0"
api "androidx.core:core:1.7.0"
api "androidx.core:core:1.8.0"
api "com.squareup.okhttp3:okhttp:$okhttpVersion"
api project(':bolts-tasks')

testImplementation "org.junit.jupiter:junit-jupiter:$rootProject.ext.jupiterVersion"
testImplementation "org.skyscreamer:jsonassert:1.5.0"
testImplementation "junit:junit:$rootProject.ext.junitVersion"
testImplementation "org.mockito:mockito-core:$rootProject.ext.mockitoCoreVersion"
Expand Down Expand Up @@ -88,6 +89,10 @@ tasks.withType(Test) {
}
}

tasks.withType(Test) {
useJUnitPlatform()
}

jacocoAndroidUnitTestReport {
csv.enabled false
html.enabled true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
Expand Down
4 changes: 2 additions & 2 deletions parse/src/test/java/com/parse/EventuallyPinTest.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.parse;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

Expand Down
6 changes: 3 additions & 3 deletions parse/src/test/java/com/parse/FileObjectStoreTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Matchers.isNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.skyscreamer.jsonassert.JSONAssert.assertEquals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

Expand Down
8 changes: 4 additions & 4 deletions parse/src/test/java/com/parse/OfflineObjectStoreTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
import static junit.framework.Assert.assertSame;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyList;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyBoolean;
import static org.mockito.Matchers.anyList;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
Expand Down
2 changes: 1 addition & 1 deletion parse/src/test/java/com/parse/OfflineQueryLogicTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
Expand Down
4 changes: 2 additions & 2 deletions parse/src/test/java/com/parse/ParseACLTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
Expand Down
44 changes: 17 additions & 27 deletions parse/src/test/java/com/parse/ParseAnalyticsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.anyMap;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Matchers.isNull;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
Expand All @@ -36,7 +36,6 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Matchers;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.LooperMode;

Expand Down Expand Up @@ -92,26 +91,23 @@ public void testTrackEventInBackgroundEmptyName() throws Exception {
public void testTrackEventInBackgroundNormalName() throws Exception {
ParseTaskUtils.wait(ParseAnalytics.trackEventInBackground("test"));

verify(controller, times(1))
.trackEventInBackground(eq("test"), Matchers.eq(null), isNull(String.class));
verify(controller, times(1)).trackEventInBackground(eq("test"), eq(null), isNull());
}

@Test
public void testTrackEventInBackgroundNullParameters() throws Exception {
ParseTaskUtils.wait(
ParseAnalytics.trackEventInBackground("test", (Map<String, String>) null));

verify(controller, times(1))
.trackEventInBackground(eq("test"), Matchers.eq(null), isNull(String.class));
verify(controller, times(1)).trackEventInBackground(eq("test"), eq(null), isNull());
}

@Test
public void testTrackEventInBackgroundEmptyParameters() throws Exception {
Map<String, String> dimensions = new HashMap<>();
ParseTaskUtils.wait(ParseAnalytics.trackEventInBackground("test", dimensions));

verify(controller, times(1))
.trackEventInBackground(eq("test"), eq(dimensions), isNull(String.class));
verify(controller, times(1)).trackEventInBackground(eq("test"), eq(dimensions), isNull());
}

@Test
Expand All @@ -120,17 +116,15 @@ public void testTrackEventInBackgroundNormalParameters() throws Exception {
dimensions.put("key", "value");
ParseTaskUtils.wait(ParseAnalytics.trackEventInBackground("test", dimensions));

verify(controller, times(1))
.trackEventInBackground(eq("test"), eq(dimensions), isNull(String.class));
verify(controller, times(1)).trackEventInBackground(eq("test"), eq(dimensions), isNull());
}

@Test
public void testTrackEventInBackgroundNullCallback() {
Map<String, String> dimensions = new HashMap<>();
ParseAnalytics.trackEventInBackground("test", dimensions, null);

verify(controller, times(1))
.trackEventInBackground(eq("test"), eq(dimensions), isNull(String.class));
verify(controller, times(1)).trackEventInBackground(eq("test"), eq(dimensions), isNull());
}

@Test
Expand All @@ -150,8 +144,7 @@ public void testTrackEventInBackgroundNormalCallback() throws Exception {

// Make sure the callback is called
assertTrue(done.tryAcquire(1, 10, TimeUnit.SECONDS));
verify(controller, times(1))
.trackEventInBackground(eq("test"), eq(dimensions), isNull(String.class));
verify(controller, times(1)).trackEventInBackground(eq("test"), eq(dimensions), isNull());

final Semaphore doneAgain = new Semaphore(0);
ParseAnalytics.trackEventInBackground(
Expand All @@ -165,8 +158,7 @@ public void testTrackEventInBackgroundNormalCallback() throws Exception {

// Make sure the callback is called
assertTrue(doneAgain.tryAcquire(1, 10, TimeUnit.SECONDS));
verify(controller, times(1))
.trackEventInBackground(eq("test"), Matchers.eq(null), isNull(String.class));
verify(controller, times(1)).trackEventInBackground(eq("test"), eq(null), isNull());
}

// endregion
Expand All @@ -177,45 +169,43 @@ public void testTrackEventInBackgroundNormalCallback() throws Exception {
public void testTrackAppOpenedInBackgroundNullIntent() throws Exception {
ParseTaskUtils.wait(ParseAnalytics.trackAppOpenedInBackground(null));

verify(controller, times(1))
.trackAppOpenedInBackground(isNull(String.class), isNull(String.class));
verify(controller, times(1)).trackAppOpenedInBackground(isNull(), isNull());
}

@Test
public void testTrackAppOpenedInBackgroundEmptyIntent() throws Exception {
Intent intent = new Intent();
ParseTaskUtils.wait(ParseAnalytics.trackAppOpenedInBackground(intent));

verify(controller, times(1))
.trackAppOpenedInBackground(isNull(String.class), isNull(String.class));
verify(controller, times(1)).trackAppOpenedInBackground(isNull(), isNull());
}

@Test
public void testTrackAppOpenedInBackgroundNormalIntent() throws Exception {
Intent intent = makeIntentWithParseData("test");
ParseTaskUtils.wait(ParseAnalytics.trackAppOpenedInBackground(intent));

verify(controller, times(1)).trackAppOpenedInBackground(eq("test"), isNull(String.class));
verify(controller, times(1)).trackAppOpenedInBackground(eq("test"), isNull());
}

@Test
public void testTrackAppOpenedInBackgroundDuplicatedIntent() throws Exception {
Intent intent = makeIntentWithParseData("test");
ParseTaskUtils.wait(ParseAnalytics.trackAppOpenedInBackground(intent));

verify(controller, times(1)).trackAppOpenedInBackground(eq("test"), isNull(String.class));
verify(controller, times(1)).trackAppOpenedInBackground(eq("test"), isNull());

ParseTaskUtils.wait(ParseAnalytics.trackAppOpenedInBackground(intent));

verify(controller, times(1)).trackAppOpenedInBackground(eq("test"), isNull(String.class));
verify(controller, times(1)).trackAppOpenedInBackground(eq("test"), isNull());
}

@Test
public void testTrackAppOpenedInBackgroundNullCallback() throws Exception {
Intent intent = makeIntentWithParseData("test");
ParseAnalytics.trackAppOpenedInBackground(intent, null);

verify(controller, times(1)).trackAppOpenedInBackground(eq("test"), isNull(String.class));
verify(controller, times(1)).trackAppOpenedInBackground(eq("test"), isNull());
}

@Test
Expand All @@ -233,7 +223,7 @@ public void testTrackAppOpenedInBackgroundNormalCallback() throws Exception {

// Make sure the callback is called
assertTrue(done.tryAcquire(1, 10, TimeUnit.SECONDS));
verify(controller, times(1)).trackAppOpenedInBackground(eq("test"), isNull(String.class));
verify(controller, times(1)).trackAppOpenedInBackground(eq("test"), isNull());
}

// endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
package com.parse;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
Expand All @@ -20,7 +21,6 @@
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.Matchers;

public class ParseAuthenticationManagerTest {

Expand Down Expand Up @@ -71,7 +71,7 @@ public void testRegister() {
@Test
public void testRestoreAuthentication() throws ParseException {
when(controller.getAsync(false)).thenReturn(Task.<ParseUser>forResult(null));
when(provider.onRestore(Matchers.<Map<String, String>>any())).thenReturn(true);
when(provider.onRestore(any())).thenReturn(true);
manager.register("test_provider", provider);

Map<String, String> authData = new HashMap<>();
Expand Down
Loading

0 comments on commit 779dc0b

Please sign in to comment.