New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No methods matching the name(s) get were found in the class hierarchy #731
Comments
Thank you a lot for creating an issue. I'll investigate it. |
thekingn0thing
pushed a commit
that referenced
this issue
Jan 28, 2017
…class hierarchy for interfaces Signed-off-by: Arthur Zagretdinov <arthur.zagretdinov@outlook.com>
thekingn0thing
pushed a commit
that referenced
this issue
Jan 28, 2017
…class hierarchy for interfaces
thekingn0thing
pushed a commit
that referenced
this issue
Jan 28, 2017
…class hierarchy for interfaces
Pr0methean
added a commit
to Pr0methean/Glowstone
that referenced
this issue
Jan 31, 2018
Updates PowerMock because otherwise affected by powermock/powermock#731
I fixed this issue by using the right combination of powermock and mockito. In my case it was mockito 1.10.19 and powermock 1.6.2. It still looks there is a bug in 1.6.6 |
10 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I used the following code.
@RunWith(PowerMockRunner.class)
@PrepareForTest( { MyStaticClass.class })
public class MyTest {
}
CheckedFuture is defined at: https://google.github.io/guava/releases/19.0/api/docs/com/google/common/util/concurrent/CheckedFuture.html.
Optional is defined at: https://google.github.io/guava/releases/19.0/api/docs/com/google/common/base/Optional.html.
But it failed with the following error message.
ATest(a.b.c.MyTest) Time elapsed: 0.104 sec <<< ERROR!
org.powermock.reflect.exceptions.MethodNotFoundException: No methods matching the name(s) get were found in the class hierarchy of class java.lang.Object.
at org.powermock.reflect.internal.WhiteboxImpl.getMethods(WhiteboxImpl.java:1720)
at org.powermock.reflect.internal.WhiteboxImpl.getMethods(WhiteboxImpl.java:1745)
at org.powermock.reflect.internal.WhiteboxImpl.getBestMethodCandidate(WhiteboxImpl.java:983)
at org.powermock.core.MockGateway$MockInvocation.findMethodToInvoke(MockGateway.java:317)
at org.powermock.core.MockGateway$MockInvocation.init(MockGateway.java:356)
at org.powermock.core.MockGateway$MockInvocation.(MockGateway.java:307)
at org.powermock.core.MockGateway.doMethodCall(MockGateway.java:142)
at org.powermock.core.MockGateway.methodCall(MockGateway.java:125)
at a.b.c.MyTest.ATest(MyTest.java:186)
I used powermock-api-mockito and powermock-module-junit4 1.6.6 (in pom.xml).
It works well if I used
@RunWith(MockitoJUnitRunner.class)
instead of
@RunWith(PowerMockRunner.class)
@PrepareForTest( { MyStaticClass.class })
Arthur Zagretdinov thinks that this looks like the case (#709).
The Google group post:
https://groups.google.com/forum/#!msg/powermock/a18R-AP4rC8/sG442Zg1CQAJ
The text was updated successfully, but these errors were encountered: