mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-31 23:03:54 +01:00
Fixed unit tests
This commit is contained in:
parent
04539e0afe
commit
810d86cdd3
7 changed files with 0 additions and 82 deletions
|
|
@ -96,7 +96,6 @@ class UploadClientTest {
|
||||||
assertSame(uploadResult, result.values()[0])
|
assertSame(uploadResult, result.values()[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testUploadFileFromStash_WithError() {
|
fun testUploadFileFromStash_WithError() {
|
||||||
val error = mock<MwServiceError>()
|
val error = mock<MwServiceError>()
|
||||||
|
|
@ -121,7 +120,6 @@ class UploadClientTest {
|
||||||
assertEquals(errorCode, result.errors()[0].message)
|
assertEquals(errorCode, result.errors()[0].message)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testUploadFileFromStash_Failure() {
|
fun testUploadFileFromStash_Failure() {
|
||||||
val exception = Exception("test")
|
val exception = Exception("test")
|
||||||
|
|
@ -177,7 +175,6 @@ class UploadClientTest {
|
||||||
assertEquals(fileContent, fileCaptor.firstValue.body.asString())
|
assertEquals(fileContent, fileCaptor.firstValue.body.asString())
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testUploadChunkToStash_Failure() {
|
fun testUploadChunkToStash_Failure() {
|
||||||
val exception = Exception("expected")
|
val exception = Exception("expected")
|
||||||
|
|
@ -190,7 +187,6 @@ class UploadClientTest {
|
||||||
assertSame(exception, result.errors()[0])
|
assertSame(exception, result.errors()[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun uploadFileToStash_completedContribution() {
|
fun uploadFileToStash_completedContribution() {
|
||||||
whenever(contribution.isCompleted()).thenReturn(true)
|
whenever(contribution.isCompleted()).thenReturn(true)
|
||||||
|
|
@ -204,23 +200,6 @@ class UploadClientTest {
|
||||||
assertEquals(StashUploadState.SUCCESS, stashResult.state)
|
assertEquals(StashUploadState.SUCCESS, stashResult.state)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
fun uploadFileToStash_contributionIsUnpaused() {
|
|
||||||
whenever(contribution.isCompleted()).thenReturn(false)
|
|
||||||
whenever(contribution.fileKey).thenReturn(filekey)
|
|
||||||
whenever(fileUtilsWrapper.getMimeType(anyOrNull<File>())).thenReturn("image/png")
|
|
||||||
whenever(
|
|
||||||
fileUtilsWrapper.getFileChunks(
|
|
||||||
anyOrNull<File>(),
|
|
||||||
eq(expectedChunkSize)
|
|
||||||
)
|
|
||||||
).thenReturn(emptyList())
|
|
||||||
val result = uploadClient.uploadFileToStash(filename, contribution, mock()).test()
|
|
||||||
result.assertNoErrors()
|
|
||||||
verify(contribution, times(1))
|
|
||||||
}
|
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun uploadFileToStash_returnsFailureIfNothingToUpload() {
|
fun uploadFileToStash_returnsFailureIfNothingToUpload() {
|
||||||
val tempFile = File.createTempFile("tempFile", ".tmp")
|
val tempFile = File.createTempFile("tempFile", ".tmp")
|
||||||
|
|
@ -237,7 +216,6 @@ class UploadClientTest {
|
||||||
assertEquals(StashUploadState.FAILED, result.values()[0].state)
|
assertEquals(StashUploadState.FAILED, result.values()[0].state)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun uploadFileToStash_returnsFailureIfAnyChunkFails() {
|
fun uploadFileToStash_returnsFailureIfAnyChunkFails() {
|
||||||
val mockFile = mock<File>()
|
val mockFile = mock<File>()
|
||||||
|
|
@ -271,7 +249,6 @@ class UploadClientTest {
|
||||||
assertEquals(StashUploadState.FAILED, result.values()[0].state)
|
assertEquals(StashUploadState.FAILED, result.values()[0].state)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun uploadFileToStash_successWithOneChunk() {
|
fun uploadFileToStash_successWithOneChunk() {
|
||||||
val mockFile = mock<File>()
|
val mockFile = mock<File>()
|
||||||
|
|
|
||||||
|
|
@ -95,13 +95,11 @@ class UploadRepositoryUnitTest {
|
||||||
`when`(contributionDao.save(contribution)).thenReturn(completable)
|
`when`(contributionDao.save(contribution)).thenReturn(completable)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testBuildContributions() {
|
fun testBuildContributions() {
|
||||||
assertEquals(repository.buildContributions(), uploadModel.buildContributions())
|
assertEquals(repository.buildContributions(), uploadModel.buildContributions())
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testPrepareMedia() {
|
fun testPrepareMedia() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
|
|
@ -110,7 +108,6 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testSaveContribution() {
|
fun testSaveContribution() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
|
|
@ -119,13 +116,11 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetUploads() {
|
fun testGetUploads() {
|
||||||
assertEquals(repository.uploads, uploadModel.uploads)
|
assertEquals(repository.uploads, uploadModel.uploads)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testCleanup() {
|
fun testCleanup() {
|
||||||
repository.cleanup()
|
repository.cleanup()
|
||||||
|
|
@ -134,13 +129,11 @@ class UploadRepositoryUnitTest {
|
||||||
verify(depictModel).cleanUp()
|
verify(depictModel).cleanUp()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetSelectedCategories() {
|
fun testGetSelectedCategories() {
|
||||||
assertEquals(repository.selectedCategories, categoriesModel.getSelectedCategories())
|
assertEquals(repository.selectedCategories, categoriesModel.getSelectedCategories())
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testSearchAll() {
|
fun testSearchAll() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
|
|
@ -149,21 +142,18 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testSetSelectedCategories() {
|
fun testSetSelectedCategories() {
|
||||||
repository.setSelectedCategories(listOf())
|
repository.setSelectedCategories(listOf())
|
||||||
verify(uploadModel).setSelectedCategories(listOf())
|
verify(uploadModel).setSelectedCategories(listOf())
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testOnCategoryClicked() {
|
fun testOnCategoryClicked() {
|
||||||
repository.onCategoryClicked(categoryItem, media)
|
repository.onCategoryClicked(categoryItem, media)
|
||||||
verify(categoriesModel).onCategoryItemClicked(categoryItem, media)
|
verify(categoriesModel).onCategoryItemClicked(categoryItem, media)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testContainsYear() {
|
fun testContainsYear() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
|
|
@ -171,25 +161,21 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetLicenses() {
|
fun testGetLicenses() {
|
||||||
assertEquals(repository.licenses, uploadModel.licenses)
|
assertEquals(repository.licenses, uploadModel.licenses)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetSelectedLicense() {
|
fun testGetSelectedLicense() {
|
||||||
assertEquals(repository.selectedLicense, uploadModel.selectedLicense)
|
assertEquals(repository.selectedLicense, uploadModel.selectedLicense)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetCount() {
|
fun testGetCount() {
|
||||||
assertEquals(repository.count, uploadModel.count)
|
assertEquals(repository.count, uploadModel.count)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testPreProcessImage() {
|
fun testPreProcessImage() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
|
|
@ -198,7 +184,6 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetImageQuality() {
|
fun testGetImageQuality() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
|
|
@ -207,7 +192,6 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetCaptionQuality() {
|
fun testGetCaptionQuality() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
|
|
@ -216,13 +200,11 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testDeletePicture() {
|
fun testDeletePicture() {
|
||||||
assertEquals(repository.deletePicture(""), uploadModel.deletePicture(""))
|
assertEquals(repository.deletePicture(""), uploadModel.deletePicture(""))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetUploadItemCaseNonNull() {
|
fun testGetUploadItemCaseNonNull() {
|
||||||
`when`(uploadModel.items).thenReturn(listOf(uploadItem))
|
`when`(uploadModel.items).thenReturn(listOf(uploadItem))
|
||||||
|
|
@ -232,19 +214,16 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetUploadItemCaseNull() {
|
fun testGetUploadItemCaseNull() {
|
||||||
assertEquals(repository.getUploadItem(-1), null)
|
assertEquals(repository.getUploadItem(-1), null)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testSetSelectedLicense() {
|
fun testSetSelectedLicense() {
|
||||||
assertEquals(repository.setSelectedLicense(""), uploadModel.setSelectedLicense(""))
|
assertEquals(repository.setSelectedLicense(""), uploadModel.setSelectedLicense(""))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testSetSelectedExistingDepictions() {
|
fun testSetSelectedExistingDepictions() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
|
|
@ -253,7 +232,6 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testOnDepictItemClicked() {
|
fun testOnDepictItemClicked() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
|
|
@ -262,19 +240,16 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetSelectedDepictions() {
|
fun testGetSelectedDepictions() {
|
||||||
assertEquals(repository.selectedDepictions, uploadModel.selectedDepictions)
|
assertEquals(repository.selectedDepictions, uploadModel.selectedDepictions)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetSelectedExistingDepictions() {
|
fun testGetSelectedExistingDepictions() {
|
||||||
assertEquals(repository.selectedExistingDepictions, uploadModel.selectedExistingDepictions)
|
assertEquals(repository.selectedExistingDepictions, uploadModel.selectedExistingDepictions)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testSearchAllEntities() {
|
fun testSearchAllEntities() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
|
|
@ -283,7 +258,6 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetPlaceDepictions() {
|
fun testGetPlaceDepictions() {
|
||||||
`when`(uploadModel.uploads).thenReturn(listOf(uploadItem))
|
`when`(uploadModel.uploads).thenReturn(listOf(uploadItem))
|
||||||
|
|
@ -295,7 +269,6 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testCheckNearbyPlacesWithoutExceptionCaseNonNull() {
|
fun testCheckNearbyPlacesWithoutExceptionCaseNonNull() {
|
||||||
`when`(
|
`when`(
|
||||||
|
|
@ -311,7 +284,6 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testCheckNearbyPlacesWithoutExceptionCaseNull() {
|
fun testCheckNearbyPlacesWithoutExceptionCaseNull() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
|
|
@ -320,7 +292,6 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testCheckNearbyPlacesWithException() {
|
fun testCheckNearbyPlacesWithException() {
|
||||||
`when`(
|
`when`(
|
||||||
|
|
@ -336,7 +307,6 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testUseSimilarPictureCoordinates() {
|
fun testUseSimilarPictureCoordinates() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
|
|
@ -345,7 +315,6 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testIsWMLSupportedForThisPlace() {
|
fun testIsWMLSupportedForThisPlace() {
|
||||||
`when`(uploadModel.items).thenReturn(listOf(uploadItem))
|
`when`(uploadModel.items).thenReturn(listOf(uploadItem))
|
||||||
|
|
@ -356,7 +325,6 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetDepictions() {
|
fun testGetDepictions() {
|
||||||
`when`(depictModel.getDepictions("Q12"))
|
`when`(depictModel.getDepictions("Q12"))
|
||||||
|
|
@ -369,7 +337,6 @@ class UploadRepositoryUnitTest {
|
||||||
method.invoke(repository, listOf("Q12"))
|
method.invoke(repository, listOf("Q12"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testJoinIDs() {
|
fun testJoinIDs() {
|
||||||
val method: Method = UploadRepository::class.java.getDeclaredMethod(
|
val method: Method = UploadRepository::class.java.getDeclaredMethod(
|
||||||
|
|
@ -380,7 +347,6 @@ class UploadRepositoryUnitTest {
|
||||||
method.invoke(repository, listOf("Q12", "Q23"))
|
method.invoke(repository, listOf("Q12", "Q23"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun `test joinIDs when depictIDs is null`() {
|
fun `test joinIDs when depictIDs is null`() {
|
||||||
val method: Method = UploadRepository::class.java.getDeclaredMethod(
|
val method: Method = UploadRepository::class.java.getDeclaredMethod(
|
||||||
|
|
@ -391,7 +357,6 @@ class UploadRepositoryUnitTest {
|
||||||
method.invoke(repository, null)
|
method.invoke(repository, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetSelectedExistingCategories() {
|
fun testGetSelectedExistingCategories() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
|
|
@ -400,7 +365,6 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testSetSelectedExistingCategories() {
|
fun testSetSelectedExistingCategories() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
|
|
@ -409,7 +373,6 @@ class UploadRepositoryUnitTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetCategories() {
|
fun testGetCategories() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ import wikiBaseEntityValue
|
||||||
|
|
||||||
class DepictedItemTest {
|
class DepictedItemTest {
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun `name and description get user language label`() {
|
fun `name and description get user language label`() {
|
||||||
val depictedItem =
|
val depictedItem =
|
||||||
|
|
@ -25,7 +24,6 @@ class DepictedItemTest {
|
||||||
Assert.assertEquals(depictedItem.description, "description")
|
Assert.assertEquals(depictedItem.description, "description")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun `name and descriptions get first language label if user language not present`() {
|
fun `name and descriptions get first language label if user language not present`() {
|
||||||
val depictedItem = DepictedItem(entity(mapOf("" to "label"), mapOf("" to "description")))
|
val depictedItem = DepictedItem(entity(mapOf("" to "label"), mapOf("" to "description")))
|
||||||
|
|
@ -33,7 +31,6 @@ class DepictedItemTest {
|
||||||
Assert.assertEquals(depictedItem.description, "description")
|
Assert.assertEquals(depictedItem.description, "description")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun `name and descriptions get empty if nothing present`() {
|
fun `name and descriptions get empty if nothing present`() {
|
||||||
val depictedItem = DepictedItem(entity())
|
val depictedItem = DepictedItem(entity())
|
||||||
|
|
@ -41,19 +38,16 @@ class DepictedItemTest {
|
||||||
Assert.assertEquals(depictedItem.description, "")
|
Assert.assertEquals(depictedItem.description, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun `image is empty with null statements`() {
|
fun `image is empty with null statements`() {
|
||||||
Assert.assertEquals(DepictedItem(entity(statements = null)).imageUrl, null)
|
Assert.assertEquals(DepictedItem(entity(statements = null)).imageUrl, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun `image is empty with no image statement`() {
|
fun `image is empty with no image statement`() {
|
||||||
Assert.assertEquals(DepictedItem(entity()).imageUrl, null)
|
Assert.assertEquals(DepictedItem(entity()).imageUrl, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun `image is empty with dataValue not of ValueString type`() {
|
fun `image is empty with dataValue not of ValueString type`() {
|
||||||
Assert.assertEquals(
|
Assert.assertEquals(
|
||||||
|
|
@ -68,7 +62,6 @@ class DepictedItemTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun `image is not empty with dataValue of ValueString type`() {
|
fun `image is not empty with dataValue of ValueString type`() {
|
||||||
Assert.assertEquals(
|
Assert.assertEquals(
|
||||||
|
|
@ -84,7 +77,6 @@ class DepictedItemTest {
|
||||||
"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/_example_/70px-_example_")
|
"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/_example_/70px-_example_")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun `instancesOf maps EntityIds to ids`() {
|
fun `instancesOf maps EntityIds to ids`() {
|
||||||
Assert.assertEquals(
|
Assert.assertEquals(
|
||||||
|
|
@ -102,13 +94,11 @@ class DepictedItemTest {
|
||||||
listOf("1", "2"))
|
listOf("1", "2"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun `instancesOf is empty with no values`() {
|
fun `instancesOf is empty with no values`() {
|
||||||
Assert.assertEquals(DepictedItem(entity()).instanceOfs, emptyList<String>())
|
Assert.assertEquals(DepictedItem(entity()).instanceOfs, emptyList<String>())
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun `commonsCategory maps ValueString to strings`() {
|
fun `commonsCategory maps ValueString to strings`() {
|
||||||
Assert.assertEquals(
|
Assert.assertEquals(
|
||||||
|
|
@ -125,25 +115,21 @@ class DepictedItemTest {
|
||||||
listOf("1", "2"))
|
listOf("1", "2"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun `commonsCategory is empty with no values`() {
|
fun `commonsCategory is empty with no values`() {
|
||||||
Assert.assertEquals(DepictedItem(entity()).commonsCategories, emptyList<String>())
|
Assert.assertEquals(DepictedItem(entity()).commonsCategories, emptyList<String>())
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun `isSelected is false at creation`() {
|
fun `isSelected is false at creation`() {
|
||||||
Assert.assertEquals(DepictedItem(entity()).isSelected, false)
|
Assert.assertEquals(DepictedItem(entity()).isSelected, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun `id is entityId`() {
|
fun `id is entityId`() {
|
||||||
Assert.assertEquals(DepictedItem(entity(id = "1")).id, "1")
|
Assert.assertEquals(DepictedItem(entity(id = "1")).id, "1")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun `place constructor uses place name and longDescription`() {
|
fun `place constructor uses place name and longDescription`() {
|
||||||
val depictedItem = DepictedItem(entity(), place(name = "1", longDescription = "2"))
|
val depictedItem = DepictedItem(entity(), place(name = "1", longDescription = "2"))
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ class FileUtilsTest {
|
||||||
assertEquals(false, file.exists())
|
assertEquals(false, file.exists())
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testSHA1() {
|
fun testSHA1() {
|
||||||
val fileUtilsWrapper = FileUtilsWrapper(mock())
|
val fileUtilsWrapper = FileUtilsWrapper(mock())
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ class WikiBaseClientUnitTest {
|
||||||
whenever(csrfTokenClient.getTokenBlocking()).thenReturn("test")
|
whenever(csrfTokenClient.getTokenBlocking()).thenReturn("test")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testPostEditEntity() {
|
fun testPostEditEntity() {
|
||||||
val response = mock<MwPostResponse>()
|
val response = mock<MwPostResponse>()
|
||||||
|
|
@ -42,7 +41,6 @@ class WikiBaseClientUnitTest {
|
||||||
assertTrue(result)
|
assertTrue(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testPostEditEntityByFilename() {
|
fun testPostEditEntityByFilename() {
|
||||||
val response = mock<MwPostResponse>()
|
val response = mock<MwPostResponse>()
|
||||||
|
|
@ -55,7 +53,6 @@ class WikiBaseClientUnitTest {
|
||||||
assertTrue(result)
|
assertTrue(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun getFileEntityId() {
|
fun getFileEntityId() {
|
||||||
val upload = UploadResult("result", "key", 0, "Example.jpg")
|
val upload = UploadResult("result", "key", 0, "Example.jpg")
|
||||||
|
|
@ -74,7 +71,6 @@ class WikiBaseClientUnitTest {
|
||||||
assertEquals(123L, result)
|
assertEquals(123L, result)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun addLabelstoWikidata() {
|
fun addLabelstoWikidata() {
|
||||||
val mwPostResponse = mock<MwPostResponse>()
|
val mwPostResponse = mock<MwPostResponse>()
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@ class WikidataClientTest {
|
||||||
.thenReturn(Observable.just(mwQueryResponse))
|
.thenReturn(Observable.just(mwQueryResponse))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun addEditTag() {
|
fun addEditTag() {
|
||||||
val response = mock(WbCreateClaimResponse::class.java)
|
val response = mock(WbCreateClaimResponse::class.java)
|
||||||
|
|
|
||||||
|
|
@ -46,14 +46,12 @@ class WikidataEditServiceTest {
|
||||||
MockitoAnnotations.openMocks(this)
|
MockitoAnnotations.openMocks(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun noClaimsWhenEntityIdIsNull() {
|
fun noClaimsWhenEntityIdIsNull() {
|
||||||
wikidataEditService.createClaim(mock(), "Test.jpg", hashMapOf())
|
wikidataEditService.createClaim(mock(), "Test.jpg", hashMapOf())
|
||||||
verifyNoInteractions(wikidataClient)
|
verifyNoInteractions(wikidataClient)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
fun testUpdateDepictsProperty() {
|
fun testUpdateDepictsProperty() {
|
||||||
whenever(wikibaseClient.postEditEntityByFilename("Test.jpg",
|
whenever(wikibaseClient.postEditEntityByFilename("Test.jpg",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue