Skip to content

Broken compatibility with Mockito 2.0.47-beta+ in Spring Boot 1.4.0.M3 #6320

@szpak

Description

@szpak

Built-in support for Mockito beans inside a Spring context is nice, but the current snapshot (2016-07-05) fails with the following error when used with Mockito 2.0.47-beta+:

Caused by: java.lang.NoSuchMethodError: org.mockito.Answers.get()Lorg/mockito/stubbing/Answer;
    at org.springframework.boot.test.mock.mockito.MockDefinition.createMock(MockDefinition.java:154)
    at org.springframework.boot.test.mock.mockito.MockitoPostProcessor.createMock(MockitoPostProcessor.java:206)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
    ... 46 more

There reason is removing (in 2.0.47-beta) a deprecated get() method which were stopped to be needed when Answers started to implement Answer interface directly (in 2.0.2-beta).

Mockito 2.x is still a moving target, but it would be bad to force people to hack MockDefinition locally due to one method. I will prepare a PR to handle both Mockito versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions