Class FlowExpectation
- Namespace
- Kuestenlogik.Bowire.Flows.Expectations
- Assembly
- Kuestenlogik.Bowire.Flows.dll
Declarative assertion attached to a Flow step. Each expectation pairs a
Kind (what to look at), an Operator (how to
compare), an optional Target selector (header name, JSON
path, …), and an Expected right-hand-side value. Lives as
a public type so the v2.2 CI runner (T2: bowire test <flow>)
can deserialise the same shape the workbench writes.
public sealed class FlowExpectation
- Inheritance
-
FlowExpectation
- Inherited Members
Remarks
Wire shape — exactly what the workbench persists and what the CLI reads:
{ "id":"exp_…", "kind":"body-path", "operator":"equals",
"target":"$.user.id", "expected":"42" }
The legacy {path, op, value} tuple the in-browser runner used
before v2.2 round-trips through this type via
FromLegacyTuple(string?, string?, string?); T2 can therefore consume a mixed flow file
without a migration pass.
Constructors
FlowExpectation()
public FlowExpectation()
Properties
Expected
Right-hand-side value. Stored as a string because the wire shape is string-typed; the evaluator coerces to numbers / booleans / regex as the chosen Operator demands. Null for Exists / NotExists.
public string? Expected { get; set; }
Property Value
Id
Stable id assigned when the workbench creates the row; T2 echoes it back into JUnit so individual rows are addressable.
public string? Id { get; set; }
Property Value
Kind
What part of the request envelope to look at.
public FlowExpectationKind Kind { get; set; }
Property Value
Operator
How to compare actual against Expected.
public FlowExpectationOperator Operator { get; set; }
Property Value
Target
Selector inside the kind: header name for Header, JSON path for BodyPath, ignored for Status / Latency / BodyText.
public string? Target { get; set; }
Property Value
Methods
FromLegacyTuple(string?, string?, string?)
Bridge from the v2.1 in-browser tuple. path
maps onto Kind+Target heuristically:
status → Status,
durationMs → Latency,
everything else lands on BodyPath.
Used by the workbench's storage migration so existing saved flows
keep validating after the v2.2 upgrade.
public static FlowExpectation FromLegacyTuple(string? path, string? op, string? value)