Skip to content

Commit

Permalink
Merge pull request #25 from odpf/refactor/alert_credentials_endpoint
Browse files Browse the repository at this point in the history
refactor: update alert credentials api endpoint
  • Loading branch information
rohilsurana authored May 12, 2021
2 parents 1448966 + d558e06 commit 9492caa
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 140 deletions.
14 changes: 7 additions & 7 deletions api/alertmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func TestGetAlertCredentials(t *testing.T) {
router := New(&service.Container{
AlertmanagerService: alertmanagerServiceMock,
}, nil, getPanicLogger())
r, err := http.NewRequest(http.MethodGet, "/alertingCredentials/teams/hydra", nil)
r, err := http.NewRequest(http.MethodGet, "/teams/hydra/credentials", nil)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -99,7 +99,7 @@ func TestGetAlertCredentials(t *testing.T) {
router := New(&service.Container{
AlertmanagerService: alertmanagerServiceMock,
}, nil, getPanicLogger())
r, err := http.NewRequest(http.MethodGet, "/alertingCredentials/teams/hydra", nil)
r, err := http.NewRequest(http.MethodGet, "/teams/hydra/credentials", nil)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -130,7 +130,7 @@ func TestUpdateAlertCredentials(t *testing.T) {
"webhook": "http://warning.com"
}
}}`)
r, err := http.NewRequest(http.MethodPut, "/alertingCredentials/teams/myTeam", bytes.NewBuffer(payload))
r, err := http.NewRequest(http.MethodPut, "/teams/myTeam/credentials", bytes.NewBuffer(payload))
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -161,7 +161,7 @@ func TestUpdateAlertCredentials(t *testing.T) {
"webhook": "http://warning.com"
}
}}`)
r, err := http.NewRequest(http.MethodPut, "/alertingCredentials/teams/myTeam", bytes.NewBuffer(payload))
r, err := http.NewRequest(http.MethodPut, "/teams/myTeam/credentials", bytes.NewBuffer(payload))
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -192,7 +192,7 @@ func TestUpdateAlertCredentials(t *testing.T) {
"webhook": "http://warning.com"
}
}}`)
r, err := http.NewRequest(http.MethodPut, "/alertingCredentials/teams/myTeam", bytes.NewBuffer(payload))
r, err := http.NewRequest(http.MethodPut, "/teams/myTeam/credentials", bytes.NewBuffer(payload))
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -226,7 +226,7 @@ func TestUpdateAlertCredentials(t *testing.T) {
"webhook": "http://warning.com"
}
}}`)
r, err := http.NewRequest(http.MethodPut, "/alertingCredentials/teams/myTeam", bytes.NewBuffer(payload))
r, err := http.NewRequest(http.MethodPut, "/teams/myTeam/credentials", bytes.NewBuffer(payload))
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -261,7 +261,7 @@ func TestUpdateAlertCredentials(t *testing.T) {
"webhook": "http://warning.com"
}
}}`)
r, err := http.NewRequest(http.MethodPut, "/alertingCredentials/teams/myTeam", bytes.NewBuffer(payload))
r, err := http.NewRequest(http.MethodPut, "/teams/myTeam/credentials", bytes.NewBuffer(payload))
if err != nil {
t.Fatal(err)
}
Expand Down
Loading

0 comments on commit 9492caa

Please sign in to comment.