Skip to content

Commit b6efbd9

Browse files
joeybloggsjoeybloggs
authored andcommitted
Add Bitbucket tests
1 parent 4598745 commit b6efbd9

File tree

5 files changed

+2906
-22
lines changed

5 files changed

+2906
-22
lines changed

bitbucket/bitbucket.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,29 @@ type Event string
2525

2626
// Bitbucket hook types
2727
const (
28-
RepoPushEvent Event = "repo:push"
29-
RepoForkEvent Event = "repo:fork"
30-
RepoCommitCommentCreatedEvent Event = "repo:commit_comment_created"
31-
RepoCommitStatusCreatedEvent Event = "repo:commit_status_created"
32-
RepoCommitStatusUpdatedEvent Event = "repo:commit_status_updated"
33-
IssueCreatedEvent Event = "issue:created"
34-
IssueUpdatedEvent Event = "issue:updated"
35-
IssueCommentCreatedEvent Event = "issue:comment_created"
36-
PullRequestCreatedEvent Event = "pullrequest:created"
37-
PullRequestUpdatedEvent Event = "pullrequest:updated"
38-
PullRequestApprovedEvent Event = "pullrequest:approved"
39-
PullRequestUnapprovedEvent Event = "pullrequest:unapproved"
40-
PullRequestMergedEvent Event = "pullrequest:fulfilled"
41-
PullRequestDeclinedEvent Event = "pullrequest:rejected"
42-
PullRequestCommentCreatedEvent Event = "pullrequest:comment_created"
43-
PullRequestCommentUpdatedEvent Event = "pullrequest:comment_updated"
44-
PullRequestCommentDeletedEvent Event = "pull_request:comment_deleted"
28+
RepoPushEvent Event = "repo:push"
29+
RepoForkEvent Event = "repo:fork"
30+
RepoCommitCommentCreatedEvent Event = "repo:commit_comment_created"
31+
RepoCommitStatusCreatedEvent Event = "repo:commit_status_created"
32+
RepoCommitStatusUpdatedEvent Event = "repo:commit_status_updated"
33+
IssueCreatedEvent Event = "issue:created"
34+
IssueUpdatedEvent Event = "issue:updated"
35+
IssueCommentCreatedEvent Event = "issue:comment_created"
36+
PullRequestCreatedEvent Event = "pullrequest:created"
37+
PullRequestUpdatedEvent Event = "pullrequest:updated"
38+
PullRequestApprovedEvent Event = "pullrequest:approved"
39+
PullRequestApprovalRemovedEvent Event = "pullrequest:unapproved"
40+
PullRequestMergedEvent Event = "pullrequest:fulfilled"
41+
PullRequestDeclinedEvent Event = "pullrequest:rejected"
42+
PullRequestCommentCreatedEvent Event = "pullrequest:comment_created"
43+
PullRequestCommentUpdatedEvent Event = "pullrequest:comment_updated"
44+
PullRequestCommentDeletedEvent Event = "pull_request:comment_deleted"
4545
)
4646

4747
// New creates and returns a WebHook instance denoted by the Provider type
4848
func New(config *Config) *Webhook {
4949
return &Webhook{
50-
provider: webhooks.GitHub,
50+
provider: webhooks.Bitbucket,
5151
uuid: config.UUID,
5252
eventFuncs: map[Event]webhooks.ProcessPayloadFunc{},
5353
}
@@ -145,8 +145,8 @@ func (hook Webhook) ParsePayload(w http.ResponseWriter, r *http.Request) {
145145
var pl PullRequestApprovedPayload
146146
json.Unmarshal([]byte(payload), &pl)
147147
hook.runProcessPayloadFunc(fn, pl)
148-
case PullRequestUnapprovedEvent:
149-
var pl PullRequestUnapprovedPayload
148+
case PullRequestApprovalRemovedEvent:
149+
var pl PullRequestApprovalRemovedPayload
150150
json.Unmarshal([]byte(payload), &pl)
151151
hook.runProcessPayloadFunc(fn, pl)
152152
case PullRequestMergedEvent:

0 commit comments

Comments
 (0)