You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem? 1. Run TimesExampleTest, see 'testSpy_Bad'. What is the expected output? What do you see instead? Expected a passing test, but fails with 3 invocations, instead of 2. What version of the product are you using? On what operating system? junit:junit:4.11
org.mockito:mockito-core:1.9.5
org.powermock:powermock-module-junit4:1.5.4
org.powermock:powermock-api-mockito:1.5.4 Please provide any additional information below. The TimesExample and TimesExample2 classes are the same, except TimesExample2 calls a private method instead.
If you comment out the @PrepareForTest line, and just use Mockito, both test methods will now pass.
Did the attachments for this come over when migrating from google code? The link seems to dump me back into google code...
I'm going through an upgrade from 1.5.4. to 1.6.4 and verification counts on spys appears to have even more issues than before. I was going to try to update the attached test cases.
Main cause of the issue in how Mockito registers invocations. I've created an issue for Mockito. After issue will be fixed for Mockito 2 I'll add fix for Mockito 1.
What steps will reproduce the problem? 1. Run TimesExampleTest, see 'testSpy_Bad'. What is the expected output? What do you see instead? Expected a passing test, but fails with 3 invocations, instead of 2. What version of the product are you using? On what operating system? junit:junit:4.11
org.mockito:mockito-core:1.9.5
org.powermock:powermock-module-junit4:1.5.4
org.powermock:powermock-api-mockito:1.5.4 Please provide any additional information below. The TimesExample and TimesExample2 classes are the same, except TimesExample2 calls a private method instead.
If you comment out the @PrepareForTest line, and just use Mockito, both test methods will now pass.
Code example on gist
The text was updated successfully, but these errors were encountered: