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
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:
app/src/test/java/org/thoughtcrime/securesms/groups/v2/GroupInviteLinkUrl_InvalidGroupLinkException_Test.kt
app/src/test/java/org/thoughtcrime/securesms/payments/MobileCoinPublicAddressProfileUtilTest.kt
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