1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Copyright (c) 2026, Salesforce, Inc.,
// All rights reserved.
// For full license text, see the LICENSE.txt file
//! # pdk-unit
//!
//! A unit testing framework for PDK (Policy Development Kit) policies that enables testing
//! Flex Gateway policies without requiring a running Envoy proxy or WebAssembly runtime.
//!
//! ## Overview
//!
//! `pdk-unit` provides a complete in-process testing solution for PDK policies by stubbing
//! the Proxy-Wasm host environment. This allows developers to write fast, deterministic
//! unit tests that verify policy behavior without the overhead of integration testing.
//!
//! ## Quick Start
//!
//! ```ignore
//! use pdk_unit::{UnitHttpRequest, UnitHttpResponse, UnitHttpMessage, UnitTestBuilder};
//!
//! #[test]
//! fn test_my_policy() {
//! let mut tester = UnitTestBuilder::default()
//! .with_config(r#"{"key": "value"}"#)
//! .with_entrypoint(crate::configure);
//!
//! let request = UnitHttpRequest::get()
//! .with_header(":path", "/api/test");
//!
//! let response = tester.request(request);
//!
//! assert_eq!(response.status_code(), 200);
//! }
//! ```
//!
//! ## Core Components
//!
//! - [`UnitTestBuilder`] - Fluent builder for configuring test instances
//! - [`UnitTest`] - Main test orchestrator managing request lifecycles
//! - [`UnitTestRequest`] - Handle to an in-flight request being processed
//! - [`UnitHttpRequest`] - HTTP request with method constructors (e.g. [`UnitHttpRequest::get`])
//! - [`UnitHttpResponse`] - HTTP response with a [`status_code`](UnitHttpResponse::status_code) accessor
//! - [`UnitHttpMessage`] - Trait providing common read accessors for both request and response
//!
//! ## Backends
//!
//! Mock upstream services using the [`Backend`] and [`GrpcBackend`] traits:
//!
//! - [`TraceBackend`] - Records all incoming requests for later inspection; also acts as a configurable response backend
//! - [`protobuf_grpc_backend`] - Macro for creating gRPC backends from protobuf definitions
//!
//! ## Features
//!
//! - `enable_stop_iteration` - Enables [`StopIterationMode`] for handling paused requests
pub use crateUnitTestBuilder;
pub use crate;
pub use crate;
pub use ;
pub use dw2pel;
pub use protobuf_grpc_backend;