Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Mockito 5 any() does not match a vararg int[] argument anymore. I need to use any(int[].class) to get the ArgumentMatcher to work #2998

@hensan64

Description

@hensan64

Mockito 5.2.0/5.3.1 any() ArgumentMatcher does not match a vararg int[] argument anymore.
I need to use any(int[].class) to get the ArgumentMatcher to work.

This mocking does NOT WORK:
when(myMock.myMethod(eq(myOtherMock), any()).thenReturn(myResultMap);

This mocking DOES WORK:
when(myMock.myMethod(eq(myOtherMock), any(int[].class))).thenReturn(myResultMap);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions