The Learn More tab in the Mock Service feature makes it easy to create your first Mock Service.
Additional options are available when you create a Mock Service from the Mock Services page. For more information, see Creating a Mock Service.
Create Your First Mock Service
Follow these steps:
- Log in to BlazeMeter and click the Mock Services tab.
- Click Learn More at the top of the page.
- Drag a supported file type into the upload area, or click the area to browse and find the file you want. This file should contain all of the Transactions that you want to use for your Mock Service. For more information about supported file formats of transactions, see Adding Transactions.
Note: If you want to upload multiple Swagger files using a zip file, the main file in the zip file must be named index.json or index.yaml for the upload to work.
If you do not have a file, you can try the sample file by clicking the link below the upload box.
The Mock Services page opens, and the first Mock Service listed was newly generated from the file you uploaded.
- Click the arrow next to the Mock Service name to expand the details for the mock service.
- Enter a name for the Mock Service in the Name field.
- This field is populated with a default name that you can rename to any Mock Service name that you like.
- Leave the default selection in the Select Service drop-down.
A Mock Service created from Learn More automatically creates a Service for you. For more information about Services and how you create them in a typical scenario, see Creating a Mock Service.
- Select the location that you want to deploy your mock service to from the Location drop-down.
- Unless you plan to run the Mock Service in a private location, select from the available Google Cloud Platform locations (US East or EU West) depending on your location.
- Select either HTTPS or HTTP from the Endpoint drop-down.
- The default is HTTPS.
- Review the Transactions in this Mock Service pane to see the Transactions added to the Mock Service from the file you uploaded.
Creating a Mock Service from Learn More automatically adds all Transactions from your file to the Mock Service. You can remove Transactions as needed by moving them to the left pane.
- Click the Parameters tab.
- In the No Matching Requests field, choose the correct logic for when a request against the Mock Services does not match any of the provided transactions. The request can either throw an error or be redirected to the live service.
Note: If you select Redirect to live system, a new field Live System Endpoint shows. For more information, see Live System Endpoint.
- Set the Think Time in milliseconds to control the amount of time spent between when the Mock Service receives and request and when it sends a response.
- Click Save.
The Mock Service is created and available on the Mock Services page. Run the service to activate the virtual endpoint and run tests against it.
Live System Endpoint
If you select Redirect to live system in the No Matching Requests field, a new field Live System Endpoint shows. Enter the URL. Unmatched requests are forwarded to the endpoint specified.
The URL format should be: http[s]://<HOST>[:<PORT>][/BASE_PATH].
Schema and host are required and everything else is optional.
If the Live System Endpoint contains value https://live:5443/ser1, the incoming request with https://mock/ping will be forwarded to https://live:5443/ser1/ping.
If the Live System Endpoint contains value https://live:5443, the incoming request with https://mock/ping will be forwarded to https://live:5443/ping.