scala-academy / castalia

API stub server
Other
8 stars 3 forks source link

As a stubserver consumer I want to be able to easily maintain stubdata with excel #57

Open jordi133 opened 8 years ago

jordi133 commented 8 years ago

Acceptance criteria:

background: given that the stubserver is started and there is a file stubdata.csv on the classpath containing: """ key;statuscode;latency;value1;value2 1;200;10;waarde1;een 3;503;200;; ;404;100;; """

given that I configured a stub to use as behavior source SimpleExcelStub (with additional configuration as specified below) when I do a HTTP GET to .../castalia/stubs/simpleexcelstub/1 then I should get a HTTP 200 response containing the following data: { "asdasd": "waarde1", "content": { "saddasdasdas": "een" } }

given that I configured a stub to use as behavior source SimpleExcelStub (with additional configuration as specified below) when I do a HTTP GET to .../castalia/stubs/simpleexcelstub/2 then after roughly 200 ms I should get a HTTP 503 response

given that I configured a stub to use as behavior source SimpleExcelStub (with additional configuration as specified below) when I do a HTTP GET to .../castalia/stubs/simpleexcelstub/3 then after roughly 100 ms I should get a HTTP 404 response

jordi133 commented 8 years ago

It would be logical for the stub to use a reponse template (could be contained in SimpleExcelStub.scala, could be in a separate .json file): { "asdasd": "$value1", "content": { "saddasdasdas": "$value2" } }

example simpleexcelstub.json { "endpoint": "simpleexcelstub", "behaviorSource": "SimpleExcelStub.scala" }