Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SVC2023.2

In this section:

Table of Contents
maxLevel1

Introduction

The Parasoft HTTP Simple Mocking Tool allows a Virtual Asset to learn and replicate the transactions between the application under test and a back-end component. It can be used to record and simulate traffic without the use of the proxy.

In this section:

Table of Contents
maxLevel1

Prequisites

  • Parasoft Virtualize 9.10.x or later

...

The tool can be installed from the UI or command line.

UI Installation

  1. Go to Parasoft > Preferences and click System Properties.
  2. Click Add JARs and select the
  3. Choose Parasoft> Preferences.
  4. In the System Properties preferences page, click Add JARs.
  5. Browse to and select HTTPSimpleMockingTool.jar file.
  6. Click Apply.
  7. Restart Virtualize.

Command Line Installation

Add the HTTPSimpleMockingTool.jar file to the system.properties.classpath property in your settings properties file. For example:

system.properties.classpath=<path to jar><PATH_TO_JAR>/HTTPSimpleMockingTool.jar

Alternatively, you could add the HTTPSimpleMockingTool.jar file to the VirtualAssets/system_jars folder. Create this folder if it does not already exist. Make the following API call to reload the .jar:

http://<virtualize<VIRTUALIZE_serverSERVER_host>HOST>:<virtualize<VIRTUALIZE_serverSERVER_port>PORT>/soavirt/api/<version ><VERSION>/preferences/systemProperties/reload

...

  1. Right-click the Virtual Assets project and choose Add New> New > Virtual Asset (.pva) File.
    Image Removed 
  2. Provide a name for the .pva and click Next.Image Removed 
  3. Choose the Empty folder and click Next.Image Removed 
  4. Right-click the new responder suite and choose Add New> New > Responder.
    Image Removed 
  5. Choose the Literal Message Responder and click Finish.
    Image Removed 
  6. In the Response tab of the newly - created Literal Message Responder, add a default message for your responder in case a matching request/response pair is not found in the traffic file and the real service is not available for recording.
     
  7. Save the modified responder.
  8. Right-click the responder and choose Add Output.Image Removed 
  9. Choose Outgoing Response> Payload and Response > Payload in the left panel and choose HTTP Simple Mocking Tool in the right panel. This tool must be added to the outgoing response payload; other options are not applicable.
     
  10. Configure the tool options. See Tool Configuration.

...

If a match is found, the correlated request is sent to the client. If no match is found, the tool forwards the message to the actual service and attempts to record a request/response pair. If recording is not possible (e.g.for example, because the service is not responding), the message responder associated with this tool will respond to the client with the default "catch all" message that you provided. 

...