Simulate or Invoke Services

When you configure a virtual SV Lab, you set the service mode to simulate or invoke services. Then, while the virtual lab is running, every service is in one of following simulation modes:

  • simulating responses

  • forwarding requests to real services and sending responses back to the client

  • invoking a real service with requests from the scenario (push)

JSON lab configuration

In JSON lab configuration, you set the following service instance property:

"virtualServiceInstance": [
  {
    ...
    "serviceMode": "SIMULATE_SERVICE",
    ...
  }
]

Possible serviceMode values:

  • SIMULATE_SERVICE
  • FORWARD_TO_REAL_SERVICE
  • INVOKE_REAL_SERVICE

Back to top

Service Virtualization Java API

When using the the Service Virtualization Java API, you set the mode using the setServiceMode() method:

sv.addVirtualServiceInstance(f -> f.virtualServiceInstance(lab.getId())
    ...
    .setServiceMode(ServiceMode.SIMULATE_SERVICE)
    ...

Back to top

See also: