Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是否可以在测试中而不是在实际代码中使用 ScalaMock 存根?我想运行需要我现在要存根的其他服务女巫的 http 服务。在文档中找不到如何实现这一点。
在依赖管理和字节码方面,运行时和测试环境之间的行为应该没有区别。唯一的区别是为它们中的每一个定义了哪些依赖项。我假设只需从以下位置删除Test:
Test
libraryDependencies += "org.scalamock" %% "scalamock-scalatest-support" % "3.5.0" % Test
应该做的工作。不过,就个人而言,我更愿意手动编写存根服务。