raml-mocker icon indicating copy to clipboard operation
raml-mocker copied to clipboard

做API 测试时只能描述happy path,缺乏对异常测试很好的描述

Open xbl opened this issue 6 years ago • 1 comments

  1. API 测试也只能提供一份测试参数,不能对异常数据多种情况进行描述。

      responses:
        200:
          body:
            example: ''
        400:
          body:
            type: UpdateGrassFailedVo
            example: !include ./grass/grass_post_400.json

只会去第一个状态(如:200)作为默认的response 400 的情况除非手动调整顺序否则永远不会返回。

xbl avatar Dec 17 '18 05:12 xbl

需要将 raml 的片段作为一个契约的描述,每个契约 与 Mock Server 是独立存在的,仅仅只描述契约的期望,类似 pact 的契约 Server 的形式。

xbl avatar Apr 03 '19 01:04 xbl