Skip to content

Conversation

@jamesonwilliams
Copy link
Contributor

@jamesonwilliams jamesonwilliams commented Dec 13, 2024

Contributor checklist

  • MacBook Pro
  • 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

It's handy to have a fluent assertions library in a test suite. There are many examples of such libraries (Hamcrest, AssertJ, AssertK, Strikt, etc.)

Currently, the codebase contains both AssertJ and Hamcrest, which are older libraries that were designed for Java. Each one has little API papercuts when using them from Kotlin, e.g., `is` or `as` needing the backticks.

Newer solutions like AssertK and Strikt have been designed from scratch with Kotlin in mind. AssertK is a little more popular and feature rich, and seems like a great drop-in replacement for AssertJ.

To get started, since there a small number of uses of AssertJ at this time, we can swap it out for AssertK. To do so, I had to convert these three tests to Kotlin:

  1. app/src/test/java/org/thoughtcrime/securesms/groups/v2/GroupInviteLinkUrl_InvalidGroupLinkException_Test.kt
  2. app/src/test/java/org/thoughtcrime/securesms/payments/MobileCoinPublicAddressProfileUtilTest.kt
  3. app/src/test/java/org/thoughtcrime/securesms/util/livedata/LiveDataUtilTest_skip.kt

But, once we have AssertK in the codebase, we can also start replacing Hamcrest and eventually remove it, too.

Testing

./gradlew qa
[..snip...]
BUILD SUCCESSFUL in 8m 39s

@greyson-signal
Copy link
Contributor

Seems reasonable to me, thanks!

@greyson-signal
Copy link
Contributor

Yeah, the junit-boms are a total mystery. If you can figure out where the usages are coming from let us know, because our normal tools are failing us :p

@jamesonwilliams jamesonwilliams deleted the assertj-to-assertk branch January 7, 2025 21:36
@jamesonwilliams jamesonwilliams restored the assertj-to-assertk branch January 7, 2025 21:36
@jamesonwilliams jamesonwilliams deleted the assertj-to-assertk branch January 7, 2025 21:36
AbandonedCart pushed a commit to SamSprung/Signal-Android that referenced this pull request Jan 31, 2025
Fix derivation of RRP in RefreshAttributesJob.

Fix incorrect RRP bugs and reglock state with reregistering.

Update translations and other static files.

Bump version to 7.28.1

Fix large message size calculation to use bytes.

Update translations and other static files.

Bump version to 7.28.2

Fix bug with ellipsizing on media messages.

Bump version to 7.28.3

Translate missing recipients into unknown recipients.

Bump version to 7.28.4

Treat all groups updates as directionless for backupv2.

Remove Mockito dependency from project.

Resolves signalapp#13838

Fix gv1 updates in backupv2.

Fix empty profile names during backupv2 export.

Move from AssertJ to AssertK.

Resolves signalapp#13841

Fix dangling call ringers.

Isolated tests for RecurringInAppPaymentRepository.

Add verification metadata for windows.

Don't show linked device bottom sheets if you've seen them before.

Add internal UI for importing backup with different credentials.

Improve internal backup import UI tool.

Implement initial support for IAP data.

Upgrade to AGP 8.7.2

Upgrade to AGP 8.7.3

Isolated tests for OneTimeInAppPaymentRepository.

Move some things to lib.versions.toml

Add AAPT metadata for witness verification.

Use more plugin aliases.

Upgrade to kotlin 2.1.0

Update a bunch of libraries.

Update compileSdk to 35.

Add .kotlin to gitignore.

Update more libraries.

Ensure that the V262 database migration runs.

Update our base themes to avoid crashing MaterialAlertDialog.

Revert "Improve table display in Spinner."

This reverts commit df96b05.

Fix cutoff string in help section.

Fix typo in sql query.

Add trigger definitions to logs.

Capitalize log section title.

Fix small gap in call menu.

Update string translation comments.

Fix leaked refreshActiveSubscription disposable.

Fix ability to share text stories.

Fixes signalapp#13855
Resolves signalapp#13879

Initialize database error handler with application instance.

Fix text overflow length calculation.

Fix overflow handling in condensed mode.

Ensure filter is not retriggered when formatting.

Fixes signalapp#13876

Fix proximity sensor for voice notes.

Ensure new manifest is saved after rotation.

Inline and enable the SSRE2 config.

Exclude unregistered group members from invalid collisions check.

Fixes signalapp#13866

Stop in-chat notification sounds if notifications are disabled.

Fix bug showing null string on empty search.

Fixes signalapp#13854
Resolves signalapp#13878

Revert "Update our base themes to avoid crashing MaterialAlertDialog."

This reverts commit 446c7d6.

Add missing required material3 dialog theme attribute.

Disable the SSRE2 capability for now.

Fix benchmark build.

Add loading state to toggle switch and enforce when changing call link admin settings.

Update translations and other static files.

Update baseline profile.

Co-Authored-By: Greyson Parrelli <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants