vijayjcp / powermock

Automatically exported from code.google.com/p/powermock
Apache License 2.0
0 stars 2 forks source link

Verification count of stubbed method on spy is wrong for some method implementations #484

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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.

Original issue reported on code.google.com by ryan.gus...@gmail.com on 4 Mar 2014 at 5:07

Attachments: