我在我的 java 应用程序中使用 spock 和 groovy 构建了测试用例。是否可以在不使用 mock mvc 或 reassured 的情况下将 spring rest docs 添加到这个项目
这是我的项目的片段
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'
}
}