javaアプリケーションでspockとgroovyを使ってテストケースを構築しました。 MVCのモックを使用せずに、このプロジェクトに春の残りのドキュメントを追加することが可能であるか、ここでspockでspring rest文書を使用することは可能ですか
をrestassuredすることは私のプロジェクトのスニップは、あなたがスポックと春RESTドキュメントを使用することができますが、あなたがする必要があります
import groovyx.net.http.RESTClient;
import spock.lang.Specification;
class FindIdeasSpec extends Specification{
def host ="http://www.localhost.com:8080/v1/"
def path = "communities/"
def client = new RESTClient(host)
def id = 1
def "verify the links"() {
when: "request ideas list"
def response = client.get(path: path + id + '/ideas')
then: "returns parent and self link"
with(response) {
status == 200
data.links.rel == ['self']
data.links.href[0] == host + path + id + '/ideas'
}
}