James Fraser
03/07/2023, 1:50 PMMessagePactBuilder
or ConsumerPactBuilder
is there any way to apply matching rules to them afterwards so this basic type match is added to the contract?
"matchingRules": {
"$.body": {
"match": "type"
}
},
James Fraser
03/07/2023, 1:51 PMJSONObject jsonObject = loadJsonFromFile( stubFile );
ConsumerPactBuilder.consumer( "consumer" )
.hasPactWith( "provider" )
.uponReceiving( "aRequest" )
.path( "/" )
.body( "{}" )
.willRespondWith()
.body( jsonObject )
.toPact();
new MessagePactBuilder()
.expectsToReceive( "aMessage" )
.withContent( jsonObject )
.toPact();
uglyog
James Fraser
03/08/2023, 8:51 AM