Can someone please let me know how to require static class methods. I tried with the code below and it does not work with it:
import groovy.mock.interceptor.MockFor
final mockCl = new MockFor(ClassName)
mockCl.demand.static.methodName(1) { return 'something' }
However, he gives below exceptions:
groovy.lang.MissingPropertyException: No such property: static for class: groovy.mock.interceptor.Demand at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53) at org.codehaus.groovy.runtime.callsite.GetEffectivePogoPropertySite.getProperty(GetEffectivePogoPropertySite.java:87)
Can someone tell me how to mock static methods in JUNIT with grails 3.
source
share