Path: redb-route/tests/redb.Route.Tests.Cache/CacheProducerReplyTests.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/redb.Route.Tests.Cache/CacheProducerReplyTests.cs ---- using redb.Route.Cache; using redb.Route.Core; namespace redb.Route.Tests.Cache; /// The cache: component reading an entry the scope stored as a reply (Out). public class CacheProducerReplyTests { [Fact] public async Task Get_RestoresAReplyWhereTheScopeLeftIt_InOut() { await using var ctx = new RouteContext(); ctx.UseCache(); ctx.AddRoutes(b => { b.From("direct://reply-scope").Cache("k").Region("replies").Process(e => e.Out = new Message("reply")).EndCache(); b.From("direct://reply-get").To("cache:replies?action=get&key=k"); }); await ctx.Start(); using var template = new ProducerTemplate(ctx); template.Start(); var miss = Exchange.Create(new Message("in"), null); await template.SendAsync("direct://reply-scope", miss); var read = Exchange.Create(new Message("in"), null); await template.SendAsync("direct://reply-get", read); read.In.Headers["cache.hit"].Should().Be(true); read.Out.Should().NotBeNull("the scope cached a reply; the component must hand it back as a reply, not as the request body"); read.Out!.Body.Should().Be("reply"); read.In.Body.Should().Be("in"); } }