Mocked collaborator. Expectation set on a method with named parameters. Named
parameters must be wrapped with Map literal (although not required by Groovy).
If not, compilation error occurs.
Doesn't work:
1 * collaborator.method(param1: 1, param2: 2)
Compilation error compiling [unit] tests: unknown kind of argument list:
org.codehaus.groovy.ast.expr.TupleExpression@1066d85f[org.codehaus.groovy.ast.ex
pr.NamedArgumentListExpression@50074d62[org.codehaus.groovy.ast.expr.MapEntryExp
ression@f6985fa(key: ConstantExpression[param1], value: ConstantExpression[1]),
org.codehaus.groovy.ast.expr.MapEntryExpression@58dae7fd(key:
ConstantExpression[param2], value: ConstantExpression[2])]] (Use --stacktrace
to see the full trace)
Works:
1 * collaborator.method([param1: 1, param2: 2])
Please see the attached test case for the full source code.
Original issue reported on code.google.com by mgrys...@gmail.com on 7 Apr 2014 at 2:14
Original issue reported on code.google.com by
mgrys...@gmail.com
on 7 Apr 2014 at 2:14Attachments: