diff --git a/rust/pact_verifier/src/lib.rs b/rust/pact_verifier/src/lib.rs index 2465e43fd..993e4cfcc 100644 --- a/rust/pact_verifier/src/lib.rs +++ b/rust/pact_verifier/src/lib.rs @@ -1097,8 +1097,9 @@ pub async fn verify_provider_async = VerificationOptions::default(); + let provider_state_executor = Arc::new(DummyProviderStateExecutor{}); + let publish_options = PublishOptions { + provider_version: Some("1.2.3".to_string()), + build_url: None, + provider_tags: vec![], + provider_branch: None, + }; + + let result = verify_provider_async( + provider_info, + vec![ pact_source ], + FilterInfo::None, + vec![ "Consumer".to_string() ], + &verification_options, + Some(&publish_options), + &provider_state_executor, + None + ).await; + + let verification_result = result.unwrap(); + expect!(verification_result.result).to(be_false()); + let error = &verification_result.errors[0].1; + let error_json: Value = error.into(); + let message = error_json.as_object().unwrap().get("message").unwrap(); + let message_str = message.to_string(); + expect!(message_str.contains("consumerVersionSelectors: cannot specify the fields branch/latest with the field deployedOrReleased (at index 0)")).to(be_true()); +}