GitHub
02/12/2023, 3:17 PMWithProviderStateUrl
method of the IPactVerifierSource
interface and pass it to the SetProviderState
of the IVerifierProvider
in the corresponding implementation?
pact-foundation/pact-netGitHub
02/12/2023, 3:18 PMMatt (pactflow.io / pact-js / pact-go)
Cyrus Devnomad
02/14/2023, 9:59 AMDavid Hvilava
02/14/2023, 2:45 PM"interactions": [
{
"description": "A GET request with custom headers",
"request": {
"method": "GET",
"path": "/api/provider",
"headers": {
"Content-Type": "application/json",
"TestHeaderKey": "TestHeaderValue"
}
},
...
But my Provider receives them in lowercase. Is is possible to somehow make it case preserving?Arika Goyal
02/14/2023, 9:13 PMPactNet.Exceptions.PactFailureException: Pact verification failed
PactNet.Exceptions.PactFailureException
Pact verification failed
at PactNet.Verifier.InteropVerifierProvider.Execute()
at PactNet.Verifier.PactVerifierSource.Verify()
at tests.ProductApiTestsWithoutBroker.EnsureProviderApiHonoursPactWithConsumer() in C:\repos\ProofOfConcepts\Pact-Product-api\ProviderTests\ProductApiTestsWithoutBroker.cs:line 47
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
Getting to pact verification
Starting verification...
Pact verification failed
Verifier Output
---------------
Verifying a pact between ApiClient and ProductService
A valid request for all products
returns a response which
has status code 200 (FAILED)
includes headers
"Content-Type" with value "application/json; charset=utf-8" (FAILED)
has a matching body (FAILED)
Failures:
1) Verifying a pact between ApiClient and ProductService - A valid request for all products
1.1) has a matching body
expected 'application/json;charset=utf-8' body but was 'text/html'
1.2) has status code 200
expected 200 but was 400
1.3) includes header 'Content-Type' with value 'application/json; charset=utf-8'
Expected header 'Content-Type' to have value 'application/json; charset=utf-8' but was 'text/html'
There were 1 pact failures
Verifier Logs
-------------
2023-02-14T20:36:14.433512Z INFO ThreadId(33) pact_verifier: Running provider verification for 'A valid request for all products'
2023-02-14T20:36:14.433752Z INFO ThreadId(33) pact_verifier::provider_client: Sending request to provider at <http://localhost:9001/>
2023-02-14T20:36:14.433771Z INFO ThreadId(33) pact_verifier::provider_client: Sending request HTTP Request ( method: GET, path: /api/products, query: None, headers: None, body: Missing )
2023-02-14T20:36:14.456312Z INFO ThreadId(33) pact_verifier::provider_client: Received response: HTTP Response ( status: 400, headers: Some({"cache-control": ["no-store"], "via": ["1.1 ForcepointCGCluster"], "date": ["Tue", "14 Feb 2023 20:36:32 GMT"], "content-type": ["text/html"], "connection": ["close"], "content-language": ["en"], "content-length": ["666"]}), body: Present(666 bytes, text/html) )
2023-02-14T20:36:14.456421Z INFO ThreadId(33) pact_matching: comparing to expected response: HTTP Response ( status: 200, headers: Some({"Content-Type": ["application/json; charset=utf-8"]}), body: Present(130 bytes) )
2023-02-14T20:36:14.457552Z WARN ThreadId(33) pact_matching::metrics:
Please note:
We are tracking events anonymously to gather important usage statistics like Pact version and operating system. To disable tracking, set the 'PACT_DO_NOT_TRACK' environment variable to 'true'.
2023-02-14T20:36:14.495312Z WARN ThreadId(33) rustls::conn: Sending fatal alert DecodeError
P.S - I am using .NET 7 and i tried including PactNet.Windows nuget package but it did not help. Any pointers would be very helpful here. Thanks.Carlos López Sánchez
02/14/2023, 9:16 PMTomer Ghelber
02/15/2023, 12:45 PMGitHub
02/27/2023, 2:51 AM<https://github.com/pact-foundation/pact-net/tree/master|master>
by mefellows
<https://github.com/pact-foundation/pact-net/commit/e7de8d4e7a2f0883644ea8d86a79e927a339603a|e7de8d4e>
- chore: add smartbear supported jira integration
pact-foundation/pact-netGitHub
03/02/2023, 12:03 PMGitHub
03/02/2023, 12:03 PMCyrus Devnomad
03/07/2023, 10:31 AMFacu Conejero
03/08/2023, 9:31 AMJacob Waller
03/09/2023, 5:41 PMGitHub
03/11/2023, 12:06 AMOndřej Hájek
03/13/2023, 4:14 PMSantiago Rendón
03/15/2023, 11:30 PMRequest Failed - One or more of the setup state change handlers has failed
It only fails in the CI or the first time the test is run locally, but consequent calls to dotnet test
do not fail... I can't currently share a minimal reproduction, but may try to recreate it this week. Hopefully this weird behavior of only failing the first time gives enough info to someone that can put me in the right track to investigate the issue.
Thanks in advanceCyrus Devnomad
03/16/2023, 3:39 PMKripa Kurian
03/16/2023, 7:31 PMJacob Waller
03/20/2023, 9:26 PMGitHub
03/22/2023, 10:56 AMYousaf Nabi (pactflow.io)
Ulises Cervino
03/22/2023, 9:01 PMGitHub
03/23/2023, 10:50 PMPallavi Anirban Bose
03/27/2023, 6:03 AMRyan Child
03/27/2023, 6:56 PMPallavi Anirban Bose
03/28/2023, 10:40 AMGitHub
03/30/2023, 9:34 PMBo Damgaard Mortensen
04/04/2023, 3:56 PMpublic class ConsumerClass
{
public string MyProperty { get; init; }
}
public class ProviderClass
{
public string? MyProperty { get; init; }
}
and in my consumer test, I've set the following: .WithJsonBody(Match.Type(new ConsumerClass { MyProperty = "test" }));
(since I don't want to validate the actual values)
I'd expect the provider test to fail this, since I have marked MyProperty
to be a nullable property.Victor Lau
04/05/2023, 5:05 PM