gordonad / powermock

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

Support mocking of new instance calls to final system classes #101

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Mock i.e. String string = new String(). This may work already (but probably
not), we could use the same technique as with static mocking of methods in
final classes (hopefully).

Original issue reported on code.google.com by johan.ha...@gmail.com on 23 Apr 2009 at 6:48

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 2 Jun 2009 at 5:39

GoogleCodeExporter commented 9 years ago
You can now mock new instance calls to final system classes in the same was 
you'd
mock any other new instance call. However if you want to setup expectations for 
the
final system class mock returned by expectNew you must also prepare the actual 
test
case using @PrepareForTest.

Original comment by johan.ha...@gmail.com on 30 Jul 2009 at 2:25