CONTINUOUS TESTINGtech blogsMock Services and Service Virtualization on the BlazeMeter Continuous Testing Platform

With the introduction of BlazeMeter Mock Services, we have expanded Service Virtualization to make it easier for Agile teams to Shift-Left earlier in their SDLC. 
Koustubh Warty Koustubh WartyMay 20, 20204 min

Mock Services is a part of the Service Virtualization product and is also an integral component of the BlazeMeter Continuous Testing platform. Service Virtualization is an Enterprise product used by the largest banks, insurance companies, airlines, telecom verticals to remove dependencies that prevent testing earlier in the SDLC.  With the introduction of BlazeMeter Mock Services, we have expanded Service Virtualization to make it easier for Agile teams to Shift-Left earlier in their SDLC.  If you are a current client of Service Virtualization, you are also licensed to use Mock Services in BlazeMeter.

 

On the BlazeMeter Continuous Testing platform, Mock Services functionality enables Agile teams to create Mock Services to simulate dependent services quickly as a part of their development and testing cycles. Mock Services supports the classic paradigm of Shift-left, democratizing testing. Mock Services are meant to eliminate your testing dependencies throughout your SDLC which in turn results in shorter release cycles, reduced infrastructure dependencies and 3rd party costs. 

 

BlazeMeter Continuous Testing platform supports the following type of Mock Services –

 

  1. Transaction Mock Servicesenables Agile teams typically working in microservices oriented development to quickly stand up lightweight Mock services to simulate HTTP endpoints (REST/SOAP services) using industry standard specifications like Swagger, WSDL, RR pairs and HAR formats. The heart of the Transaction-based Mock Services are Transactions which represent Request/Response data and additional parameters/configurations that can be updated at any time to alter their behavior including adding/removing transactions to support specific tests. 

 

Transactions are saved in the BlazeMeter Asset Catalog and the catalog allows team members to share them across any group. When a Mock Service is deployed, it exposes an endpoint which can then be referenced by any application under test that wants to use the Mock Service endpoint for simulating a dependent service. This Mock Service can be called when executing BlazeMeter Functional and Performance Tests. This way BlazeMeter Functional and Performance tests truly become “self-defining” assets since the tests also contain information about their dependencies by referring to Mock Services and their required configurations to support these tests, as a part of the test definition itself.

 

An important aspect of Transaction Mock Services is the support and interoperability with open source frameworks such as Wiremock or CodeSV. With the Wiremock extension, developers who are already using Wiremock can convert their “in code” request/responses into Transactions and upload them directly to the BlazeMeter Asset Catalog. This enables effective sharing of transactions between other Agile team members or even other teams to reuse Transactions and create Mock Services “as code” to simulate dependent services, which greatly enhances not only the quality of their unit tests but also the test coverage. 

mock services in blazemeter

 

  1. MAR Mock Services are based on the virtual services already created in traditional Service Virtualization and saved in the .mar format. We are able to unleash the full power of Service Virtualization on the Agile teams to support complex protocols and extended matching rules and/or behavior. The BlazeMeter Mock Services Asset Catalog is a repository where Virtual Services in .mar format can be stored, inspected and deployed thereby enabling team members (developers and testers) to collaborate using a central repository and find/share available services. A key advantage with the services stored in the Asset Catalog is they can be seamlessly deployed on the Service Virtualization VSEs within your enterprise by creating MAR-based Mock Services leveraging the BlazeMeter on-premise location (OPL) infrastructure. Just like Transaction Mock Services, a MAR Mock Service deployment also exposes an endpoint which can then be referenced by any application under test to utilize as a dependent service. Additionally, this Mock Service can also be referenced when executing BlazeMeter Functional and Performance tests thereby making them truly “self-defining” assets where the test carries information about its dependent Mock Services along with the configuration required for the tests to utilize these Mock Services. The following graphic illustrates the linkage between BlazeMeter and traditional Service Virtualization environments.

mock services in blazmeter

 

mock services in blazemeter

 

 

Near Future: The next logical step in this journey (under development and based on strong feedback from our dedicated Service Virtualization customers), is the ability to deploy ephemeral VSEs on-demand from the BlazeMeter platform itself, without any dependency on the existing Service Virtualization installation on-premise. This is a giant leap towards simplifying Service Virtualization infrastructure needs and would essentially take away the pain associated with managing and maintaining Service Virtualization installation for deployment and execution of Mock/Virtual Services. An important point to note here is that the authoring of Virtual Services will still require the Service Virtualization IDE component like the Workstation which offers advanced authoring capability. To learn more about BlazeMeter Mock Services please visit us here.