尝试使用PowerMockito.whenNew()时,出现以下错误:
mockedA = Mockito.mock(A.class); PowerMockito.whenNew(A.class).withNoArguments()。thenReturn(mockedA);
java.lang.NoSuchMethodError:org.powermock.reflect.internal.WhiteboxImpl.getOriginalUnmockedType(Ljava / lang / Class;)Ljava / lang / Class; 在org.powermock.api.mockito.internal.expectation.AbstractConstructorExpectationSetup.createNewSubstituteMock(AbstractConstructorExpectationSetup.java:35)处 在org.powermock.api.mockito.internal.expectation.AbstractConstructorExpectationSetup.withNoArguments(AbstractConstructorExpectationSetup.java:98)
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-core</artifactId>
<version>1.6.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.6.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-testng</artifactId>
<version>1.6.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4-rule-agent</artifactId>
<version>1.6.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.7.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
有人可以在这里帮助我吗?