Skip to content

Commit

Permalink
BCDA-7212: Update Delete 204 error to 404
Browse files Browse the repository at this point in the history
  • Loading branch information
austincanada committed Apr 25, 2024
1 parent 9ff104a commit b43d008
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ssas/service/admin/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func deleteGroup(w http.ResponseWriter, r *http.Request) {
err := ssas.DeleteGroup(r.Context(), id)
if err != nil {
logger.Errorf("failed to delete group; %s", err)
service.JSONError(w, http.StatusNoContent, http.StatusText(http.StatusNoContent), "failed to delete group")
service.JSONError(w, http.StatusNotFound, http.StatusText(http.StatusNotFound), "failed to delete group")
return
}

Expand Down
2 changes: 1 addition & 1 deletion ssas/service/admin/router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (s *RouterTestSuite) TestDeleteGroup() {
rr := httptest.NewRecorder()
s.router.ServeHTTP(rr, req)
res := rr.Result()
assert.Equal(s.T(), http.StatusNoContent, res.StatusCode)
assert.Equal(s.T(), http.StatusNotFound, res.StatusCode)
}

func (s *RouterTestSuite) TestPostSystem() {
Expand Down
8 changes: 4 additions & 4 deletions test/postman_test/SSAS.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,16 +293,16 @@
"response": []
},
{
"name": "admin delete group, 204",
"name": "admin delete group, 404",
"event": [
{
"listen": "test",
"script": {
"id": "95ce3470-8202-4e9f-b4f6-4fe36a09cb0d",
"exec": [
"pm.test(\"response is 204 and no content\", function () {",
" pm.response.to.have.status(204);",
" pm.response.to.have.body('{\"error\":\"No Content\",\"error_description\":\"failed to delete group\"}',)",
"pm.test(\"response is 404 and not found\", function () {",
" pm.response.to.have.status(404);",
" pm.response.to.have.body('{\"error\":\"Not Found\",\"error_description\":\"failed to delete group\"}',)",
"});"
],
"type": "text/javascript"
Expand Down

0 comments on commit b43d008

Please sign in to comment.