bastion-dev / Bastion

Java test library for HTTP APIs
http://bastion.rocks
GNU General Public License v3.0
13 stars 8 forks source link

Allow Request templates when loading Requests/Assertions from files #16

Closed KPull closed 8 years ago

KPull commented 8 years ago

When loading a request/assertions from a file, we should use a template engine such as Handlebars or Mustache to process the file as a template and replace any template variables with values passed in from a test.

This allows us to pass in variables to files from test code. Implementation-wise, even if we specify the request from a string, the string would be a template which is processed by our Template library.

The request/assertions object would then have methods, `.addTemplateValue()' which will replace all the template variables in the body with the values given by the user.

KPull commented 8 years ago

I have implemented template for JsonRequest objects in merge request #18. I will now implement the same functionality for JsonAssertions.

KPull commented 8 years ago

Implemented template for JsonResponseAssertions objects in #20.