Generics with Spock Stub
问题 I cannot make compile Spock stub for generic class. The signature of constructor is following: SomeClass(SerSup<Cap> capSup, String foo, String bar); I need to stub the first argument. The following are my failed attempts. First try: def someClass = new SomeClass(Stub(SerSup<Cap>), "foo", "bar") Error: Groovyc: unexpected token: > Status bar: ',' or ')' expected Another try: def someClass = new someClass(Stub(Cup) as SerSup<Cup>, "foo" ,"bar") groovy.lang.MissingMethodException: No signature