@Grab('org.spockframework:spock-core:0.7-groovy-2.0') @Grab('org.codehaus.groovy.modules.http-builder:http-builder:0.7.1') import groovyx.net.http.RESTClient import static groovyx.net.http.ContentType.* import org.apache.http.client.HttpResponseException import spock.lang.Specification import spock.lang.Unroll class Test extends Specification { def ROOT = "http://localhost/" def http = new RESTCli
![APIのテストを書くならspock + RESTClientが便利かも(Groovy) - Qiita](https://cdn-ak-scissors.b.st-hatena.com/image/square/e1f67eb1b88a2d2a63b88cd795a2ccdcfb7c174a/height=288;version=1;width=512/https%3A%2F%2Fqiita-user-contents.imgix.net%2Fhttps%253A%252F%252Fcdn.qiita.com%252Fassets%252Fpublic%252Farticle-ogp-background-1150d8b18a7c15795b701a55ae908f94.png%3Fixlib%3Drb-1.2.2%26w%3D1200%26mark%3Dhttps%253A%252F%252Fqiita-user-contents.imgix.net%252F~text%253Fixlib%253Drb-1.2.2%2526w%253D840%2526h%253D380%2526txt%253DAPI%2525E3%252581%2525AE%2525E3%252583%252586%2525E3%252582%2525B9%2525E3%252583%252588%2525E3%252582%252592%2525E6%25259B%2525B8%2525E3%252581%25258F%2525E3%252581%2525AA%2525E3%252582%252589spock%252520%25252B%252520RESTClient%2525E3%252581%25258C%2525E4%2525BE%2525BF%2525E5%252588%2525A9%2525E3%252581%25258B%2525E3%252582%252582%252528Groovy%252529%2526txt-color%253D%252523333%2526txt-font%253DHiragino%252520Sans%252520W6%2526txt-size%253D54%2526txt-clip%253Dellipsis%2526txt-align%253Dcenter%25252Cmiddle%2526s%253De1a9285aabe7027b92b5c66e5a781bc5%26mark-align%3Dcenter%252Cmiddle%26blend%3Dhttps%253A%252F%252Fqiita-user-contents.imgix.net%252F~text%253Fixlib%253Drb-1.2.2%2526w%253D840%2526h%253D500%2526txt%253D%252540kimromi%2526txt-color%253D%252523333%2526txt-font%253DHiragino%252520Sans%252520W6%2526txt-size%253D45%2526txt-align%253Dright%25252Cbottom%2526s%253D6fa0dda63f479d2fc8955ae87613dd24%26blend-align%3Dcenter%252Cmiddle%26blend-mode%3Dnormal%26s%3D063af74f26c8f24f8ee6630a341d077c)