Skip to content

Commit

Permalink
fix: Pass the transport config to the plugin in the test context unde…
Browse files Browse the repository at this point in the history
…r the transport_config key
  • Loading branch information
rholshausen committed Dec 12, 2024
1 parent 3227729 commit 85eb7eb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pact_mock_server/src/server_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use pact_models::pact::Pact;
#[cfg(feature = "plugins")] use pact_plugin_driver::mock_server::MockServerDetails;
#[cfg(feature = "tls")] use rustls::ServerConfig;
#[cfg(not(feature = "plugins"))] use serde::{Deserialize, Serialize};
use serde_json::Value;
use tracing::{debug, error, trace};
#[cfg(feature = "plugins")] use url::Url;

Expand Down Expand Up @@ -210,10 +211,15 @@ impl ServerManager {
port: addr.port() as u32,
tls: false
};
let test_context = hashmap! {};
let test_context = hashmap! {
"transport_config".to_string() => Value::Object(config.transport_config
.iter()
.map(|(k, v)| (k.clone(), v.clone()))
.collect())
};
let result = self.runtime.block_on(
pact_plugin_driver::plugin_manager::start_mock_server_v2(transport, v4_pact.boxed(),
mock_server_config, test_context)
mock_server_config, test_context)
)?;
self.mock_servers.insert(
id,
Expand Down

0 comments on commit 85eb7eb

Please sign in to comment.