Skip to content

Commit

Permalink
Change must.Nil() to must.NoError()
Browse files Browse the repository at this point in the history
Signed-off-by: dttung2905 <[email protected]>
  • Loading branch information
dttung2905 committed Dec 22, 2022
1 parent b4141e7 commit 4daf080
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions command/agent/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,21 +489,21 @@ func TestParseConsistency(t *testing.T) {
}

req, err := http.NewRequest("GET", "/v1/catalog/nodes?stale=false", nil)
must.Nil(t, err, must.Sprintf("err: %v", err))
must.NoError(t, err)
resp = httptest.NewRecorder()
parseConsistency(resp, req, &b)
must.True(t, !b.AllowStale)

req, err = http.NewRequest("GET", "/v1/catalog/nodes?stale=random", nil)
must.Nil(t, err, must.Sprintf("err: %v", err))
must.NoError(t, err)
resp = httptest.NewRecorder()
parseConsistency(resp, req, &b)
must.EqOp(t, resp.Code, 400)

b = structs.QueryOptions{}
req, err = http.NewRequest("GET",
"/v1/catalog/nodes?consistent", nil)
must.Nil(t, err, must.Sprintf("err: %v", err))
must.NoError(t, err)

resp = httptest.NewRecorder()
parseConsistency(resp, req, &b)
Expand Down

0 comments on commit 4daf080

Please sign in to comment.