Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jgangemi committed Nov 3, 2024
1 parent 05a4a80 commit c09e0ae
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func TestSetCustomIssueTrackerService(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/services/custom-issue-tracker", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetCustomIssueTrackerServiceOptions{
Expand Down Expand Up @@ -156,6 +157,7 @@ func TestSetDataDogService(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/services/datadog", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetDataDogServiceOptions{
Expand Down Expand Up @@ -210,6 +212,7 @@ func TestSetDiscordService(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/services/discord", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetDiscordServiceOptions{
Expand Down Expand Up @@ -258,6 +261,7 @@ func TestSetDroneCIService(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/services/drone-ci", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetDroneCIServiceOptions{Ptr("token"), Ptr("drone-url"), Ptr(true), nil, nil, nil}
Expand Down Expand Up @@ -304,6 +308,7 @@ func TestSetEmailsOnPushService(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/integrations/emails-on-push", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetEmailsOnPushServiceOptions{Ptr("t"), Ptr(true), Ptr(true), Ptr(true), Ptr(true), Ptr("t")}
Expand Down Expand Up @@ -350,6 +355,7 @@ func TestSetHarborService(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/integrations/harbor", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetHarborServiceOptions{
Expand Down Expand Up @@ -402,6 +408,7 @@ func TestSetSlackApplication(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/integrations/gitlab-slack-application", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetSlackApplicationOptions{Channel: Ptr("#channel1"), NoteEvents: Ptr(true), AlertEvents: Ptr(true)}
Expand Down Expand Up @@ -501,6 +508,7 @@ func TestSetJiraService(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/integrations/jira", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetJiraServiceOptions{
Expand Down Expand Up @@ -532,6 +540,7 @@ func TestSetJiraServiceProjecKeys(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/integrations/jira", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetJiraServiceOptions{
Expand Down Expand Up @@ -563,6 +572,7 @@ func TestSetJiraServiceAuthTypeBasicAuth(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/integrations/jira", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetJiraServiceOptions{
Expand All @@ -583,6 +593,7 @@ func TestSetJiraServiceAuthTypeTokenAuth(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/integrations/jira", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetJiraServiceOptions{
Expand Down Expand Up @@ -633,6 +644,7 @@ func TestSetMattermostService(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/services/mattermost", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetMattermostServiceOptions{
Expand Down Expand Up @@ -683,6 +695,7 @@ func TestSetMattermostSlashCommandsService(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/services/mattermost-slash-commands", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetMattermostSlashCommandsServiceOptions{
Expand Down Expand Up @@ -732,6 +745,7 @@ func TestSetPipelinesEmailService(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/services/pipelines-email", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetPipelinesEmailServiceOptions{
Expand Down Expand Up @@ -785,6 +799,7 @@ func TestSetPrometheusService(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/services/prometheus", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetPrometheusServiceOptions{Ptr("t"), Ptr("u"), Ptr("a")}
Expand Down Expand Up @@ -831,6 +846,7 @@ func TestSetRedmineService(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/integrations/redmine", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetRedmineServiceOptions{Ptr("t"), Ptr("u"), Ptr("a"), Ptr(false)}
Expand Down Expand Up @@ -877,6 +893,7 @@ func TestSetSlackService(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/services/slack", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetSlackServiceOptions{
Expand Down Expand Up @@ -927,6 +944,7 @@ func TestSetSlackSlashCommandsService(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/services/slack-slash-commands", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetSlackSlashCommandsServiceOptions{
Expand Down Expand Up @@ -1036,6 +1054,7 @@ func TestSetTelegramService(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/services/telegram", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetTelegramServiceOptions{
Expand Down Expand Up @@ -1096,6 +1115,7 @@ func TestSetYouTrackService(t *testing.T) {

mux.HandleFunc("/api/v4/projects/1/services/youtrack", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
fmt.Fprint(w, `{"id":1, "properties": {}}`)
})

opt := &SetYouTrackServiceOptions{
Expand Down

0 comments on commit c09e0ae

Please sign in to comment.