diff --git a/app/src/test/kotlin/fr/free/nrw/commons/WelcomeActivityUnitTest.kt b/app/src/test/kotlin/fr/free/nrw/commons/WelcomeActivityUnitTest.kt index 4ad91e0a4..c4cd8920c 100644 --- a/app/src/test/kotlin/fr/free/nrw/commons/WelcomeActivityUnitTest.kt +++ b/app/src/test/kotlin/fr/free/nrw/commons/WelcomeActivityUnitTest.kt @@ -3,8 +3,8 @@ package fr.free.nrw.commons import android.content.Intent import android.widget.TextView import fr.free.nrw.commons.quiz.QuizActivity -import junit.framework.Assert.assertEquals -import junit.framework.Assert.assertNotNull +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNotNull import org.junit.Before import org.junit.Test import org.junit.runner.RunWith diff --git a/app/src/test/kotlin/fr/free/nrw/commons/bookmarks/locations/BookMarkLocationDaoTest.kt b/app/src/test/kotlin/fr/free/nrw/commons/bookmarks/locations/BookMarkLocationDaoTest.kt index a2275866a..eb9ec6c92 100644 --- a/app/src/test/kotlin/fr/free/nrw/commons/bookmarks/locations/BookMarkLocationDaoTest.kt +++ b/app/src/test/kotlin/fr/free/nrw/commons/bookmarks/locations/BookMarkLocationDaoTest.kt @@ -15,7 +15,7 @@ import fr.free.nrw.commons.location.LatLng import fr.free.nrw.commons.nearby.Label import fr.free.nrw.commons.nearby.Place import fr.free.nrw.commons.nearby.Sitelinks -import junit.framework.Assert.* +import org.junit.Assert.* import org.junit.Before import org.junit.Test import org.junit.runner.RunWith @@ -91,8 +91,8 @@ class BookMarkLocationDaoTest { assertEquals("placeName", it.name) assertEquals(Label.FOREST, it.label) assertEquals("placeDescription", it.longDescription) - assertEquals(40.0, it.location.latitude) - assertEquals(51.4, it.location.longitude) + assertEquals(40.0, it.location.latitude, 0.001) + assertEquals(51.4, it.location.longitude, 0.001) assertEquals("placeCategory", it.category) assertEquals(builder.build().wikipediaLink, it.siteLinks.wikipediaLink) assertEquals(builder.build().wikidataLink, it.siteLinks.wikidataLink) @@ -157,8 +157,8 @@ class BookMarkLocationDaoTest { assertEquals(examplePlaceBookmark.longDescription, cv.getAsString(COLUMN_DESCRIPTION)) assertEquals(examplePlaceBookmark.label.text, cv.getAsString(COLUMN_LABEL_TEXT)) assertEquals(examplePlaceBookmark.category, cv.getAsString(COLUMN_CATEGORY)) - assertEquals(examplePlaceBookmark.location.latitude, cv.getAsDouble(COLUMN_LAT)) - assertEquals(examplePlaceBookmark.location.longitude, cv.getAsDouble(COLUMN_LONG)) + assertEquals(examplePlaceBookmark.location.latitude, cv.getAsDouble(COLUMN_LAT), 0.001) + assertEquals(examplePlaceBookmark.location.longitude, cv.getAsDouble(COLUMN_LONG), 0.001) assertEquals(examplePlaceBookmark.siteLinks.wikipediaLink.toString(), cv.getAsString(COLUMN_WIKIPEDIA_LINK)) assertEquals(examplePlaceBookmark.siteLinks.wikidataLink.toString(), cv.getAsString(COLUMN_WIKIDATA_LINK)) assertEquals(examplePlaceBookmark.siteLinks.commonsLink.toString(), cv.getAsString(COLUMN_COMMONS_LINK)) diff --git a/app/src/test/kotlin/fr/free/nrw/commons/customselector/ui/selector/ImageLoaderTest.kt b/app/src/test/kotlin/fr/free/nrw/commons/customselector/ui/selector/ImageLoaderTest.kt index fe26921e5..0c3a7de3a 100644 --- a/app/src/test/kotlin/fr/free/nrw/commons/customselector/ui/selector/ImageLoaderTest.kt +++ b/app/src/test/kotlin/fr/free/nrw/commons/customselector/ui/selector/ImageLoaderTest.kt @@ -15,7 +15,7 @@ import fr.free.nrw.commons.media.MediaClient import fr.free.nrw.commons.upload.FileProcessor import fr.free.nrw.commons.upload.FileUtilsWrapper import io.reactivex.Single -import junit.framework.Assert +import org.junit.Assert import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.* diff --git a/app/src/test/kotlin/fr/free/nrw/commons/explore/PagingDataSourceFactoryTest.kt b/app/src/test/kotlin/fr/free/nrw/commons/explore/PagingDataSourceFactoryTest.kt index e5f74c84a..6d5ada847 100644 --- a/app/src/test/kotlin/fr/free/nrw/commons/explore/PagingDataSourceFactoryTest.kt +++ b/app/src/test/kotlin/fr/free/nrw/commons/explore/PagingDataSourceFactoryTest.kt @@ -9,6 +9,7 @@ import fr.free.nrw.commons.explore.paging.PagingDataSource import fr.free.nrw.commons.explore.paging.PagingDataSourceFactory import io.reactivex.processors.PublishProcessor import org.hamcrest.CoreMatchers.instanceOf +import org.hamcrest.MatcherAssert import org.junit.Assert import org.junit.Before import org.junit.Ignore @@ -38,7 +39,7 @@ class PagingDataSourceFactoryTest { @Test fun `create returns a dataSource`() { - Assert.assertThat( + MatcherAssert.assertThat( factory.create(), instanceOf(PagingDataSource::class.java) ) diff --git a/app/src/test/kotlin/fr/free/nrw/commons/explore/media/MediaConverterTest.kt b/app/src/test/kotlin/fr/free/nrw/commons/explore/media/MediaConverterTest.kt index fa3117e5e..a323f8798 100644 --- a/app/src/test/kotlin/fr/free/nrw/commons/explore/media/MediaConverterTest.kt +++ b/app/src/test/kotlin/fr/free/nrw/commons/explore/media/MediaConverterTest.kt @@ -4,7 +4,7 @@ import com.nhaarman.mockitokotlin2.any import com.nhaarman.mockitokotlin2.eq import com.nhaarman.mockitokotlin2.notNull import fr.free.nrw.commons.Media -import junit.framework.Assert.assertEquals +import org.junit.Assert.assertEquals import org.junit.Before import org.junit.Test import org.mockito.ArgumentMatchers diff --git a/app/src/test/kotlin/fr/free/nrw/commons/filepicker/FilePickerTest.kt b/app/src/test/kotlin/fr/free/nrw/commons/filepicker/FilePickerTest.kt index 9b84f2582..a6a8f4969 100644 --- a/app/src/test/kotlin/fr/free/nrw/commons/filepicker/FilePickerTest.kt +++ b/app/src/test/kotlin/fr/free/nrw/commons/filepicker/FilePickerTest.kt @@ -10,7 +10,7 @@ import androidx.preference.PreferenceManager import com.nhaarman.mockitokotlin2.verify import fr.free.nrw.commons.TestCommonsApplication import fr.free.nrw.commons.filepicker.Constants.RequestCodes -import junit.framework.Assert.assertEquals +import org.junit.Assert.assertEquals import org.junit.Before import org.junit.Test import org.junit.runner.RunWith diff --git a/app/src/test/kotlin/fr/free/nrw/commons/review/ReviewHelperTest.kt b/app/src/test/kotlin/fr/free/nrw/commons/review/ReviewHelperTest.kt index 00da10d99..514f4fb47 100644 --- a/app/src/test/kotlin/fr/free/nrw/commons/review/ReviewHelperTest.kt +++ b/app/src/test/kotlin/fr/free/nrw/commons/review/ReviewHelperTest.kt @@ -5,7 +5,7 @@ import fr.free.nrw.commons.Media import fr.free.nrw.commons.media.MediaClient import io.reactivex.Observable import io.reactivex.Single -import junit.framework.Assert.assertNull +import org.junit.Assert.assertNull import org.junit.Assert.assertTrue import org.junit.Before import org.junit.Test diff --git a/app/src/test/kotlin/fr/free/nrw/commons/upload/FileMetadataUtilsTest.kt b/app/src/test/kotlin/fr/free/nrw/commons/upload/FileMetadataUtilsTest.kt index 385a4afa0..1aa0df167 100644 --- a/app/src/test/kotlin/fr/free/nrw/commons/upload/FileMetadataUtilsTest.kt +++ b/app/src/test/kotlin/fr/free/nrw/commons/upload/FileMetadataUtilsTest.kt @@ -1,7 +1,7 @@ package fr.free.nrw.commons.upload import androidx.exifinterface.media.ExifInterface.* -import junit.framework.Assert.assertTrue +import org.junit.Assert.assertTrue import org.junit.Test import java.util.*