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.
Issue description
We can add new features to the fault-injection plugin for the following reasons:
Currently, the
fault-injectionplugin does not support custom conditions to implement themockfunction. 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:
When there are multiple conditions in
vars, they have anorrelationship.If
varspasses 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.