Fix unit tests (#5947)

* move createLocale() method to companion object and add test dependency

* use mockk() from Mockk library for mocking sealed classes

* change method parameter to null-able String type

* add null check for accessing property from unit tests

* change method signature to match old method's signature

It fixes the NullPointerException when running ImageProcessingUnitTest

* Fix unresolved references and make properties public for unit tests

* fix tests in UploadRepositoryUnitTest by making return type null-able
This commit is contained in:
Rohit Verma 2024-11-23 05:05:34 +05:30 committed by GitHub
parent fe347c21fd
commit e070c5dbe8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 56 additions and 52 deletions

View file

@ -98,6 +98,7 @@ dependencies {
testImplementation 'org.mockito:mockito-core:5.6.0'
testImplementation "org.powermock:powermock-module-junit4:2.0.9"
testImplementation "org.powermock:powermock-api-mockito2:2.0.9"
testImplementation("io.mockk:mockk:1.13.5")
// Unit testing
testImplementation 'junit:junit:4.13.2'