Skip to content

PowerMockito not compatible Mockito2 since their v2.0.55-beta release #706

@mlaffargue

Description

@mlaffargue

What steps will reproduce the problem?

@PrepareForTest(ClassWithStaticMethod.class)
public class Test{
    @BeforeClass
    public static void beforeClass() throws Exception {
        PowerMockito.spy(ClassWithStaticMethod.class);
    }

What is the expected output?
No error

What do you see instead?

java.lang.NoSuchMethodError: org.mockito.internal.handler.MockHandlerFactory.create(Lorg/mockito/mock/MockCreationSettings;)Lorg/mockito/internal/InternalMockHandler;
at org.powermock.api.mockito.internal.mockcreation.MockCreator.createMethodInvocationControl(MockCreator.java:121)

What version of the product are you using?
JUnit 4.11
Mockito 2.2.8
PowerMockito 1.6.5

On what operating system? Windows

Please provide any additional information below.
Since this modification which has been tagged on Mockito release 2.0.55-beta :

MockHandlerFactory has been modified from:
public InternalMockHandler create(MockCreationSettings settings) {
to:
public static InternalMockHandler createMockHandler(MockCreationSettings settings) {

DefaultMockCreator class still rely on the old version

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions