Class AdviceWithBuilder

Assembly: redb.Route.TestKit.dll

Rewrites one route definition before the context starts (Apache Camel AdviceWith):
swap the consumer, send matching To steps to mocks, or weave steps in, out and around
existing ones. The route under test is not modified for testability — the advice is.
Obtained through .

public sealed class AdviceWithBuilder

Inheritance

Object→AdviceWithBuilder

Properties

RouteId

The route id being advised (explicit RouteId or the endpoint-derived fallback).

public string RouteId { get; }

Methods

MockEndpoints(params string[])

Sends every static To whose URI matches one of uriMasks to the mock

public AdviceWithBuilder MockEndpoints(params string[] uriMasks)

MockEndpointsAndSkip(params string[])

Same as ; the Camel name for "mock and do not call the original", kept for recognisability.

public AdviceWithBuilder MockEndpointsAndSkip(params string[] uriMasks)

ReplaceFrom(string)

Replaces the route's From endpoint (Camel replaceFromWith): kafka://orders becomes direct://test-in.

public AdviceWithBuilder ReplaceFrom(string uri)

WeaveAddFirst(Action<IRouteDefinition>)

Adds the steps built by steps at the very beginning of the route.

public AdviceWithBuilder WeaveAddFirst(Action<IRouteDefinition> steps)

WeaveAddLast(Action<IRouteDefinition>)

Adds the steps built by steps at the very end of the route.

public AdviceWithBuilder WeaveAddLast(Action<IRouteDefinition> steps)

WeaveById(string)

Selects the steps named id via the Id("...") DSL verb.

public WeaveTarget WeaveById(string id)

WeaveByToUri(string)

Selects the static To steps whose URI matches uriMask.

public WeaveTarget WeaveByToUri(string uriMask)

WeaveByType<T>()

Selects every step of definition type T (e.g. ThrottleDefinition).

public WeaveTarget WeaveByType<T>() where T : IProcessorDefinition