Skip to content

Commit dcd01a4

Browse files
committed
Corrected test clean up order & Robolectric update
1 parent 83890b6 commit dcd01a4

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

OneSignalSDK/unittest/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ dependencies {
4343
implementation 'com.google.android.gms:play-services-location:11.8.0'
4444

4545
testImplementation 'junit:junit:4.12'
46-
testImplementation 'org.robolectric:robolectric:3.7.1'
46+
testImplementation 'org.robolectric:robolectric:3.8'
4747
}

OneSignalSDK/unittest/src/test/java/com/test/onesignal/TestHelpers.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@
1414

1515
import java.util.Set;
1616

17-
import com.onesignal.ShadowOneSignalRestClient;
18-
1917
class TestHelpers {
2018

2119
static Exception lastException;
2220

2321
static void betweenTestsCleanup() {
22+
try {
23+
stopAllOSThreads();
24+
} catch (Exception e) {
25+
e.printStackTrace();
26+
}
27+
2428
StaticResetHelper.restSetStaticFields();
2529

2630
ShadowOneSignalRestClient.resetStatics();
@@ -46,12 +50,6 @@ static void betweenTestsCleanup() {
4650
writableDb.delete(OneSignalPackagePrivateHelper.NotificationTable.TABLE_NAME, null, null);
4751
writableDb.close();
4852
*/
49-
50-
try {
51-
stopAllOSThreads();
52-
} catch (Exception e) {
53-
e.printStackTrace();
54-
}
5553
lastException = null;
5654
}
5755

0 commit comments

Comments
 (0)