Forgus / spock

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

Creating a global mock for an abstract class fails with a java.lang.InstantiationError #342

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Steps to reproduce (with 1.0-groovy-2.0-SNAPSHOT):
- create an abstract class, say MyAbstractClass
- try to create a global mock for it, GroovyMock(MyAbstractClass, global: true)
- see java.lang.InstantiationError being thrown
- remove global: true and rerun - no exception is thrown

This defect kind of kills the ability to mock static methods in some cases as 
frameworks (Atmosphere in my case) quite often provide them on abstract classes.

Original issue reported on code.google.com by erd...@gmail.com on 27 Jan 2014 at 5:06