Skip to content

Commit 80b7bb5

Browse files
committed
fix(pact_verifier): Provider state values should be passed to any plugins under a providerState key
1 parent 8387b9e commit 80b7bb5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

rust/pact_verifier/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use pact_models::v4::interaction::V4Interaction;
3838
#[cfg(feature = "plugins")] use pact_plugin_driver::verification::{InteractionVerificationData, InteractionVerificationDetails};
3939
use regex::Regex;
4040
use reqwest::Client;
41-
use serde_json::Value;
41+
use serde_json::{Map, Value};
4242
#[cfg(feature = "plugins")] use serde_json::json;
4343
use tracing::{debug, debug_span, error, info, Instrument, instrument, trace, warn};
4444

@@ -518,9 +518,11 @@ async fn verify_interaction_using_transport<'a, F: RequestFilterExecutor>(
518518
context.insert("port".to_string(), json!(port));
519519
}
520520

521+
let mut psc = Map::new();
521522
for (k, v) in config {
522-
context.insert(k.to_string(), v.clone());
523+
psc.insert(k.to_string(), v.clone());
523524
}
525+
context.insert("providerState".to_string(), Value::Object(psc));
524526

525527
// Get plugin to prepare the request data
526528
let v4_interaction = interaction.as_v4().unwrap();

0 commit comments

Comments
 (0)