[ 
https://issues.apache.org/jira/browse/GROOVY-8481?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rahul Kumar updated GROOVY-8481:
--------------------------------
    Summary: GROOVY TEST CASE RUNTIME EXCEPTION-MISSING METHOD EXCEPTION  (was: 
GROOVY RUNTIME EXCEPTION)

> GROOVY TEST CASE RUNTIME EXCEPTION-MISSING METHOD EXCEPTION
> -----------------------------------------------------------
>
>                 Key: GROOVY-8481
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8481
>             Project: Groovy
>          Issue Type: Test
>          Components: groovy-runtime
>            Reporter: Rahul Kumar
>            Priority: Major
>
> I have a groovy class with sql queries in it.I had wriiten a groovy test case 
> by mocking sql class but it's shows Missing method exception
> *CODE:*
> mock = new MockFor(Sql.class)
> mock.demand.newInstance{
> def URL, def username, def password, def driver ->
> return mock
> }     
> List<User> tempList = new ArrayList<User>()
> mock.demand.eachrow{
>       def query, closure ->
>       tempList.each(closure)
> }
>  mock.use{
> def obj=new object()
> obj.function()
> }
> *ERROR:*
> groovy.lang.MissingMethodException: 
> No signature of method: groovy.mock.interceptor.MockFor.close() is applicable 
> for argument types: () values: []
> Possible solutions: use(groovy.lang.Closure), use([Ljava.lang.Object), 
> use(groovy.lang.GroovyObject, groovy.lang.Closure), use(java.lang.Class, 
> groovy.lang.Closure), use(java.util.List, groovy.lang.Closure), collect()
>                 at 
> com.ABC.aws.application.appMockTest.testUserList(appMockTest.groovy:56)  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to