Skip to content

[discuss]: use fault-injection plugin to implement mock function #2511

Description

@Firstsawyou

Issue description

We can add new features to the fault-injection plugin for the following reasons:
Currently, the fault-injection plugin does not support custom conditions to implement the mock function. I think we can add the request header as a conditional judgment in the request (there may be a better way) to realize the mock function.
E.g:

"vars": [
     [ "http_mock01", "==", " api01" ],
     [ "http_mock02", "==", " api02" ]
]

When there are multiple conditions in vars, they have an or relationship.
If vars passes the verification, fault injection is performed on the request. Otherwise, no processing is done on the request. In order to maintain backward compatibility, the fault injection operation is still performed when the vars condition is not configured.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions