user2323975
user2323975

Reputation: 57

Spock Mock, return "x" when method is called no matter what variables are passed to method

So I have a method that has a few variables in its signautre like this public PageLinksVM mapLinks(URI requestUrl, Integer offset, Integer limit, Integer total)

If it had no variables on the input I would do the following

 def:

object.mapLinks()>> returnedObject

How do I do this when the method has inputs and i Want to return no matter what is passed to the method?

Upvotes: 1

Views: 765

Answers (1)

hmatt1
hmatt1

Reputation: 5129

You can use *_ to allow any number of any input arguments.

def:
  object.mapLinks(*_)>> returnedObject

Here is the Spock documentation on argument contraints.

Upvotes: 1

Related Questions