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

Commit 55984eb

Browse files
committed
fix tests, specs to match 400 error on bad filtering requests
1 parent 273b834 commit 55984eb

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

apidoc/openapi-spec.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ paths:
5151
examples:
5252
ThingDescriptionList:
5353
$ref: '#/components/examples/ThingDescriptionList'
54+
'400':
55+
$ref: '#/components/responses/RespBadRequest'
5456
'401':
5557
$ref: '#/components/responses/RespUnauthorized'
5658
'403':

catalog/http_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,8 @@ func TestGetAll(t *testing.T) {
468468
if err != nil {
469469
t.Fatalf("Error reading response body: %s", err)
470470
}
471-
if res.StatusCode != http.StatusInternalServerError {
472-
t.Fatalf("Expected status %v, got: %d. Response body:\n%s", http.StatusInternalServerError, res.StatusCode, b)
471+
if res.StatusCode != http.StatusBadRequest {
472+
t.Fatalf("Expected status %v, got: %d. Response body:\n%s", http.StatusBadRequest, res.StatusCode, b)
473473
}
474474
})
475475

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

0 commit comments

Comments
 (0)