Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
fix tests, specs to match 400 error on bad filtering requests
Browse files Browse the repository at this point in the history
  • Loading branch information
farshidtz committed Jun 12, 2020
1 parent 273b834 commit 55984eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions apidoc/openapi-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ paths:
examples:
ThingDescriptionList:
$ref: '#/components/examples/ThingDescriptionList'
'400':
$ref: '#/components/responses/RespBadRequest'
'401':
$ref: '#/components/responses/RespUnauthorized'
'403':
Expand Down
8 changes: 4 additions & 4 deletions catalog/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ func TestGetAll(t *testing.T) {
if err != nil {
t.Fatalf("Error reading response body: %s", err)
}
if res.StatusCode != http.StatusInternalServerError {
t.Fatalf("Expected status %v, got: %d. Response body:\n%s", http.StatusInternalServerError, res.StatusCode, b)
if res.StatusCode != http.StatusBadRequest {
t.Fatalf("Expected status %v, got: %d. Response body:\n%s", http.StatusBadRequest, res.StatusCode, b)
}
})

Expand All @@ -484,8 +484,8 @@ func TestGetAll(t *testing.T) {
if err != nil {
t.Fatalf("Error reading response body: %s", err)
}
if res.StatusCode != http.StatusInternalServerError {
t.Fatalf("Expected status %v, got: %d. Response body:\n%s", http.StatusInternalServerError, res.StatusCode, b)
if res.StatusCode != http.StatusBadRequest {
t.Fatalf("Expected status %v, got: %d. Response body:\n%s", http.StatusBadRequest, res.StatusCode, b)
}
})

Expand Down

0 comments on commit 55984eb

Please sign in to comment.