← 返回起始笔记位置

知识卡片

普通读书笔记卡 · 10296.b.2.b · 生成模型:未记录

用模拟解除联调依赖

理解等级:中级

API 依赖尚不可用时,消费方可对照契约使用模拟,与后端并行实现和测试。桩返回预置结果,mock 可对不同输入提供条件化结果,隔离沙箱运行真实实现并可能只开放部分能力。模拟适合反复跑已知情形,真实服务的符合性仍需通过部署后验证。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《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#p77) - 结论依据:原文说明模拟接收和实际 API 同类请求并返回类似响应,后文区分实现方式。 - 原始内容:API simulations solve this problem. An API simulation mimics the real API by accepting the kind of requests and returning the kind of responses the API would to enable developers to work on and test applications that depend on the API. This is illustrated in figure 9.3.