Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert some Java tests to Kotlin #13792

Conversation

jamesonwilliams
Copy link
Contributor

Contributor checklist

  • This runs on the local host, not the device
  • My contribution is fully baked and ready to be merged as is
  • I ensure that all the open issues my contribution fixes are mentioned in the commit message of my first commit using the Fixes #1234 syntax

Description

There's still quite a bit of Java left in the codebase. It probably makes sense to convert the low-risk stuff to Kotlin, first (e.g., sample apps, unit test files, etc.)

Here I just grabbed a random batch of test files that were still in Java and converted them to Kotlin. I started with Android Studio's "Convert Java to Kotlin..." utility and then applied some manual cleanups.

  1. core-util-jvm/src/test/java/org/signal/core/util/logging/LogTest.kt
  2. core-util/src/test/java/org/signal/core/util/BreakIteratorCompatTest.kt
  3. core-util/src/test/java/org/signal/core/util/ListUtilTest.kt
  4. core-util/src/test/java/org/signal/core/util/money/FiatMoneyTest.kt
  5. device-transfer/lib/src/test/java/org/signal/devicetransfer/DeviceTransferAuthenticationTest.kt
  6. device-transfer/lib/src/test/java/org/signal/devicetransfer/WifiDirectTest.kt
  7. donations/app/src/main/java/org/signal/donations/app/MainActivity.kt
  8. libsignal-service/src/test/java/org/whispersystems/util/FlagUtilTest.kt
  9. paging/lib/src/test/java/org/signal/paging/DataStatusTest.kt

Test files are also good candidates to finish migrating because it's easy to verify that they still work or not:

./gradlew :core-util-jvm:test :device-transfer:test :donations:test :libsignal-service:test :paging:test

@greyson-signal
Copy link
Contributor

Thank you! Always better to have more things moved over to kotlin, and I agree that tests are a great place to start.

greyson-signal pushed a commit that referenced this pull request Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants