mattersight / pact-net-messages Goto Github PK
View Code? Open in Web Editor NEWPact.Net v3 implementation of message only for services that communicate via event streams and message queues
License: MIT License
Pact.Net v3 implementation of message only for services that communicate via event streams and message queues
License: MIT License
I wrote a test to generate a consumer Pact file. Unfortunately the "matchingRules" are missing and I have no idea how to integrate them? Could someone give me a hint?
Here an example of what I miss:
...
"messages": {
"description": "ThingUpdatedEvent",
"metaData": {
"type": "ThinkUpdated"
},
"contents": {
"id": "some id",
"updatedAt": "20190114T12111869Z",
},
"providerStates": [
{
"name": "a thing was updated"
}
],
"matchingRules": {
"body": {
"$.id": {
"matchers": [
{
"match": "type"
}
],
"combine": "AND"
},
"$.updatedAt": {
"matchers": [
{
"match": "regex",
"regex": "\\d{8}T\\d{6,9}Z"
}
],
"combine": "AND"
}
}
}
...
is there any chance we have PactnetMessage to support PactNet 2 so we can utilise its features such as publishing provider verification result, can-i-deploy, ...
Currently the following pact-specification-version-format is used:
"pactSpecificationVersion": "3.0.0"
According to this thread "pact-foundation/pact-jvm#917", the following format should be used by all Pact libraries:
"pactSpecification": { "version": "3.0.0" }
Is it possible to support the right format?
Background info:
We are currently in the situation that we have a consumer in .NET and a provider in Java which is using the "pact-jvm" library. The provider is not accepting the consumer pact because it uses the wrong "pact-specification-version-format". And according to the linked thread there seems to be an agreement to support only the above format.
The pact format generated by pact-net-message library looks like below. The matcher format generated is not recognized as matcher by the verfiication and keeps giving me error as Path $.Property1.json_class, expected: Pact::Term, actual:
{
"provider": {
"name": "test-provider-amqp"
},
"consumer": {
"name": "test-consumer-amqp"
},
"messages": [
{
"description": "Verify the payload contract is satisfied",
"providerState": "Pay load",
"contents": {
"EventName": "test.message",
"Property1": {
"json_class": "Pact::Term",
"data": {
"generate": "83F9262F-28F1-4703-AB1A-8CFD9E8249C9",
"matcher": {
"json_class": "Regexp",
"o": 0,
"s": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
}
}
}
},
"metaData": {
"routingKey": "test.message"
}
}
],
"metadata": {
"pactSpecificationVersion": "3.0"
}
}
Here's the pact generation code:
var guidRegex = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}";
var eventName = "test.message";
var guid = "83F9262F-28F1-4703-AB1A-8CFD9E8249C9";
dynamic eventData = new
{
EventName = eventName,
Property1 = Match.Regex(guid, guidRegex)
};
amqpProvider.PactMessageBuilder.MockMq().Given("Pay load")
.UponReceiving("Verify the payload contract is satisfied")
.WithMetaData(new { routingKey = "test.message" })
.WithContent(eventData);
it is stated that
Pact Broker does not handle v3 specifications yet
What exactly is the problem?
How to track the status of it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.