pact_broker 1.18.0 → 2.0.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -9
  3. data/DEVELOPER_DOCUMENTATION.md +53 -0
  4. data/README.md +13 -13
  5. data/db/migrations/23_create_pact_contents_table.rb +19 -0
  6. data/db/migrations/24_populate_pact_contents.rb +9 -0
  7. data/db/migrations/25_populate_pact_contents_pacticipants.rb +7 -0
  8. data/db/migrations/26_make_pc_pacticipants_mandatory.rb +8 -0
  9. data/db/migrations/27_create_pact_publications.rb +18 -0
  10. data/db/migrations/28_populate_pact_publications.rb +13 -0
  11. data/db/migrations/29_recreate_all_pacts.rb +16 -0
  12. data/db/migrations/30_drop_pacts.rb +8 -0
  13. data/db/migrations/31_drop_pact_version_contents.rb +5 -0
  14. data/db/migrations/32_rename_pact_contents.rb +5 -0
  15. data/db/migrations/33_recreate_all_pacts.rb +52 -0
  16. data/db/migrations/34_recreate_latest_tagged_pacts.rb +23 -0
  17. data/db/migrations/35_create_verifications.rb +15 -0
  18. data/db/migrations/36_create_latest_verifications.rb +14 -0
  19. data/db/pact_broker_database.sqlite3 +0 -0
  20. data/lib/pact_broker/api.rb +25 -10
  21. data/lib/pact_broker/api/contracts/verification_contract.rb +41 -0
  22. data/lib/pact_broker/api/decorators/pact_decorator.rb +7 -0
  23. data/lib/pact_broker/api/decorators/pact_version_decorator.rb +0 -1
  24. data/lib/pact_broker/api/decorators/representable_pact.rb +4 -3
  25. data/lib/pact_broker/api/decorators/timestamps.rb +1 -1
  26. data/lib/pact_broker/api/decorators/verification_decorator.rb +30 -0
  27. data/lib/pact_broker/api/decorators/verifications_decorator.rb +21 -0
  28. data/lib/pact_broker/api/decorators/version_decorator.rb +14 -0
  29. data/lib/pact_broker/api/decorators/versions_decorator.rb +1 -1
  30. data/lib/pact_broker/api/pact_broker_urls.rb +41 -2
  31. data/lib/pact_broker/api/renderers/html_pact_renderer.rb +1 -1
  32. data/lib/pact_broker/api/resources/base_resource.rb +11 -2
  33. data/lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb +39 -0
  34. data/lib/pact_broker/api/resources/pacticipants.rb +1 -1
  35. data/lib/pact_broker/api/resources/previous_distinct_pact_version.rb +1 -1
  36. data/lib/pact_broker/api/resources/verifications.rb +67 -0
  37. data/lib/pact_broker/api/resources/versions.rb +1 -1
  38. data/lib/pact_broker/api/resources/webhooks.rb +1 -1
  39. data/lib/pact_broker/app.rb +0 -2
  40. data/lib/pact_broker/configuration.rb +1 -4
  41. data/lib/pact_broker/doc/views/latest-verifications.markdown +7 -0
  42. data/lib/pact_broker/doc/views/publish-verification.markdown +14 -0
  43. data/lib/pact_broker/domain.rb +1 -1
  44. data/lib/pact_broker/domain/order_versions.rb +5 -15
  45. data/lib/pact_broker/domain/pact.rb +10 -2
  46. data/lib/pact_broker/domain/relationship.rb +31 -4
  47. data/lib/pact_broker/domain/verification.rb +77 -0
  48. data/lib/pact_broker/domain/version.rb +6 -1
  49. data/lib/pact_broker/domain/webhook.rb +1 -0
  50. data/lib/pact_broker/domain/webhook_request.rb +4 -6
  51. data/lib/pact_broker/locale/en.yml +2 -1
  52. data/lib/pact_broker/logging.rb +0 -4
  53. data/lib/pact_broker/pacticipants/repository.rb +1 -2
  54. data/lib/pact_broker/pacticipants/service.rb +11 -5
  55. data/lib/pact_broker/pacts/all_pact_publications.rb +96 -0
  56. data/lib/pact_broker/pacts/all_pacts.rb +4 -89
  57. data/lib/pact_broker/pacts/diff.rb +2 -2
  58. data/lib/pact_broker/pacts/latest_pact_publications.rb +11 -0
  59. data/lib/pact_broker/pacts/latest_pact_publications_by_consumer_version.rb +11 -0
  60. data/lib/pact_broker/pacts/latest_pacts.rb +1 -0
  61. data/lib/pact_broker/pacts/latest_tagged_pact_publications.rb +11 -0
  62. data/lib/pact_broker/pacts/pact_params.rb +11 -1
  63. data/lib/pact_broker/pacts/pact_publication.rb +50 -0
  64. data/lib/pact_broker/pacts/pact_version.rb +39 -0
  65. data/lib/pact_broker/pacts/repository.rb +46 -36
  66. data/lib/pact_broker/pacts/service.rb +2 -2
  67. data/lib/pact_broker/repositories.rb +5 -0
  68. data/lib/pact_broker/services.rb +5 -0
  69. data/lib/pact_broker/ui/view_models/relationship.rb +38 -0
  70. data/lib/pact_broker/ui/views/relationships/show.haml +9 -0
  71. data/lib/pact_broker/verifications/repository.rb +45 -0
  72. data/lib/pact_broker/verifications/service.rb +40 -0
  73. data/lib/pact_broker/version.rb +1 -1
  74. data/lib/pact_broker/versions/parse_semantic_version.rb +9 -6
  75. data/lib/pact_broker/webhooks/service.rb +8 -9
  76. data/lib/pact_broker/webhooks/webhook.rb +1 -1
  77. data/pact_broker.gemspec +3 -4
  78. data/pact_broker_client-pact_broker.json +4 -4
  79. data/script/publish.sh +2 -2
  80. data/script/record_verification.sh +3 -0
  81. data/spec/features/delete_pact_spec.rb +1 -1
  82. data/spec/features/get_verifications_for_consumer_version_spec.rb +33 -0
  83. data/spec/features/publish_verification_spec.rb +28 -0
  84. data/spec/fixtures/a_consumer-a_provider-2.json +1 -1
  85. data/spec/fixtures/a_consumer-a_provider-3.json +1 -1
  86. data/spec/fixtures/a_consumer-a_provider-conflict.json +1 -1
  87. data/spec/fixtures/a_consumer-a_provider-merged.json +2 -2
  88. data/spec/fixtures/a_consumer-a_provider.json +1 -1
  89. data/spec/fixtures/consumer-provider.json +1 -1
  90. data/spec/fixtures/renderer_pact.json +1 -1
  91. data/spec/fixtures/verification.json +4 -0
  92. data/spec/lib/pact_broker/api/contracts/verification_contract_spec.rb +91 -0
  93. data/spec/lib/pact_broker/api/decorators/latest_pact_decorator_spec.rb +0 -18
  94. data/spec/lib/pact_broker/api/decorators/pact_decorator_spec.rb +6 -2
  95. data/spec/lib/pact_broker/api/decorators/pact_version_decorator_spec.rb +0 -3
  96. data/spec/lib/pact_broker/api/decorators/verification_decorator_spec.rb +61 -0
  97. data/spec/lib/pact_broker/api/decorators/verifications_decorator_spec.rb +42 -0
  98. data/spec/lib/pact_broker/api/decorators/version_decorator_spec.rb +4 -0
  99. data/spec/lib/pact_broker/api/renderers/html_pact_renderer_spec.rb +1 -1
  100. data/spec/lib/pact_broker/api/resources/latest_verifications_for_consumer_version_spec.rb +68 -0
  101. data/spec/lib/pact_broker/api/resources/pact_spec.rb +1 -1
  102. data/spec/lib/pact_broker/api/resources/pacticipants_spec.rb +1 -1
  103. data/spec/lib/pact_broker/api/resources/verifications_spec.rb +92 -0
  104. data/spec/lib/pact_broker/api/resources/webhooks_spec.rb +1 -1
  105. data/spec/lib/pact_broker/domain/order_versions_spec.rb +10 -30
  106. data/spec/lib/pact_broker/domain/verification_spec.rb +41 -0
  107. data/spec/lib/pact_broker/domain/version_spec.rb +26 -0
  108. data/spec/lib/pact_broker/domain/webhook_request_spec.rb +1 -3
  109. data/spec/lib/pact_broker/pacticipants/repository_spec.rb +0 -16
  110. data/spec/lib/pact_broker/pacticipants/service_spec.rb +4 -3
  111. data/spec/lib/pact_broker/pacts/pact_params_spec.rb +14 -1
  112. data/spec/lib/pact_broker/pacts/pact_version_spec.rb +50 -0
  113. data/spec/lib/pact_broker/pacts/repository_spec.rb +85 -36
  114. data/spec/lib/pact_broker/ui/view_models/relationship_spec.rb +48 -2
  115. data/spec/lib/pact_broker/verifications/repository_spec.rb +92 -0
  116. data/spec/lib/pact_broker/verifications/service_spec.rb +61 -0
  117. data/spec/lib/pact_broker/versions/parse_semantic_version_spec.rb +39 -0
  118. data/spec/lib/pact_broker/webhooks/service_spec.rb +3 -40
  119. data/spec/migrations/23_pact_versions_spec.rb +95 -0
  120. data/spec/migrations/24_populate_pact_contents_spec.rb +48 -0
  121. data/spec/migrations/34_latest_tagged_pacts_spec.rb +108 -0
  122. data/spec/migrations/34_pact_revisions_spec.rb +106 -0
  123. data/spec/support/database_cleaner.rb +8 -4
  124. data/spec/support/provider_state_builder.rb +22 -8
  125. metadata +81 -36
  126. data/lib/pact_broker/pacts/database_model.rb +0 -35
  127. data/lib/pact_broker/pacts/latest_tagged_pacts.rb +0 -11
  128. data/lib/pact_broker/pacts/pact_version_content.rb +0 -11
  129. data/lib/pact_broker/webhooks/job.rb +0 -46
  130. data/script/foo-bar.json +0 -22
  131. data/script/publish-new.sh +0 -7
  132. data/script/recreate-pg-db.sh +0 -7
  133. data/spec/lib/pact_broker/webhooks/job_spec.rb +0 -67
@@ -0,0 +1,41 @@
1
+ require 'reform'
2
+ require 'reform/form'
3
+ require 'uri'
4
+
5
+ module PactBroker
6
+ module Api
7
+ module Contracts
8
+ class VerificationContract < Reform::Form
9
+
10
+ property :success
11
+ property :provider_version, as: :providerApplicationVersion
12
+ property :build_url, as: :buildUrl
13
+
14
+ validation do
15
+ configure do
16
+ config.messages_file = File.expand_path("../../../locale/en.yml", __FILE__)
17
+
18
+ def not_blank? value
19
+ value && value.to_s.strip.size > 0
20
+ end
21
+
22
+ def valid_url? url
23
+ URI(url)
24
+ rescue URI::InvalidURIError
25
+ nil
26
+ end
27
+
28
+ def valid_version_number?(value)
29
+ parsed_version_number = PactBroker.configuration.version_parser.call(value)
30
+ !!parsed_version_number
31
+ end
32
+ end
33
+
34
+ required(:success).filled(:bool?)
35
+ required(:provider_version) { not_blank? & valid_version_number? }
36
+ optional(:build_url).maybe(:valid_url?)
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -99,6 +99,13 @@ module PactBroker
99
99
  }
100
100
  end
101
101
 
102
+ link :'pb:publish-verification' do | options |
103
+ {
104
+ title: "Publish verification",
105
+ href: verification_publication_url(represented, options.fetch(:base_url))
106
+ }
107
+ end
108
+
102
109
  curies do | options |
103
110
  [{
104
111
  name: :pb,
@@ -29,7 +29,6 @@ module PactBroker
29
29
  href: pact_url(options[:base_url], represented),
30
30
  title: represented.name
31
31
  }
32
-
33
32
  end
34
33
 
35
34
  end
@@ -7,18 +7,19 @@ module PactBroker
7
7
  module Decorators
8
8
  class RepresentablePact
9
9
 
10
- attr_reader :consumer, :provider, :consumer_version, :consumer_version_number, :created_at, :updated_at
10
+ attr_reader :consumer, :provider, :consumer_version, :consumer_version_number, :created_at, :consumer_name, :provider_name
11
11
 
12
12
  def initialize pact
13
13
  @consumer_version = pact.consumer_version
14
14
  @consumer_version_number = pact.consumer_version.number
15
15
  @consumer = OpenStruct.new(:version => @consumer_version, :name => pact.consumer.name)
16
16
  @provider = OpenStruct.new(:version => nil, :name => pact.provider.name)
17
+ @consumer_name = pact.consumer.name
18
+ @provider_name = pact.provider.name
17
19
  @created_at = pact.created_at
18
- @updated_at = pact.updated_at
19
20
  end
20
21
 
21
22
  end
22
23
  end
23
24
  end
24
- end
25
+ end
@@ -14,7 +14,7 @@ module PactBroker
14
14
  property :createdAt, getter: lambda { |_| created_at.xmlschema }, writeable: false
15
15
 
16
16
  def optional_updated_at
17
- if represented.updated_at != represented.created_at
17
+ if represented.respond_to?(:updated_at) && represented.updated_at != represented.created_at
18
18
  represented.updated_at.xmlschema
19
19
  end
20
20
  end
@@ -0,0 +1,30 @@
1
+ require_relative 'base_decorator'
2
+
3
+ module PactBroker
4
+ module Api
5
+ module Decorators
6
+ class VerificationDecorator < BaseDecorator
7
+
8
+ property :success
9
+ property :provider_version, as: :providerApplicationVersion
10
+ property :build_url, as: :buildUrl
11
+
12
+ link :self do | options |
13
+ {
14
+ title: 'Verification',
15
+ name: represented.number,
16
+ href: verification_url(represented, options.fetch(:base_url), )
17
+ }
18
+ end
19
+
20
+ link 'pb:pact-version' do | options |
21
+ {
22
+ title: 'Pact',
23
+ name: represented.latest_pact_publication.name,
24
+ href: pact_url(options.fetch(:base_url), represented.latest_pact_publication)
25
+ }
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,21 @@
1
+ require_relative 'base_decorator'
2
+ require_relative 'version_decorator'
3
+
4
+ module PactBroker
5
+ module Api
6
+ module Decorators
7
+
8
+ class VerificationsDecorator < BaseDecorator
9
+
10
+ collection :entries, as: :verifications, embedded: true, :extend => PactBroker::Api::Decorators::VerificationDecorator
11
+
12
+ link :self do | context |
13
+ {
14
+ href: context.fetch(:resource_url),
15
+ title: "Latest verifications for consumer #{context.fetch(:consumer_name)} version #{context.fetch(:consumer_version_number)}"
16
+ }
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -18,6 +18,13 @@ module PactBroker
18
18
  }
19
19
  end
20
20
 
21
+ link :'pb:latest-verifications' do | options |
22
+ {
23
+ title: "Latest verifications for consumer version",
24
+ href: latest_verifications_for_consumer_version_url(represented, options.fetch(:base_url))
25
+ }
26
+ end
27
+
21
28
  link :pacticipant do | options |
22
29
  {
23
30
  title: 'Pacticipant',
@@ -26,6 +33,13 @@ module PactBroker
26
33
  }
27
34
  end
28
35
 
36
+ curies do | options |
37
+ [{
38
+ name: :pb,
39
+ href: options.fetch(:base_url) + '/doc/{rel}',
40
+ templated: true
41
+ }]
42
+ end
29
43
  end
30
44
  end
31
45
  end
@@ -15,7 +15,7 @@ module PactBroker
15
15
  link :self do | context |
16
16
  {
17
17
  href: context[:resource_url],
18
- title: "All application versions of #{context[:pacticipant_name]}"
18
+ title: "All versions of the pacticipant #{context[:pacticipant_name]}"
19
19
  }
20
20
  end
21
21
 
@@ -28,6 +28,10 @@ module PactBroker
28
28
  "#{pactigration_base_url(base_url, pact)}/version/#{pact.consumer_version_number}"
29
29
  end
30
30
 
31
+ def pact_version_url pact, base_url
32
+ "#{pactigration_base_url(base_url, path)}/pact-version/#{pact.sha}"
33
+ end
34
+
31
35
  def pact_url_from_params base_url, params
32
36
  [ base_url, 'pacts',
33
37
  'provider', url_encode(params[:provider_name]),
@@ -59,6 +63,32 @@ module PactBroker
59
63
  "#{version_url(base_url, version)}/tags"
60
64
  end
61
65
 
66
+ def new_verification_url params, number, base_url
67
+ [ base_url, 'pacts',
68
+ 'provider', url_encode(params[:provider_name]),
69
+ 'consumer', url_encode(params[:consumer_name]),
70
+ 'pact-version', params[:sha],
71
+ 'verifications', number
72
+ ].join('/')
73
+ end
74
+
75
+ def verification_url verification, base_url
76
+ [ base_url, 'pacts',
77
+ 'provider', url_encode(verification.provider_name),
78
+ 'consumer', url_encode(verification.consumer_name),
79
+ 'pact-version', verification.pact_version.sha,
80
+ 'verifications', verification.number
81
+ ].join('/')
82
+ end
83
+
84
+ def latest_verifications_for_consumer_version_url version, base_url
85
+ "#{base_url}/pacts/consumer/#{url_encode(version.pacticipant.name)}/versions/#{version.number}/verifications/latest"
86
+ end
87
+
88
+ def verification_publication_url pact, base_url
89
+ "#{pactigration_base_url(base_url, pact)}/pact-version/#{pact.pact_version_sha}/verifications"
90
+ end
91
+
62
92
  def tag_url base_url, tag
63
93
  "#{tags_url(base_url, tag.version)}/#{tag.name}"
64
94
  end
@@ -94,8 +124,17 @@ module PactBroker
94
124
  end
95
125
 
96
126
  def pactigration_base_url base_url, pact
97
- "#{base_url}/pacts/provider/#{url_encode(pact.provider.name)}/consumer/#{url_encode(pact.consumer.name)}"
127
+ provider_name = pact.respond_to?(:provider_name) ? pact.provider_name : pact.provider.name
128
+ consumer_name = pact.respond_to?(:consumer_name) ? pact.consumer_name : pact.consumer.name
129
+ "#{base_url}/pacts/provider/#{url_encode(provider_name)}/consumer/#{url_encode(consumer_name)}"
130
+ end
131
+
132
+ def pactigration_base_url_from_params base_url, params
133
+ [ base_url, 'pacts',
134
+ 'provider', url_encode(params[:provider_name]),
135
+ 'consumer', url_encode(params[:consumer_name])
136
+ ].join('/')
98
137
  end
99
138
  end
100
139
  end
101
- end
140
+ end
@@ -61,7 +61,7 @@ module PactBroker
61
61
  end
62
62
 
63
63
  def published_date
64
- @pact.updated_at.to_time.localtime.to_datetime.strftime("%a %d %b %Y, %l:%M%P %:z")
64
+ @pact.created_at.to_time.localtime.to_datetime.strftime("%a %d %b %Y, %l:%M%P %:z")
65
65
  end
66
66
 
67
67
  def json_url
@@ -5,6 +5,7 @@ require 'pact_broker/logging'
5
5
  require 'pact_broker/api/pact_broker_urls'
6
6
  require 'pact_broker/api/decorators/decorator_context'
7
7
  require 'pact_broker/json'
8
+ require 'pact_broker/pacts/pact_params'
8
9
 
9
10
  module PactBroker
10
11
 
@@ -67,6 +68,14 @@ module PactBroker
67
68
  @params ||= JSON.parse(request.body.to_s, {symbolize_names: true}.merge(PACT_PARSING_OPTIONS))
68
69
  end
69
70
 
71
+ def params_with_string_keys
72
+ JSON.parse(request.body.to_s, {symbolize_names: false}.merge(PACT_PARSING_OPTIONS))
73
+ end
74
+
75
+ def pact_params
76
+ @pact_params ||= PactBroker::Pacts::PactParams.from_request request, path_info
77
+ end
78
+
70
79
  def set_json_error_message message
71
80
  response.headers['Content-Type'] = 'application/json;charset=utf-8'
72
81
  response.body = {error: message}.to_json
@@ -114,8 +123,8 @@ module PactBroker
114
123
  end
115
124
  end
116
125
 
117
- def contract_validation_errors? contract, pact_params
118
- if (invalid = !contract.validate(pact_params))
126
+ def contract_validation_errors? contract, params
127
+ if (invalid = !contract.validate(params))
119
128
  set_json_validation_error_messages contract.errors.messages
120
129
  end
121
130
  invalid
@@ -0,0 +1,39 @@
1
+ require 'pact_broker/api/resources/base_resource'
2
+ require 'pact_broker/configuration'
3
+ require 'pact_broker/domain/verification'
4
+ require 'pact_broker/api/contracts/verification_contract'
5
+ require 'pact_broker/api/decorators/verifications_decorator'
6
+
7
+ module PactBroker
8
+ module Api
9
+ module Resources
10
+
11
+ class LatestVerificationsForConsumerVersion < BaseResource
12
+
13
+ def allowed_methods
14
+ ["GET"]
15
+ end
16
+
17
+ def content_types_provided
18
+ [["application/hal+json", :to_json]]
19
+ end
20
+
21
+ def resource_exists?
22
+ version_params = {pacticipant_name: identifier_from_path[:consumer_name], pacticipant_version_number: identifier_from_path[:consumer_version_number]}
23
+ !!version_service.find_by_pacticipant_name_and_number(version_params)
24
+ end
25
+
26
+ def to_json
27
+ verifications = verification_service.find_latest_verifications_for_consumer_version(identifier_from_path)
28
+ decorator_for(verifications).to_json(user_options: decorator_context(identifier_from_path))
29
+ end
30
+
31
+ private
32
+
33
+ def decorator_for verifications
34
+ PactBroker::Api::Decorators::VerificationsDecorator.new(verifications)
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -33,7 +33,7 @@ module PactBroker
33
33
 
34
34
  def from_json
35
35
  created_model = pacticipant_service.create params
36
- response.body = decorator_for(created_model).to_json(user_options: decorator_context)
36
+ response.body = decorator_for(created_model).to_json(decorator_context)
37
37
  end
38
38
 
39
39
  def create_path
@@ -22,7 +22,7 @@ module PactBroker
22
22
  end
23
23
 
24
24
  def to_json
25
- PactBroker::Api::Decorators::PactDecorator.new(pact).to_json(user_options: {base_url: base_url})
25
+ PactBroker::Api::Decorators::PactDecorator.new(pact).to_json(base_url: base_url)
26
26
  end
27
27
 
28
28
  def pact
@@ -0,0 +1,67 @@
1
+ require 'pact_broker/api/resources/base_resource'
2
+ require 'pact_broker/configuration'
3
+ require 'pact_broker/domain/verification'
4
+ require 'pact_broker/api/contracts/verification_contract'
5
+ require 'pact_broker/api/decorators/verification_decorator'
6
+
7
+ module PactBroker
8
+ module Api
9
+ module Resources
10
+
11
+ class Verifications < BaseResource
12
+
13
+ def content_types_accepted
14
+ [["application/json", :from_json]]
15
+ end
16
+
17
+ def allowed_methods
18
+ ["POST"]
19
+ end
20
+
21
+ def post_is_create?
22
+ true
23
+ end
24
+
25
+ def resource_exists?
26
+ !!pact
27
+ end
28
+
29
+ def malformed_request?
30
+ if request.post?
31
+ return true if invalid_json?
32
+ errors = verification_service.errors(params)
33
+ if !errors.empty?
34
+ set_json_validation_error_messages(errors.messages)
35
+ return true
36
+ end
37
+ end
38
+ false
39
+ end
40
+
41
+ def create_path
42
+ new_verification_url(pact_params, next_verification_number, base_url)
43
+ end
44
+
45
+ def from_json
46
+ verification = verification_service.create(next_verification_number, params_with_string_keys, pact)
47
+ response.body = decorator_for(verification).to_json(user_options: {base_url: base_url})
48
+ true
49
+ end
50
+
51
+ private
52
+
53
+ def pact
54
+ @pact ||= pact_service.find_pact(pact_params)
55
+ end
56
+
57
+ def next_verification_number
58
+ @next_verification_number ||= verification_service.next_number_for(pact)
59
+ end
60
+
61
+ def decorator_for model
62
+ PactBroker::Api::Decorators::VerificationDecorator.new(model)
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
@@ -25,7 +25,7 @@ module PactBroker
25
25
  end
26
26
 
27
27
  def versions
28
- pacticipant_service.find_all_pacticipant_versions_in_reverse_order pacticipant_name
28
+ pacticipant_service.find_all_pacticipant_versions pacticipant_name
29
29
  end
30
30
 
31
31
  end
@@ -16,7 +16,7 @@ module PactBroker
16
16
  end
17
17
 
18
18
  def to_json
19
- Decorators::WebhooksDecorator.new(webhooks).to_json(user_options: decorator_context(resource_title: "Webhooks"))
19
+ Decorators::WebhooksDecorator.new(webhooks).to_json(decorator_context(resource_title: "Webhooks"))
20
20
  end
21
21
 
22
22
  def webhooks