Add explicit assertions on withArg in the unit tests#1227
Merged
Conversation
luhmirin-s
approved these changes
Jun 16, 2025
| persistentLogger.log(any(), any(), any(), any()) | ||
| } | ||
| verify { resultMapper.invoke(withArg { it is ActionResponse.EnrolActionResponse }) } | ||
| verify { resultMapper.invoke(withArg { assert(it is ActionResponse.EnrolActionResponse) }) } |
Contributor
There was a problem hiding this comment.
I think we should be using Truth.assertThat() everywhere to be consistent. Or you could also replace most of the instances of withArg with match.
1ae0cad to
5c1f7d5
Compare
meladRaouf
approved these changes
Jun 16, 2025
5c1f7d5 to
05607f7
Compare
|
luhmirin-s
approved these changes
Jul 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



JIRA ticket
Will be released in: 2025.2.0
Root cause analysis (for bugfixes only)
Without an assert, a
withArgdoes nothing*! Therefore we had lots of tests that checked nothing and yes, some of them were wrong.*The only exception to that is if you specify the type in generic braces <>
Notable changes
withArgs that didn't have effect with match{}EventDownSyncTaskTestthat were no longer correctTesting guidance
Additional work checklist