Skip to content

Commit 4e2d1b1

Browse files
authored
feat: return more webhooks attributes in logs decorator (#961)
1 parent 16d60d7 commit 4e2d1b1

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

lib/pact_broker/api/decorators/triggered_webhook_logs_decorator.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ class WebhookExecutionDecorator < BaseDecorator
1111
end
1212

1313

14+
property :event_name, as: :eventName
15+
property :consumer_name, as: :consumerName
16+
property :provider_name, as: :providerName
17+
1418
nested :triggeredWebhook, embedded: true do
1519
property :uuid
1620
end

spec/fixtures/approvals/triggered_webhook_logs_decorator.approved.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"eventName": "contract_requiring_verification_published",
3+
"consumerName": "Example Consumer",
4+
"providerName": "Example Provider",
25
"executions": [
36
{
47
"success": true,

spec/lib/pact_broker/api/decorators/triggered_webhook_logs_decorator_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ module Decorators
77
let(:triggered_webhook) do
88
double("PactBroker::Webhooks::TriggeredWebhook",
99
uuid: "1234",
10+
event_name: "contract_requiring_verification_published",
11+
consumer_name: "Example Consumer",
12+
provider_name: "Example Provider",
1013
webhook_executions: [webhook_execution],
1114
webhook: webhook
1215
)

0 commit comments

Comments
 (0)