File tree 4 files changed +8
-8
lines changed
main/java/fr/free/nrw/commons/upload
test/kotlin/fr/free/nrw/commons/upload
4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ class ImageProcessingService @Inject constructor(
45
45
}
46
46
47
47
Timber .d(" Checking the validity of image" )
48
- val filePath = uploadItem.mediaUri.path
48
+ val filePath = uploadItem.mediaUri? .path
49
49
50
50
return Single .zip(
51
51
checkDuplicateImage(filePath),
Original file line number Diff line number Diff line change @@ -8,11 +8,11 @@ import fr.free.nrw.commons.utils.ImageUtils
8
8
import io.reactivex.subjects.BehaviorSubject
9
9
10
10
class UploadItem (
11
- var mediaUri : Uri ,
11
+ var mediaUri : Uri ? ,
12
12
val mimeType : String? ,
13
13
var gpsCoords : ImageCoordinates ? ,
14
- var place : Place ,
15
- val createdTimestamp : Long ,
14
+ var place : Place ? ,
15
+ val createdTimestamp : Long? ,
16
16
val createdTimestampSource : String? ,
17
17
/* *
18
18
* Uri of uploadItem
@@ -23,7 +23,7 @@ class UploadItem(
23
23
val fileCreatedDateString : String?
24
24
) {
25
25
var imageQuality: Int = ImageUtils .IMAGE_WAIT
26
- var uploadMediaDetails: List <UploadMediaDetail > = listOf (UploadMediaDetail ())
26
+ var uploadMediaDetails: MutableList <UploadMediaDetail > = mutableListOf (UploadMediaDetail ())
27
27
var hasInvalidLocation = false
28
28
var isWLMUpload = false
29
29
var countryCode: String? = null
Original file line number Diff line number Diff line change @@ -84,10 +84,10 @@ class CategoriesPresenterTest {
84
84
)
85
85
val nonEmptyCaptionUploadItem = mock<UploadItem >()
86
86
whenever(nonEmptyCaptionUploadItem.uploadMediaDetails)
87
- .thenReturn(listOf (UploadMediaDetail (captionText = " nonEmpty" )))
87
+ .thenReturn(mutableListOf (UploadMediaDetail (captionText = " nonEmpty" )))
88
88
val emptyCaptionUploadItem = mock<UploadItem >()
89
89
whenever(emptyCaptionUploadItem.uploadMediaDetails)
90
- .thenReturn(listOf (UploadMediaDetail (captionText = " " )))
90
+ .thenReturn(mutableListOf (UploadMediaDetail (captionText = " " )))
91
91
whenever(repository.getUploads()).thenReturn(
92
92
listOf (
93
93
nonEmptyCaptionUploadItem,
Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ class UploadMediaPresenterTest {
228
228
whenever(repository.getUploads()).thenReturn(listOf (uploadItem))
229
229
whenever(repository.getUploadItem(ArgumentMatchers .anyInt()))
230
230
.thenReturn(uploadItem)
231
- whenever(uploadItem.uploadMediaDetails).thenReturn(listOf ())
231
+ whenever(uploadItem.uploadMediaDetails).thenReturn(mutableListOf ())
232
232
233
233
uploadMediaPresenter.fetchTitleAndDescription(0 )
234
234
verify(view).updateMediaDetails(ArgumentMatchers .any())
You can’t perform that action at this time.
0 commit comments