pub fn init_middleware_with_enrolled_resources<M>(
node_id: String,
max_retries: Option<u32>,
consent_timeout: u64,
m2m_client: M,
enable_resource_validation: bool,
_process_count: u32,
_per_process_file_count: u32,
_per_process_stream_count: u32,
) -> (M2mApiDefaultStack, P2mApiDefaultStack<M>, O2mApiDefaultStack)where
M: Service<M2mRequest, Response = M2mResponse, Error = TraceabilityError> + Clone + Send + 'static,
M::Future: Send,
Expand description
Initialize a middleware stack with pre-enrolled resources for testing.
Creates a middleware stack identical to init_middleware()
but with
pre-enrolled mock resources. This is useful for testing, benchmarking,
and simulation scenarios where actual process interactions are not needed.
§Arguments
node_id
- Unique identifier for this middleware nodemax_retries
- Maximum retry attempts for the waiting queuem2m_client
- Client service for M2M communicationenable_resource_validation
- Whether to enable resource validation for P2M requestsprocess_count
- Number of mock processes to pre-enrollper_process_file_count
- Number of files to enroll per processper_process_stream_count
- Number of streams to enroll per process
§Returns
A tuple containing (M2M service, P2M service, O2M service) with pre-enrolled resources
§Warning
Should only be used for testing purposes. Production deployments should use
init_middleware()
and rely on actual process enrollment.