Class GrpcWire

Namespace
Kuestenlogik.Bowire.Mocking
Assembly
Kuestenlogik.Bowire.dll

Whether a recorded step is gRPC on the wire — and so replays through the mock's gRPC path and needs its HTTP/2 listener — decided by what the step carries, not by the label its plugin gave it.

public static class GrpcWire
Inheritance
GrpcWire
Inherited Members

Remarks

A protocol plugin built on gRPC records its steps under its own id: TacticalAPI's say protocol: "tacticalapi". Since the host consumes IBowireStreamingWithWireBytes for every plugin that implements it, those steps carry responseBinary on the unary response and on every streamed frame — the same bytes a step labelled grpc carries, and everything the gRPC replayer needs. Until the mock read the bytes rather than the label, such a recording replayed nothing: the host recorded 1:1 and the mock answered 501.

The label grpc still counts on its own, so a gRPC step recorded before wire bytes were captured keeps reaching the replayer and its "re-record with a current Bowire" answer.

Methods

IsGrpcStep(BowireRecordingStep)

The step's wire is gRPC: labelled so, or carrying gRPC wire bytes and no HTTP routing.

public static bool IsGrpcStep(BowireRecordingStep step)

Parameters

step BowireRecordingStep

Returns

bool

MatchesPath(BowireRecordingStep, string)

Does the wire path /{package.Service}/{Method} name this step? A step whose plugin recorded the fully-qualified service matches on the whole path. A plugin that discovers its services by simple name — TacticalAPI's Situation for rheinmetall.tactical_api.v0.Situation — records that name, and matches on the last segment of the wire service.

public static bool MatchesPath(BowireRecordingStep step, string path)

Parameters

step BowireRecordingStep
path string

Returns

bool