gpt4 book ai didi

grails - 如何在 Grails 集成测试中调用服务

转载 作者:行者123 更新时间:2023-12-02 05:37:21 25 4
gpt4 key购买 nike

此线程描述了如何在 View 中调用服务:How do I get an instance of a Grails service programmatically?

这描述了如何在 Servlet 中调用它:How do I get an instance of a Grails service programmatically?

这个说明了如何在 Controller 中调用它:How to dynamically select a service in Grails

我需要在集成测试中处理我的服务。这可能吗?

最佳答案

如果它是一个集成测试,您可以访问整个运行时,因此只需像往常一样注入(inject)它。

def someService

关于grails - 如何在 Grails 集成测试中调用服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18404590/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com