From 42c37d43bbe37064bdef88d9d80b1d7c44e78755 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Thu, 12 Jan 2023 12:00:32 +0530 Subject: [PATCH] modified tcs for bad request --- client/client_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/client_test.go b/client/client_test.go index dc9ff73c7..6c4d45fd8 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -283,7 +283,7 @@ func TestGetResponse(t *testing.T) { StatusCode: http.StatusBadRequest, Body: ioutil.NopCloser(strings.NewReader( `{"api_version": "3.1", "code": 400, "kind": "error", "message_list": - [{"message": "This field may not be blank."}], "state": "ERROR"}`)), + [{"message": "bad Request"}], "state": "ERROR"}`)), } err := CheckResponse(res) @@ -292,8 +292,8 @@ func TestGetResponse(t *testing.T) { t.Fatal("Expected error response.") } - if !strings.Contains(fmt.Sprint(err), "This field may not be blank.") { - t.Errorf("error = %#v, expected %#v", err, "This field may not be blank.") + if !strings.Contains(fmt.Sprint(err), "bad Request") { + t.Errorf("error = %#v, expected %#v", err, "bad Request") } } @@ -303,7 +303,7 @@ func TestCheckResponse(t *testing.T) { StatusCode: http.StatusBadRequest, Body: ioutil.NopCloser(strings.NewReader( `{"api_version": "3.1", "code": 400, "kind": "error", "message_list": - [{"message": "This field may not be blank."}], "state": "ERROR"}`)), + [{"message": "bad Request"}], "state": "ERROR"}`)), } err := CheckResponse(res) @@ -311,8 +311,8 @@ func TestCheckResponse(t *testing.T) { t.Fatalf("Expected error response.") } - if !strings.Contains(fmt.Sprint(err), "This field may not be blank.") { - t.Errorf("error = %#v, expected %#v", err, "This field may not be blank.") + if !strings.Contains(fmt.Sprint(err), "bad Request") { + t.Errorf("error = %#v, expected %#v", err, "bad Request") } }