55 "net/http"
66 "testing"
77
8+ "github.com/timescale/tiger-cli/internal/tiger/util"
89 "go.uber.org/mock/gomock"
910
1011 "github.com/timescale/tiger-cli/internal/tiger/api"
@@ -46,9 +47,10 @@ func TestValidateAPIKeyWithClient(t *testing.T) {
4647 GetProjectsProjectIdServicesWithResponse (gomock .Any (), "00000000-0000-0000-0000-000000000000" ).
4748 Return (& api.GetProjectsProjectIdServicesResponse {
4849 HTTPResponse : & http.Response {StatusCode : 401 },
50+ JSON4XX : & api.ClientError {Message : util .Ptr ("Invalid or missing authentication credentials" )},
4951 }, nil )
5052 },
51- expectedError : "invalid API key: authentication failed " ,
53+ expectedError : "Invalid or missing authentication credentials " ,
5254 },
5355 {
5456 name : "invalid API key - 403 response" ,
@@ -57,9 +59,10 @@ func TestValidateAPIKeyWithClient(t *testing.T) {
5759 GetProjectsProjectIdServicesWithResponse (gomock .Any (), "00000000-0000-0000-0000-000000000000" ).
5860 Return (& api.GetProjectsProjectIdServicesResponse {
5961 HTTPResponse : & http.Response {StatusCode : 403 },
62+ JSON4XX : & api.ClientError {Message : util .Ptr ("Invalid or missing authentication credentials" )},
6063 }, nil )
6164 },
62- expectedError : "invalid API key: authentication failed " ,
65+ expectedError : "Invalid or missing authentication credentials " ,
6366 },
6467 {
6568 name : "unexpected response - 500" ,
0 commit comments