Skip to content

Behaviour Change of whenever in combination with "typeless" any() since 6.2.0 #584

Description

@goafabric

Before version 6.2.0 this mock statement worked perfectly fine

whenever(personRepository.saveAndFlush(any())).thenReturn(person)

....

Now since 6.2.0 we get
Cannot infer type for type parameter 'T'. Specify it explicitly.

which can be fixed by setting the type excplitly

whenever(personRepository.saveAndFlush(any())).thenReturn(person)

...

Is this change intentionally ? Because at first sight i didn't see in the release notes.
And it breaks a lot of tests on our end.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions