combine @TestFor and @Integration Annotation grails 3

对着背影说爱祢 提交于 2019-12-12 06:35:52

问题


I migrate a large Grails 1.3.7 project to 3.1.6. Tests for Controllers are integration tests. This works fine because the tests inherit from ControllerSpec. Now i´m should be able to do something like this:

@Integration
@TestFor(SampleController)
class SampleControllerIntSpec extends Specification {

Because the TestFor Annotation allows usage of model/view/.. fields like in Unit tests.

Is there a way to do something like this?

Thanks in advance.


回答1:


No the TestFor annotations are exclusively for unit tests, Integration tests are full functional tests in Grails 3 where you should use a client like Geb to send requests to the server and assert responses.



来源:https://stackoverflow.com/questions/36938168/combine-testfor-and-integration-annotation-grails-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!