Running a Mock Service makes it available for you to test against. Running a Mock Service is a simple two step process:
- Run the Mock Service
- Connect your application to the running Mock Service
- Run a Transaction-based Mock Service
- Filter Mock Services by Status
- Run a MAR File-based Mock Service
- Bulk Run a Mock Service
- Configure SSL Connection to Mock Service
Run a Transaction-based Mock Service
- Find your Mock Service on the Mock Services tab and click Run.
The Status changes to Running, and the endpoint for the running Mock Service appears. - Copy the endpoint for the Mock Service and redirect your application to point to the Mock Service instead of the real Service. Do not refer to a Kubernetes-based Mock Service by its plain IP address.
The redirect configuration occurs in your application itself, not within BlazeMeter, and how you do it depends on your application. It's often as simple as changing a value in an application properties file from the live service address to the Mock Service endpoint. After you redirect your application, an application restart may be required.
Filter Mock Services by Status
In the Mock Services tab, you can filter the transactions based on their status. The filer helps in cases where there are many Mock Services defined. By using this filter option, it is easy to display a subset of Mock Services based on a certain status. For example, you can display only Mock Services that are running or stopped.
Run a MAR File-based Mock Service
- Find your Mock Service on the Mock Services tab and click Run.
The Select Credentials dialog opens.
Note: If there is only a single Broadcom's enterprise Service Virtualization credential available, BlazeMeter attempts to use that credential without opening this dialog. If there are no credentials defined, an error displays that directs you to the page for adding Service Virtualization credentials. - Select the valid Service Virtualization credentials for the VSE (Virtual Service Environment) to which you are deploying the Mock Service, and click Apply.
BlazeMeter uses the specified credentials to deploy the virtual service represented by the MAR file to the VSE that you selected in the Location field. - If you are deploying the Mock Service to your on-premise Service Virtualization VSE, use the DevTest Portal to monitor the virtual service in Service Virtualization.
You can perform edit operations and manage the virtual service in the DevTest Portal. In BlazeMeter, if you click the Stop button, the virtual service is undeployed in Service Virtualization. - Copy the endpoint or endpoints (a MAR file-based Mock Service may have more than one endpoint) for the Mock Service and redirect your application to point to the Mock Service instead of the real Service.
The redirect configuration occurs in your application itself, not within BlazeMeter, and how you do it depends on your application. It's often as simple as changing a value in an application properties file from the live service address to the Mock Service endpoint. After you redirect your application, an application restart may be required.
Bulk Run a Mock Service
You can bulk run Mock Services from the Mock Services tab or from the Asset Catalog.
Bulk Run Mock Services from the Mock Services Tab
- Click the Mock Services tab.
- Click Mock Services at the top of the page.
- Find your Mock Services on the Mock Services tab.
- Select the checkbox next to each Mock Service that you want to run.
- Select the Run Mock Services button next to the Mock Service.
Note: If one of the services is already running when you apply the bulk action, the Run Mock Services button is disabled. The converse is true, if one of the services is in the stopped state, bulk stop is disabled. Additionally, you can also delete Mock Services in bulk.
Note: Bulk actions are limited to deploying 25 Mock Services at a time.
Bulk Run Mock Services from Asset Catalog
From the Asset Catalog, you can deploy, remove or tag MAR files in bulk.
- Click the Mock Services tab.
- Click Asset Catalog.
- Click the MAR Files tab.
Note: You can deploy the files individually or in bulk.
a. To deploy MAR files individually, click the deploy button in the Actions column for each Mock Service that you want to deploy.
b. To deploy Mock Services in bulk, select the check box next to each Mock Service that you want to deploy and select the Deploy selected MAR files button next to the MAR Files title.
Note: You are limited to deploying 25 Mock Services at a time. - Select one or more MAR files and click the Deploy button.
A Deploy Settings pop-up window opens. - In the Location drop-down list, select a VSE environment.
An Advanced Settings toggle appears. - (Optional) Toggle Advanced Settings on. You can edit the Think Time Scale, Concurrent Capacity and Execution Mode settings.
- Click Deploy.
To delete MAR files in bulk, select the Remove selected MAR files button.
To add Tags to MAR files in bulk, select the Tag selected MAR files button, select the tag and click Add.
Tags allow you to create logical groups of your Mock Services. The Mock Services with the same tag can be deployed together and associated with various tests. Use tags if you are planning to associate a set of Mock Services to a test. On the Mock Services page, you can also search by a Mock Service Tag.
Configure SSL Connection to Mock Service
BlazeMeter can configure HTTPS connections to Mock Services over TLS/SSL. When you run a Mock Service over HTTPS, verify that your application can connect to the Mock Service. You can connect your application using the SSL certificate that we provide.
Cloud Deployment
When you deploy a Mock Service to a Cloud location, it uses a certificate signed by the Let's Encrypt certificate authority.
If the application or browser you're using to access a Service Mock does not trust certificates issued by Let's Encrypt, then you will need to configure it to trust the following certificates:
- Let’s Encrypt Authority X3 intermediate certificate
- DST Root CA X3 root certificate, which is used to cross-sign at the previous certificate
Refer to your application, language, or operating system documentation for details on how to import these certificates.
OPL Deployment
When you deploy a Mock Service to an on-premise location (OPL), the HTTPS endpoint is based on the IP address of the agent that deployed the Mock Service. No FDQN resolution occurs by default.
Use the following self-signed certificate to connect to a Mock Service deployed to a private location:
-----BEGIN CERTIFICATE----- MIIC4jCCAcqgAwIBAgIEXSSpbDANBgkqhkiG9w0BAQsFADAgMR4wHAYDVQQDDBUq Lm1vY2suYmxhemVtZXRlci5uZXQwHhcNMTkwNzA5MTQ0OTE2WhcNNDYxMTIzMTQ0 OTE2WjAgMR4wHAYDVQQDDBUqLm1vY2suYmxhemVtZXRlci5uZXQwggEiMA0GCSqG SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCoePRBvFbV5We4CmR/68AddxloEeH3oLeg ylZpZuPbQt0kEg93mYo4j1xvrTThS4gqCWg1bg7eh4pvVeNTUvTZf/BvCq4RGohG dfodFzHSuSNMVAhCrMmlUi+T3M4nrBjCj41ZgDB7bijMSbYhb5oOAqXHxLSNCgO/ 3UDlUwdbyTzlag0p5iu8spI6IoS6XtWR44h8Jm+WOkBSp7PIc8SMQC2xj5DWHrxx NlTTj9dC099jvvsR4ncelYNwQGEM5xj6HqTFdD6NGYkyV7r2egjl25uBbruC+M7k 1k4k5BgzuR4g/M1D9y0Yw1ezUvYMaT5g4aCSU5RV3ha4IBJaItZTAgMBAAGjJDAi MCAGA1UdEQQZMBeCFSoubW9jay5ibGF6ZW1ldGVyLm5ldDANBgkqhkiG9w0BAQsF AAOCAQEARRPDOPPHQgZCmNqamVcC4rjuG6Q5uDrOejg9uoI2iYHa4ScD8WZxKUy/ 7FTzYMBkBSb6NbhEJfIP/D7PL+MWG115080LM01WDdYN8Avjqx4ZlmyQyAwTsdKt hkGErTVqwiBjuDxjNosFi/0w1XeYIRdZ41iE5x9wqy0qio9pVyc30rwAimIbFFDc aKtLTEom3yAhj4vpBojN35YyEY6jnTkpQBcd4bnarwtqYvTbqiSIbMJivmTHl88e eWsSBE53G/u2aDPOyx+Lg24Rqh6I+ssgRVmNDZIc4Vj8cvEeTmihMVY6DTpwPls5 yuLi+DPQq6qM479piqLVP7LPV5vs/A== -----END CERTIFICATE-----
If you want to generate a hostname for the HTTPS endpoint, add an entry to your operating system's host file that lists the IP address followed by a host name that ends with mock.blazemeter.net.
Example:
10.1.1.100 testmock.mock.blazemeter.net
0 Comments