Table of Contents
- API Spec
- REST Service Request
- REST Service Response
- Mock App creation
- Advanced Response Definition
- Testing
- Metrics
Meter Data Service API Mock creation to get quickly a validation Service. This Service will be used by the Customer On-Boarding TIBCO Cloud? Live Apps Sample to validate Meter Data.
API Spec
The full Swagger is stored on Git Hub, and available for Import into your TIBCO Cloud? Account: https://github.com/JGrotex/TCIAPIspecSamples/blob/master/MeterService_1498804832664.json
REST Service Request
Allows to request a single Meter by Serial Number {sn}
REST Service Response
Returns a single Meter with Serial Number and Type (just an example, feel free to add more Details), in case the Meter is not found there is a specific Response (204) with no Data defined.
Mock App creation
To create the Mock App from the API Spec, just click in the List of API's on "..." (Table right) and the Context Menu allows you to Create the Mock App ...
Advanced Response Definition
Switch to Advanced Mock, to not always just get the same response from the Service Mock.
Script to copy, any maybe you like to extend it with some more different responses ...
if(req.params.sn=="123") { res.status = 204; } else { res.status = 200; res.body = {sn:req.params.sn, type:"Energy"}; } return res;
Testing
As a next step the Advanced Mock App can be tested using the Endpoint - View API URL
Metrics
Finally there are some Metrics and Logs available for the Mock App, but they are les important for testing.
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now