grails 3 功能测试插件

grails 3 functional test plugin

当我使用 grails 2 时,我使用 functional plugin to create the function test and I use Rest-client-builder 发送 post 并获取请求。功能测试本身可以启动服务器。

但是,当我升级到 grails 3 时,内置的 geb 框架可以帮助我创建功能测试。但是,我不知道如何发送 post 并获取请求。并且功能测试本身无法启动服务器。我必须先 运行-app 然后 运行 测试。有谁知道我应该做什么 function post/get test via grails 3?

非常感谢

And the function test itself can not start up the server.

你没有描述你正在做的事情的细节,所以我不知道为什么它可能不适合你,但它肯定可以工作。您可能想要创建集成测试并用 @Integration 标记它们。我们在 https://github.com/grails/grails3-functional-tests. Look in https://github.com/grails/grails3-functional-tests/tree/master/app1/src/integration-test/groovy/functionaltests. A simple example that should be easy to read is at https://github.com/grails/grails3-functional-tests/blob/master/app1/src/integration-test/groovy/functionaltests/HomeSpec.groovy.

的项目中有很多示例

希望对您有所帮助。