Skip to content

Commit

Permalink
webhook unit test
Browse files Browse the repository at this point in the history
Signed-off-by: DrowYue <[email protected]>
  • Loading branch information
DrowYue committed Aug 26, 2024
1 parent 0f6afed commit 75ad7fb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/webhook/manager/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,16 @@ func Test(t *testing.T) {
_, count, err := mgr.ListWebhookOfResources(ctx, resources, q.New(q.KeyWords{
common.Enabled: true,
}))
assert.Nil(t, err)
assert.Equal(t, int64(1), count)

retrieveWebhooks, err := mgr.ListWebhooks(ctx)
assert.Nil(t, err)
assert.Equal(t, 1, len(retrieveWebhooks))

webhook.URL = "https://horizon.com"
retrieveWebhook, err = mgr.UpdateWebhook(ctx, webhook.ID, webhook)
assert.Nil(t, err)
assert.Equal(t, retrieveWebhook.ID, webhook.ID)
assert.Equal(t, retrieveWebhook.URL, "https://horizon.com")

Expand Down

0 comments on commit 75ad7fb

Please sign in to comment.