问题
I am new to Spock and would like to write tests for a REST interface with Spock and REST-assured. Knowing REST-assurend in conjunction with Java I would like how to use REST-assured with Spock. Can anyone provide an example for this?
回答1:
REST-Assured's DSL seems at odds with Spock's DSL. Potential solutions are to adapt the former (e.g. using Groovy extension methods), or to put all code into a single expect:
block.
来源:https://stackoverflow.com/questions/25848889/rest-assured-with-spock-and-groovy