NaturalIntelligence/Stubmatic

View on GitHub
lib/sample_repo/stubs/response.txt

Summary

Maintainability
Test Coverage
This is the sample generated response.

Skeleton based approach
It is advisable to use dbset and dumps to reduce number of response files.
Examples:

[ [dumplocation:dump1,# #dbset key##]]

You can use captured request part to select a file dynamically or to serve dynamic response.

< % url.2 %> < % post.1 %>

Or use markers to show today's date: { {TODAY}} and some other date of next year { {TODAY+1y+2m-1d}}

You can format it as well
{ {formatDate(TODAY,'dd/MM/YYYY')}}
{ {formatDate(TODAY+3,'dd/MM/YYYY')}}
{ {formatDate(TODAY+3d-2m,'dd/MM/YYYY')}}
{ {TODAY+3}}

Show random numbers: 
{ {random(5)}}
{ {random(4,'alpha_num')}}-{{random(4,'alpha_num')}}-{{random(4,'alpha_num')}}-{{random(4,'alpha_num')}}

Check http://naturalintelligence.github.io/stubmatic/ for more detail