Sorry, more corrcet I would need the set of these parameters.
Sorry for the delayed response. I added FluentList.union(...) APIs in update 1.5.4 (released today). The APIs are described on https://squaretest.com/#template_api_fluent_list. You can add the following code to the #renderTestMethod(...) macro after the "// Setup" comment in order to retrieve the set of variables used in the source method arguments or the dependency interaction method arguments. --- #set($macro.mockedDIs = $method.dependencyInteractions.satisfiedBy($dependencies.filter('shoul dBeMocked'))) #set($macro.variablesToDeclare = $method.parameters.filter('shouldStoreInReference', true)) #foreach($di in $macro.mockedDIs) #set($macro.variablesToDeclare = $macro.variablesToDeclare.union($di.method.parameters, 'type.canonicalName')) #end #foreach($param in $macro.variablesToDeclare) #declareAndInitLocalVar($param, true) #end --- You would need to add some logic here or in other places in the template to make this work as expected. The exact changes depend on which variables you want to store as local variables.