http://meetspock.appspot.com: Mocking of non-interface not supported
GoogleCodeExporter opened this issue · comments
Google Code Exporter commented
When I tried to run the following test
(http://meetspock.appspot.com/script/5741031244955648) I got an error:
%%%
FilesystemImagePersistenceStrategyTest
- save() should gives proper name to the file FAILED
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class FilesystemImagePersistenceStrategy. Mocking of non-interface types requires the CGLIB library. Please put cglib-nodep-2.2 or higher on the class path.
at org.spockframework.mock.runtime.ProxyBasedMockFactory.create(ProxyBasedMockFactory.java:52)
at org.spockframework.mock.runtime.JavaMockFactory.create(JavaMockFactory.java:51)
at org.spockframework.mock.runtime.CompositeMockFactory.create(CompositeMockFactory.java:44)
at org.spockframework.lang.SpecInternals.createMock(SpecInternals.java:45)
at org.spockframework.lang.SpecInternals.createMockImpl(SpecInternals.java:281)
at org.spockframework.lang.SpecInternals.SpyImpl(SpecInternals.java:163)
at FilesystemImagePersistenceStrategyTest.$spock_initializeFields(Script1.groovy:25)
%%%
So, looks like it's a bug.
Original issue reported on code.google.com by slava.se...@gmail.com
on 4 Feb 2014 at 8:26
Google Code Exporter commented
Spock web console doesn't support stubbing/mocking/spying for classes (only for
interfaces).
Original comment by pnied...@gmail.com
on 4 Feb 2014 at 8:50
- Changed state: WontFix
- Added labels: Milestone-1.0