3

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?

Oliver
  • 3,815
  • 8
  • 35
  • 63
  • you can usually write spock tests alot like you would with junit. so what exactly is your question here? what have you tried so far? – cfrick Sep 15 '14 at 14:40
  • 1
    Actually I would like to understand how to combine REST-assured given()/when()/then() with Spocks blocks at best. For someone new to Groovy it is not so obvious. – Oliver Sep 15 '14 at 20:26
  • 1
    as spock already provide the same names as keywords, it will be confusing. you could check how e.g. [geb](http://www.gebish.org/manual/current/testing.html#spock_junit__testng) integrates with spock. – cfrick Sep 15 '14 at 20:30
  • Sorry I don't understand why my question is related to "recommend or find a book, tool, software library, tutorial or other off-site resource". If you apply this to my question you can close 95% of all questions on this sie. – Oliver Sep 24 '14 at 13:03

1 Answers1

4

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.

Peter Niederwieser
  • 121,412
  • 21
  • 324
  • 259