阅读有关Grails单元测试的文档时,我发现以下内容:
^ Grails 9.1 Unit Testing Documenation
因此,我假设缺少的注入(inject)方法是指:
getBy*
,.save()
方法他们在这里谈论的还有动态注入(inject)的其他内容吗?
最佳答案
本质上,文档中指出了所有与GORM相关的方法(动态查找器等)。它们在单元测试(不带模拟)中不可用,仅在集成测试中可用。
以下是单元测试期间不可用的大多数方法。addToattachcountcountBycreateCriteriadeletediscardexecuteQueryexecuteUpdateexistsfindfindAllfindAllByfindAllWherefindByfindWheregetgetAllgetDirtyPropertyNamesgetPersistentValuesidentisAttachedisDirtylistlistOrderByloadlockmergereadrefreshremoveFromsave
关于hibernate - Grails单元测试中不包括哪些动态方法?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7699000/