From 4aa34cce204584ff713b3c9ea68d0b689677a20f Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Thu, 17 Sep 2020 11:04:30 +1000 Subject: [PATCH] chore: update seed --- script/seed.rb | 56 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/script/seed.rb b/script/seed.rb index 6ad1fd139..afc277af6 100755 --- a/script/seed.rb +++ b/script/seed.rb @@ -46,24 +46,46 @@ PactBroker.configuration.base_equality_only_on_content_that_affects_verification_results = false - # .create_global_webhook( - # method: 'POST', - # url: "http://localhost:9292/pact-changed-webhook", - # body: webhook_body.to_json, - # username: "foo", - # password: "bar") -TestDataBuilder.new - .create_global_verification_succeeded_webhook( - method: 'POST', - url: "http://localhost:9292/verification-published-webhook", - body: webhook_body.to_json) - .set_now(Date.today - 101) - .create_pact_with_hierarchy("Foo/Foo", "100", "Bar/Bar") - .create_pact_with_hierarchy("Foo", "1", "Bar") - .create_pact_with_hierarchy("", "", "Bar/Bar") - .create_consumer_version_tag("prod") - .create_verification(provider_version: "1", tag_names: "prod") +json_content = <<-HEREDOC +{ + "consumer": { + "name": "Foo" + }, + "provider": { + "name": "Bar" + }, + "interactions": [ + { + "description": "a retrieve thing request", + "request": { + "method": "get", + "path": "/thing" + }, + "response": { + "status": 200, + "headers": { + "Content-Type": "application/json" + }, + "body": { + "name": "Thing 1" + } + } + } + ], + "metadata": { + "pactSpecification": { + "version": "2.0.0" + } + } +} +HEREDOC +TestDataBuilder.new + .create_pact_with_hierarchy("Foo", "1", "Bar", json_content) + .create_consumer_version_tag("master") + .create_verification(provider_version: "1", tag_name: "master") + .create_pact_with_hierarchy("Foo", "2", "Bar", json_content.gsub("200", "201")) + .create_consumer_version_tag("feat/x") # .create_certificate(path: 'spec/fixtures/certificates/self-signed.badssl.com.pem') # .create_consumer("Bethtest")