Stubbing settings for Istio stubs

You can specify the stubbing settings depending on the Message Exchange Pattern defined for the HTTP transport.

Before you begin

You must have completed the following tasks:

About this task

You can create stubs for the following types of requests received or sent by the Istio service mesh:
  • Requests received by services in the Istio service mesh.
  • Requests sent from namespaces in the Istio service mesh to external services that are not in the Istio service mesh.

Procedure

  1. Double-click the operation in the Logical View tab of Architecture School perspective.

    The Operation dialog is displayed.

  2. Click the Stub tab.
    The Stub tab is displayed.
    image of the operation screen showing the subscribe settings.
  3. Complete the following steps to select a transport:
    1. Click Browse and select the HTTP transport in the Select a Resource dialog box.
    2. Select from the following options for the action you want:
      Option Action
      No If you select No, you can select any transport in the project.
      Yes If you select Yes, you can select only transports that are referenced (directly or indirectly) by the operation that contains the test.
      Only Direct If you select Only Direct, you can select only transports that are referenced directly by the operation that contains the test.
    3. Click OK.
  4. Select the message type as Text in the Message Type field.
  5. Complete the following steps in the Property Filters tab, if required:
    1. Select the Filter resource path check box.

      When the Filter resource path check box is selected, the particular resource path within the service to which the filter must be applied is to be specified. If the Filter resource path check box is not selected, all requests on the service port configured are processed without any filters applied. For more information about the resource paths, see the related links.

    2. Enter the path to the particular resource within the service, in the Resource Path field.
    3. Select the path type for the path you entered, from the list.
    4. Select the Filter HTTP method check box.
    5. Select the HTTP method from the list that you want to use in the stub.
    6. Retain the selection for Participate for stubs.
  6. Complete the following steps in the Header Filters tab, if required:
    1. Select the Filter header values check box to create a list of services whose messages are processed by the stub.
    2. Click New to add a header to the list.
    3. Enter the header type in the Name field.
    4. Enter the value in the Value field.

      There is no restriction placed on the value that you can enter in this field.

    5. Click OK to add the header.
  7. The Default Timeout section contains common settings for stub replies. No change is required. The response time is managed by the stubs execution engine in HCL OneTest API.
  8. Click OK to save the stubbing settings.

Results

You have configured the stubbing settings for an operation.

What to do next

You can create a stub by using MEP from the Test Factory view. See Creating a stub by using MEP.

After you create the stub that virtualizes a service in the Kubernetes cluster, you can perform the following actions:
  • Publish the stubs to Istio. See Publishing stubs to Istio.
  • After publishing the stubs, you can run the stubs on Istio. See Running stubs in Istio or Kubernetes.
    Note: You cannot run the stubs on HCL OneTest API.
  • You can add the stubs to a project on HCL OneTest Server, and then run the stubs from the Execution page. Refer to the HCL OneTest Server documentation.