知识卡片
按测试目的选模拟模式
固定响应支持可重复断言;动态响应让值变化、结构仍符合 schema。录放先采集已有交互,后续匹配并返回记录;代理模式可将未配请求交给真实服务,因此仍依赖其可用性。Prism 默认提供固定模式,加入 –dynamic 后得到动态值。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- API 制品的构建与配置部署 9.2 Build stage: Simulating APIs with mocks · 查看原书依据
Some mocking tools (e.g., WireMock and Hoverfly) also have other modes, such as record-replay (also called capture) and proxy mode. In the record-replay mode, the mocking tool runs as a proxy server, intercepting and transparently recording requests and responses between the client application and the API.
参考来源
- 位置:《Automating API Delivery APIOps with OpenAPI》《第 09 章 API 制品的构建与配置部署》(9.2 Build stage: Simulating APIs with mocks;来源项目 book-source,extracted/Automating API Delivery APIOps with OpenAPI/_epub-src/OEBPS/Text/chapter-9.xhtml#p111)
- 结论依据:原文区分录制重放和代理模式,其他段落用 Prism 演示固定和动态响应。
- 原始内容:Some mocking tools (e.g., WireMock and Hoverfly) also have other modes, such as record-replay (also called capture) and proxy mode. In the record-replay mode, the mocking tool runs as a proxy server, intercepting and transparently recording requests and responses between the client application and the API.