Skip to content

Migrate anyCollectionOf/anyIterableOf to their no-arg replacements - #1100

Merged
timtebeek merged 2 commits into
mainfrom
tim/ulaanbaatar-v1
Aug 20, 2026
Merged

Migrate anyCollectionOf/anyIterableOf to their no-arg replacements#1100
timtebeek merged 2 commits into
mainfrom
tim/ulaanbaatar-v1

Conversation

@timtebeek

@timtebeek timtebeek commented Aug 20, 2026

Copy link
Copy Markdown
Member

Mockito1to3Migration already converted anyListOf/anySetOf/anyMapOf, and I've added tests covering both the static-import and Mockito.-qualified forms (and org.mockito.Matchers on Mockito 1.x) to confirm that.

What was genuinely missing were the sibling matchers anyCollectionOf(Class) and anyIterableOf(Class): their method patterns declared no arguments, so they never matched anything, and the Class argument was never dropped. Those are the only remaining ArgumentMatchers methods that Mockito 4 removed which the migration didn't handle.

The method patterns for these two matchers declared no arguments, so they
never matched the actual `(Class)` overloads that Mockito 4 removed.

Fixes #1098
@timtebeek
timtebeek merged commit 6e46052 into main Aug 20, 2026
1 check passed
@timtebeek
timtebeek deleted the tim/ulaanbaatar-v1 branch August 20, 2026 09:19
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

org.openrewrite.java.testing.mockito.Mockito4to5Only Missing conversion type

1 participant