Skip to content

Commit 22772c8

Browse files
pshmisaochan
authored andcommitted
Moved tests over to Kotlin. (commons-app#1428)
1 parent 6b2dd8c commit 22772c8

29 files changed

+1453
-1679
lines changed

app/build.gradle

+8-17
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ dependencies {
1818
implementation 'com.google.code.gson:gson:2.8.1'
1919
implementation 'com.jakewharton.timber:timber:4.5.1'
2020
implementation 'info.debatty:java-string-similarity:0.24'
21+
implementation 'com.borjabravo:readmoretextview:2.1.0'
22+
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
2123
implementation ('com.mapbox.mapboxsdk:mapbox-android-sdk:5.4.1@aar'){
2224
transitive=true
2325
}
2426

25-
2627
implementation "com.android.support:support-v4:$SUPPORT_LIB_VERSION"
2728
implementation "com.android.support:appcompat-v7:$SUPPORT_LIB_VERSION"
2829
implementation "com.android.support:design:$SUPPORT_LIB_VERSION"
@@ -41,8 +42,6 @@ dependencies {
4142
// explicitly depend on RxJava's latest version for bug fixes and new features.
4243
implementation 'com.android.support:multidex:1.0.3'
4344

44-
testImplementation "org.robolectric:multidex:3.4.2"
45-
4645
implementation 'io.reactivex.rxjava2:rxjava:2.1.2'
4746
implementation 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
4847
implementation 'com.jakewharton.rxbinding2:rxbinding-support-v4:2.0.0'
@@ -54,33 +53,25 @@ dependencies {
5453

5554
implementation "com.google.dagger:dagger:$DAGGER_VERSION"
5655
implementation "com.google.dagger:dagger-android-support:$DAGGER_VERSION"
57-
5856
kapt "com.google.dagger:dagger-android-processor:$DAGGER_VERSION"
5957
kapt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
6058

59+
testImplementation "org.robolectric:multidex:3.4.2"
6160
testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
62-
androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
63-
61+
testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
6462
testImplementation 'junit:junit:4.12'
6563
testImplementation 'org.robolectric:robolectric:3.7.1'
66-
testImplementation 'org.mockito:mockito-all:1.10.19'
67-
64+
testImplementation 'com.nhaarman:mockito-kotlin:1.5.0'
6865
testImplementation 'com.squareup.okhttp3:mockwebserver:3.8.1'
66+
67+
androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
6968
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:3.8.1'
7069
androidTestImplementation "com.android.support:support-annotations:$SUPPORT_LIB_VERSION"
71-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
70+
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2-alpha1'
7271

7372
debugImplementation "com.squareup.leakcanary:leakcanary-android:$LEAK_CANARY"
7473
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$LEAK_CANARY"
7574
testImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$LEAK_CANARY"
76-
77-
implementation "com.google.dagger:dagger:$DAGGER_VERSION"
78-
implementation "com.google.dagger:dagger-android-support:$DAGGER_VERSION"
79-
kapt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
80-
kapt "com.google.dagger:dagger-android-processor:$DAGGER_VERSION"
81-
82-
implementation 'com.borjabravo:readmoretextview:2.1.0'
83-
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
8475
}
8576

8677
android {

app/src/main/java/fr/free/nrw/commons/category/CategoryDao.java

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ List<String> recentCategories(int limit) {
105105
return items;
106106
}
107107

108+
@NonNull
108109
Category fromCursor(Cursor cursor) {
109110
// Hardcoding column positions!
110111
return new Category(

app/src/test/java/fr/free/nrw/commons/FileUtilsTest.java

-40
This file was deleted.

app/src/test/java/fr/free/nrw/commons/LatLngTests.java

-64
This file was deleted.

app/src/test/java/fr/free/nrw/commons/LengthUtilsTest.java

-46
This file was deleted.

app/src/test/java/fr/free/nrw/commons/MediaTest.java

-25
This file was deleted.

app/src/test/java/fr/free/nrw/commons/NearbyControllerTest.java

-44
This file was deleted.

app/src/test/java/fr/free/nrw/commons/PageTitleTest.java

-70
This file was deleted.

0 commit comments

Comments
 (0)