Skip to main content

camel_integration_test/
lib.rs

1//! Integration-tier test support for rust-camel (ADR-0069).
2//!
3//! This crate owns the scenario model: the parsing of `.test.yaml`
4//! documents that declare a `scenario:` section, the ordered action
5//! vocabulary (`send`, `receive`, `sleep`, `validate`), endpoint
6//! references with partner provisioning, and the document-level rules
7//! that keep the scenario vocabulary separate from the unit-tier
8//! vocabulary (`inputs`, `expects`, `intercepts`).
9//!
10//! The tier derivation, the layered environment source, the action
11//! runner, and the partner adapters are built on the model types
12//! defined here.
13//!
14//! The system under test is always an embedded boot. The harness never
15//! drives a deployed `camel run` process.
16
17pub mod adapters;
18pub mod boot_scenario;
19pub mod document;
20pub mod env_layers;
21/// Inbound listener provisioning (feature `http`, rc-5yon): binds
22/// `127.0.0.1:0` and stages the listener on the HTTP component's
23/// global registry (ADR-0070) before the scenario boot, so the route
24/// consumer consumes the staged socket.
25#[cfg(feature = "http")]
26pub mod inbound;
27pub mod runner;
28pub mod tier;
29
30/// Partner-script grammar of the scenario document's `partners:` map;
31/// its public types are re-exported through [`crate::document`].
32mod partner_script;
33
34#[cfg(feature = "http")]
35pub use adapters::http::{HttpPartner, HttpRecorder, HttpWireRequest, ScriptedResponse};
36pub use adapters::{
37    DirectStimulus, FakeAdapter, FakeRecorder, IncomingMessage, OutgoingMessage, PartnerAdapter,
38    PartnerRouter, ReceiveError, ReceiveTimeout, RecordedSend, TransportError,
39};
40pub use boot_scenario::{ScenarioRun, boot_scenario};
41pub use camel_matchers::RequestExpectation as PartnerExpectation;
42pub use camel_matchers::{CountBound, Expectation, PathFilter};
43#[cfg(feature = "http")]
44pub use document::partner_scripts_for;
45pub use document::{
46    DocError, EndpointRef, InboundListener, PartnerFault, PartnerScript, PartnerScriptResponse,
47    Provisioning, RouteSource, ScenarioAction, ScenarioDocument, ScenarioTarget,
48    ValidateExpectation, parse_scenario_document,
49};
50pub use env_layers::{AmbientLookup, LayeredEnv, ambient_std};
51#[cfg(feature = "http")]
52pub use inbound::provision_inbound;
53pub use runner::{
54    DocumentOutcome, ScenarioFailure, ScenarioVars, ScenarioVerdict, run_scenario,
55    run_scenario_document,
56};
57pub use tier::{DocumentInputs, Tier, derive_tier};
58
59/// Scenario document parser contract tests (the six named tests from
60/// the task brief plus the validate and regex-gate tests).
61#[cfg(test)]
62mod doc_parse_test;
63
64/// Layered environment tests (the three named tests from task 2.3).
65#[cfg(test)]
66mod env_layers_test;
67
68/// Scenario action runner tests (the four named tests from task 2.4).
69#[cfg(test)]
70mod runner_test;
71
72/// boot_scenario delegation tests (the six named tests from task 3.1,
73/// scenario-shared-boot).
74#[cfg(test)]
75mod boot_scenario_test;
76
77/// Partner router address-math tests (the pure wire_target /
78/// lane_key_for cases).
79#[cfg(test)]
80mod adapters_test;
81
82/// HTTP partner adapter tests (the named tests from task 3.1).
83#[cfg(all(test, feature = "http"))]
84mod http_partner_test;