Migrate last batch of mockito tests #13835
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contributor checklist
Fixes #1234
syntaxDescription
In #13829, I migrated the remaining Java tests that were using Mockito, to Kotlin and to MockK.
In #13832, I migrated a batch of Kotlin tests that were using Mockito Kotlin to use MockK instead.
In this current PR, I'm migrating the other ~10 Kotlin tests that were using Mockito, to MockK. After this current PR, there are no more tests in the codebase that use Mockito.
Tests Migrated In this PR
The tests migrated in this batch were:
app/src/test/java/org/thoughtcrime/securesms/backup/v2/ArchivedMediaObjectIteratorTest.kt
2
app/src/test/java/org/thoughtcrime/securesms/components/voice/VoiceNotePlayerCallbackTest.kt
app/src/test/java/org/thoughtcrime/securesms/contacts/paged/ContactSearchPagedDataSourceTest.kt
app/src/test/java/org/thoughtcrime/securesms/contacts/paged/SafetyNumberRepositoryTest.kt
app/src/test/java/org/thoughtcrime/securesms/conversation/ConversationUpdateTickTest.kt
app/src/test/java/org/thoughtcrime/securesms/crypto/storage/SignalBaseIdentityKeyStoreTest.kt
app/src/test/java/org/thoughtcrime/securesms/database/model/MessageRecordTest_createNewContextWithAppendedDeleteJoinRequest.kt
app/src/test/java/org/thoughtcrime/securesms/dependencies/MockApplicationDependencyProvider.kt
app/src/test/java/org/thoughtcrime/securesms/mediasend/MediaRepositoryTest.kt
app/src/test/java/org/thoughtcrime/securesms/recipients/Recipient_getChatColorsTest.kt
app/src/test/java/org/thoughtcrime/securesms/recipients/BaseRecipientTest.kt
was merged intoapp/src/test/java/org/thoughtcrime/securesms/recipients/Recipient_getChatColorsTest.kt
.Next Steps
Once these three PRs are merged (#13832, #13829, this one), I will create one final PR, called like "remove Mockito", which will just be a cleanup on these project files, which still contain miscellaneous references to Mockito:
gradle/test-libs.versions.toml
build-logic/plugins/src/main/java/signal-library.gradle.kts
gradle/verification-metadata.xml
build-logic/plugins/src/main/java/signal-sample-app.gradle.kts
build-logic/plugins/src/main/java/Licenses.kt
libsignal-service/build.gradle.kts
app/proguard/proguard-automation.pro
app/build.gradle.kts
app/src/main/res/raw/third_party_licenses
core-util/build.gradle.kts
Testing
Gots to have it 😎