Skip to content

Commit e43f00d

Browse files
committed
Upgrade leakcanary and downgrade to mockito-core
1 parent ae339dd commit e43f00d

File tree

8 files changed

+25
-25
lines changed

8 files changed

+25
-25
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ subprojects {
8989
testRulesVersion = '1.2.0'
9090
espressoVersion = '3.4.0'
9191
mockServerVersion = '3.11.0'
92-
leakcanaryVersion = '2.8.1'
93-
mockitoVersion = '5.15.2'
92+
leakcanaryVersion = '2.14'
93+
mockitoVersion = '4.11.0'
9494
junitParamsVersion = '1.1.1'
9595
robolectricVersion = '4.14.1'
9696
coreTest = '1.6.1'

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ android.jetifier.ignorelist=bcprov-jdk18on-1.78.1.jar
44
sonatypeUsername=
55
sonatypePassword=
66
android.disableAutomaticComponentCreation=true
7-
7+
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m

receiptui/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ dependencies {
3232
androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoVersion"
3333
androidTestImplementation "com.squareup.okhttp3:mockwebserver:$mockServerVersion"
3434
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakcanaryVersion"
35+
androidTestImplementation "com.squareup.leakcanary:leakcanary-android-instrumentation:$leakcanaryVersion"
3536
androidTestImplementation project(':testutils')
3637
}
3738
tasks.withType(Test) {

receiptui/src/androidTest/java/com/hyperwallet/android/ui/receipt/HyperwalletInstrumentedTestApplication.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33

44
import android.app.Application;
55

6-
import com.squareup.leakcanary.InstrumentationLeakDetector;
7-
import com.squareup.leakcanary.LeakCanary;
6+
import java.util.Objects;
7+
8+
import leakcanary.AppWatcher;
9+
import leakcanary.LeakCanary;
810

911
public class HyperwalletInstrumentedTestApplication extends Application {
1012

1113
@Override
1214
public void onCreate() {
1315

1416
super.onCreate();
15-
if (LeakCanary.isInAnalyzerProcess(this)) {
17+
if (Objects.isNull(LeakCanary.getConfig())) {
1618
// This process is dedicated to LeakCanary for heap analysis.
1719
// You should not init your app in this process.
1820
return;
@@ -22,10 +24,7 @@ public void onCreate() {
2224

2325

2426
protected void installLeakCanary() {
25-
26-
InstrumentationLeakDetector.instrumentationRefWatcher(this)
27-
.buildAndInstall();
28-
27+
AppWatcher.INSTANCE.manualInstall(this);
2928
}
3029

3130
}

transfermethodui/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ dependencies {
3333
androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoVersion"
3434
androidTestImplementation "com.squareup.okhttp3:mockwebserver:$mockServerVersion"
3535
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakcanaryVersion"
36+
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakcanaryVersion"
37+
androidTestImplementation "com.squareup.leakcanary:leakcanary-android-instrumentation:$leakcanaryVersion"
3638
androidTestImplementation "org.mockito:mockito-android:$mockitoVersion"
3739
androidTestImplementation project(":testutils")
3840

transfermethodui/src/androidTest/java/com/hyperwallet/android/ui/transfermethod/HyperwalletInstrumentedTestApplication.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33

44
import android.app.Application;
55

6-
import com.squareup.leakcanary.InstrumentationLeakDetector;
7-
import com.squareup.leakcanary.LeakCanary;
6+
import java.util.Objects;
7+
8+
import leakcanary.AppWatcher;
9+
import leakcanary.LeakCanary;
810

911
public class HyperwalletInstrumentedTestApplication extends Application {
1012

1113
@Override
1214
public void onCreate() {
1315

1416
super.onCreate();
15-
if (LeakCanary.isInAnalyzerProcess(this)) {
17+
if (Objects.isNull(LeakCanary.getConfig())) {
1618
// This process is dedicated to LeakCanary for heap analysis.
1719
// You should not init your app in this process.
1820
return;
@@ -22,10 +24,7 @@ public void onCreate() {
2224

2325

2426
protected void installLeakCanary() {
25-
26-
InstrumentationLeakDetector.instrumentationRefWatcher(this)
27-
.buildAndInstall();
28-
27+
AppWatcher.INSTANCE.manualInstall(this);
2928
}
3029

3130
}

transferui/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ dependencies {
2525
androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoVersion"
2626
androidTestImplementation "com.squareup.okhttp3:mockwebserver:$mockServerVersion"
2727
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakcanaryVersion"
28+
androidTestImplementation "com.squareup.leakcanary:leakcanary-android-instrumentation:$leakcanaryVersion"
2829
androidTestImplementation project(":testutils")
2930
androidTestImplementation project(":transfermethodui")
3031

transferui/src/androidTest/java/com/hyperwallet/android/ui/transfer/HyperwalletInstrumentedTestApplication.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33

44
import android.app.Application;
55

6-
import com.squareup.leakcanary.InstrumentationLeakDetector;
7-
import com.squareup.leakcanary.LeakCanary;
6+
import java.util.Objects;
7+
8+
import leakcanary.AppWatcher;
9+
import leakcanary.LeakCanary;
810

911
public class HyperwalletInstrumentedTestApplication extends Application {
1012

1113
@Override
1214
public void onCreate() {
1315

1416
super.onCreate();
15-
if (LeakCanary.isInAnalyzerProcess(this)) {
17+
if (Objects.isNull(LeakCanary.getConfig())) {
1618
// This process is dedicated to LeakCanary for heap analysis.
1719
// You should not init your app in this process.
1820
return;
@@ -22,10 +24,6 @@ public void onCreate() {
2224

2325

2426
protected void installLeakCanary() {
25-
26-
InstrumentationLeakDetector.instrumentationRefWatcher(this)
27-
.buildAndInstall();
28-
27+
AppWatcher.INSTANCE.manualInstall(this);
2928
}
30-
3129
}

0 commit comments

Comments
 (0)