Class FaultRule
- Namespace
- Kuestenlogik.Bowire.Mock.Chaos
- Assembly
- Kuestenlogik.Bowire.Mock.dll
One fault rule: method matcher + latency shape + fault behaviour.
public sealed class FaultRule
- Inheritance
-
FaultRule
- Inherited Members
Constructors
FaultRule()
public FaultRule()
Properties
Enabled
Toggle without deleting the rule. Default on — presence in the file opts in.
[JsonPropertyName("enabled")]
public bool Enabled { get; init; }
Property Value
ErrorStatusCode
Status returned by Error hits. Default 503.
[JsonPropertyName("errorStatusCode")]
public int ErrorStatusCode { get; init; }
Property Value
Kind
Fault behaviour. Default LatencyOnly.
[JsonPropertyName("kind")]
public FaultKind Kind { get; init; }
Property Value
Latency
Latency to inject on every match. Null → no delay.
[JsonPropertyName("latency")]
public FaultLatency? Latency { get; init; }
Property Value
Method
Service/Method glob, spanning any run of characters
(e.g. UserService/, /Get). Null / empty / *
matches every method. Case-insensitive.
[JsonPropertyName("method")]
public string? Method { get; init; }
Property Value
OnMiss
#411: when true, this rule applies to requests that matched NO stub
(instead of a matched step) — chaos-testing a client's handling of an
unknown/failing endpoint. The Method glob is ignored for
onMiss rules (a miss has no service/method); the first enabled
onMiss rule wins. Meaningful kinds: latency-only, error,
connection-drop, malformed-response (partial-response needs a body).
[JsonPropertyName("onMiss")]
public bool OnMiss { get; init; }
Property Value
PartialBytes
Response-body bytes forwarded before a PartialResponse truncates or a ConnectionDrop aborts. Default 1024.
[JsonPropertyName("partialBytes")]
public int PartialBytes { get; init; }
Property Value
Rate
Probability the Kind fires per matched request (0..1, default 1). The latency shape applies on every match regardless — latency models a slow dependency, the rate models an intermittent failure.
[JsonPropertyName("rate")]
public double Rate { get; init; }
Property Value
Methods
Describe()
One-line description for the audit trail ("error 503 @ rate 0.25 + uniform 100-500ms").
public string Describe()
Returns
MatchesMethod(string?, string?)
Case-insensitive glob match against service/method.
public bool MatchesMethod(string? service, string? method)