Export to GitHub

spock - issue #342

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


Posted on Jan 27, 2014 by Massive Lion

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.

Status: New

Labels:
Type-Defect Module-Core