Closed jordi133 closed 8 years ago
Example json:
{ "endpoint": "jsonconfiguredstub", "delay": { "distribution": "constant", "mean": "100 ms" }, "responses": [ { "id": "1", "httpStatusCode": 200, "response": { "id": "een", "someValue": "123123" } }, { "id": "2", "httpStatusCode": 200, "response": { "id": "twee", "someValue": "123123", "someAdditionalValue": "345345" } }, { "id": "0", "delay": { "distribution": "constant", "mean": "2 s" }, "httpStatusCode": 404 } ] }
Yordi, is it OK to implement this feature by creating a "default": { ... } response, which will hold the default properties? That makes it easy to also use a default httpStatusCode, and other future properties (the final result becomes a simple 'merge' of the default json with the response json).
Acceptance criteria:
background: given that the stubserver is started
given that I configured a stub with a property "delay" as constant 100 ms and I configured a specific response of that stub with id a property "delay" as constant 2 s
when I get a response from that stub with an id different from
then the latency of that response should be roughly 100 ms
given that I configured a stub with a property "delay" as constant 100 ms and I configured a specific response of that stub with id a property "delay" as constant 2 s
when I get the response from that stub with id equal to
then the latency of that response should be roughly 2 s