chcchangchc / powermock

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

EasyMock mocks created using @Mock, etc. should be named according to the field name #336

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create two mocks of the same type using @Mock and EasyMock support
2. Write a test that breaks due to an unexpected call.

What is the expected output? What do you see instead?
Expected output:
* Unexpected method call <mockName>.<methodName>(<parameters>)
Actual output:
* Unexpected method call <methodName>(<parameters>)

What version of the product are you using? On what operating system?
PowerMock 1.4.7 with EasyMock (Linux)

Please provide any additional information below.

When there is more than one mock of the same type, it is hard to tell which 
expectation is not met, or which mock received an unexpected call.

All mocks should be given the same name as the field that the annotation is 
applied to.

Original issue reported on code.google.com by grlea....@gmail.com on 26 Jul 2011 at 3:10

GoogleCodeExporter commented 9 years ago
Good idea. How ever I don't think the EasyMock extension even has support for 
normal aliases yet so please provide a patch if you want this done any time 
soon.

Original comment by johan.ha...@gmail.com on 21 Aug 2011 at 9:28