From 0041449e279fb35c4098b0c22457bcb5844672ab Mon Sep 17 00:00:00 2001 From: zubeen Date: Thu, 23 Oct 2025 17:20:16 +0530 Subject: [PATCH 1/4] refactor(test): migrate to testify assertions 4 --- dockerfile_templates_test.go | 85 ++++++++++-------------------------- 1 file changed, 22 insertions(+), 63 deletions(-) diff --git a/dockerfile_templates_test.go b/dockerfile_templates_test.go index af74815c..af1eaea6 100644 --- a/dockerfile_templates_test.go +++ b/dockerfile_templates_test.go @@ -19,8 +19,9 @@ package gitlab import ( "fmt" "net/http" - "reflect" "testing" + + "github.com/stretchr/testify/assert" ) func TestDockerfileTemplatesService_ListTemplates(t *testing.T) { @@ -30,67 +31,28 @@ func TestDockerfileTemplatesService_ListTemplates(t *testing.T) { mux.HandleFunc("/api/v4/templates/dockerfiles", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodGet) fmt.Fprintf(w, `[ - { - "key":"Binary", - "name":"Binary" - }, - { - "key":"Binary-alpine", - "name":"Binary-alpine" - }, - { - "key":"Binary-scratch", - "name":"Binary-scratch" - }, - { - "key":"Golang", - "name":"Golang" - }, - { - "key":"Golang-alpine", - "name":"Golang-alpine" - }, - { - "key":"Golang-scratch", - "name":"Golang-scratch" - } - ]`) + {"key":"Binary","name":"Binary"}, + {"key":"Binary-alpine","name":"Binary-alpine"}, + {"key":"Binary-scratch","name":"Binary-scratch"}, + {"key":"Golang","name":"Golang"}, + {"key":"Golang-alpine","name":"Golang-alpine"}, + {"key":"Golang-scratch","name":"Golang-scratch"} + ]`) }) templates, _, err := client.DockerfileTemplate.ListTemplates(&ListDockerfileTemplatesOptions{}) - if err != nil { - t.Errorf("DockerfileTemplate.ListTemplates returned error: %v", err) - } + assert.NoError(t, err, "DockerfileTemplate.ListTemplates should not return an error") want := []*DockerfileTemplateListItem{ - { - Key: "Binary", - Name: "Binary", - }, - { - Key: "Binary-alpine", - Name: "Binary-alpine", - }, - { - Key: "Binary-scratch", - Name: "Binary-scratch", - }, - { - Key: "Golang", - Name: "Golang", - }, - { - Key: "Golang-alpine", - Name: "Golang-alpine", - }, - { - Key: "Golang-scratch", - Name: "Golang-scratch", - }, - } - if !reflect.DeepEqual(want, templates) { - t.Errorf("DockerfileTemplate.ListTemplates returned %+v, want %+v", templates, want) + {Key: "Binary", Name: "Binary"}, + {Key: "Binary-alpine", Name: "Binary-alpine"}, + {Key: "Binary-scratch", Name: "Binary-scratch"}, + {Key: "Golang", Name: "Golang"}, + {Key: "Golang-alpine", Name: "Golang-alpine"}, + {Key: "Golang-scratch", Name: "Golang-scratch"}, } + + assert.Equal(t, want, templates, "DockerfileTemplate.ListTemplates returned unexpected result") } func TestDockerfileTemplatesService_GetTemplate(t *testing.T) { @@ -102,19 +64,16 @@ func TestDockerfileTemplatesService_GetTemplate(t *testing.T) { fmt.Fprintf(w, `{ "name": "Binary", "content": "# This file is a template, and might need editing before it works on your project." - }`) + }`) }) template, _, err := client.DockerfileTemplate.GetTemplate("Binary") - if err != nil { - t.Errorf("DockerfileTemplate.GetTemplate returned error: %v", err) - } + assert.NoError(t, err, "DockerfileTemplate.GetTemplate should not return an error") want := &DockerfileTemplate{ Name: "Binary", Content: "# This file is a template, and might need editing before it works on your project.", } - if !reflect.DeepEqual(want, template) { - t.Errorf("DockerfileTemplate.GetTemplate returned %+v, want %+v", template, want) - } + + assert.Equal(t, want, template, "DockerfileTemplate.GetTemplate returned unexpected result") } -- GitLab From 61e2bab68965f4acc713c7d7bfcd8da9735cb8fc Mon Sep 17 00:00:00 2001 From: zubeen Date: Thu, 23 Oct 2025 17:50:32 +0530 Subject: [PATCH 2/4] refactor(test): migrate to testify assertions 5 --- avatar_test.go | 33 +++++----- dora_metrics_test.go | 61 +++++++++--------- group_clusters_test.go | 142 +++++++++++++++++------------------------ 3 files changed, 103 insertions(+), 133 deletions(-) diff --git a/avatar_test.go b/avatar_test.go index 219bd16e..c91533b4 100644 --- a/avatar_test.go +++ b/avatar_test.go @@ -20,6 +20,9 @@ import ( "encoding/json" "net/http" "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestGetAvatar(t *testing.T) { @@ -28,27 +31,21 @@ func TestGetAvatar(t *testing.T) { const url = "https://www.gravatar.com/avatar/10e6bf7bcf22c2f00a3ef684b4ada178" - mux.HandleFunc("/api/v4/avatar", - func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, http.MethodGet) - w.WriteHeader(http.StatusAccepted) - avatar := Avatar{AvatarURL: url} - resp, _ := json.Marshal(avatar) - _, _ = w.Write(resp) - }, - ) + mux.HandleFunc("/api/v4/avatar", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodGet) + w.WriteHeader(http.StatusAccepted) + avatar := Avatar{AvatarURL: url} + resp, _ := json.Marshal(avatar) + _, _ = w.Write(resp) + }) opt := &GetAvatarOptions{Email: Ptr("sander@vanharmelen.nnl")} avatar, resp, err := client.Avatar.GetAvatar(opt) - if err != nil { - t.Fatalf("Avatar.GetAvatar returned error: %v", err) - } - if resp.Status != "202 Accepted" { - t.Fatalf("Avatar.GetAvatar returned wrong status code: %v", resp.Status) - } + require.NoError(t, err, "Avatar.GetAvatar should not return an error") + require.NotNil(t, resp, "Response should not be nil") + assert.Equal(t, "202 Accepted", resp.Status, "Expected HTTP status 202 Accepted") - if url != avatar.AvatarURL { - t.Errorf("Avatar.GetAvatar wrong result %s, want %s", avatar.AvatarURL, url) - } + require.NotNil(t, avatar, "Avatar should not be nil") + assert.Equal(t, url, avatar.AvatarURL, "Avatar.GetAvatar returned unexpected URL") } diff --git a/dora_metrics_test.go b/dora_metrics_test.go index 4b13b71b..4af59ef0 100644 --- a/dora_metrics_test.go +++ b/dora_metrics_test.go @@ -6,6 +6,7 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -16,28 +17,25 @@ func TestDORAMetrics_GetProjectDORAMetrics(t *testing.T) { mux.HandleFunc("/api/v4/projects/1/dora/metrics", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodGet) query := r.URL.Query() + for k, v := range map[string]string{ "metric": "deployment_frequency", "start_date": "2021-03-01", "end_date": "2021-03-08", } { - if query.Get(k) != v { - t.Errorf("Query parameter %s: %s, want %s", k, query.Get(k), v) - } + assert.Equal(t, v, query.Get(k), "unexpected value for query param %s", k) } - fmt.Fprint(w, ` - [ - { "date": "2021-03-01", "value": 3 }, - { "date": "2021-03-02", "value": 6 }, - { "date": "2021-03-03", "value": 0 }, - { "date": "2021-03-04", "value": 0 }, - { "date": "2021-03-05", "value": 0 }, - { "date": "2021-03-06", "value": 0 }, - { "date": "2021-03-07", "value": 0 }, - { "date": "2021-03-08", "value": 4 } - ] - `) + fmt.Fprint(w, `[ + { "date": "2021-03-01", "value": 3 }, + { "date": "2021-03-02", "value": 6 }, + { "date": "2021-03-03", "value": 0 }, + { "date": "2021-03-04", "value": 0 }, + { "date": "2021-03-05", "value": 0 }, + { "date": "2021-03-06", "value": 0 }, + { "date": "2021-03-07", "value": 0 }, + { "date": "2021-03-08", "value": 4 } + ]`) }) want := []DORAMetric{ @@ -59,9 +57,10 @@ func TestDORAMetrics_GetProjectDORAMetrics(t *testing.T) { StartDate: &startDate, EndDate: &endDate, }) + require.NoError(t, err) require.NotNil(t, resp) - require.Equal(t, want, d) + assert.Equal(t, want, d) } func TestDORAMetrics_GetGroupDORAMetrics(t *testing.T) { @@ -71,28 +70,25 @@ func TestDORAMetrics_GetGroupDORAMetrics(t *testing.T) { mux.HandleFunc("/api/v4/groups/1/dora/metrics", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodGet) query := r.URL.Query() + for k, v := range map[string]string{ "metric": "deployment_frequency", "start_date": "2021-03-01", "end_date": "2021-03-08", } { - if query.Get(k) != v { - t.Errorf("Query parameter %s: %s, want %s", k, query.Get(k), v) - } + assert.Equal(t, v, query.Get(k), "unexpected value for query param %s", k) } - fmt.Fprint(w, ` - [ - { "date": "2021-03-01", "value": 3 }, - { "date": "2021-03-02", "value": 6 }, - { "date": "2021-03-03", "value": 0 }, - { "date": "2021-03-04", "value": 0 }, - { "date": "2021-03-05", "value": 0 }, - { "date": "2021-03-06", "value": 0 }, - { "date": "2021-03-07", "value": 0 }, - { "date": "2021-03-08", "value": 4 } - ] - `) + fmt.Fprint(w, `[ + { "date": "2021-03-01", "value": 3 }, + { "date": "2021-03-02", "value": 6 }, + { "date": "2021-03-03", "value": 0 }, + { "date": "2021-03-04", "value": 0 }, + { "date": "2021-03-05", "value": 0 }, + { "date": "2021-03-06", "value": 0 }, + { "date": "2021-03-07", "value": 0 }, + { "date": "2021-03-08", "value": 4 } + ]`) }) want := []DORAMetric{ @@ -114,7 +110,8 @@ func TestDORAMetrics_GetGroupDORAMetrics(t *testing.T) { StartDate: &startDate, EndDate: &endDate, }) + require.NoError(t, err) require.NotNil(t, resp) - require.Equal(t, want, d) + assert.Equal(t, want, d) } diff --git a/group_clusters_test.go b/group_clusters_test.go index a5326645..1492af3a 100644 --- a/group_clusters_test.go +++ b/group_clusters_test.go @@ -19,8 +19,10 @@ package gitlab import ( "fmt" "net/http" - "reflect" "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestGroupListClusters(t *testing.T) { @@ -41,8 +43,7 @@ func TestGroupListClusters(t *testing.T) { "platform_type":"kubernetes", "environment_scope":"*", "cluster_type":"group_type", - "user": - { + "user": { "id":1, "name":"Administrator", "username":"root", @@ -50,16 +51,14 @@ func TestGroupListClusters(t *testing.T) { "avatar_url":"https://www.gravatar.com/avatar/4249f4df72b..", "web_url":"https://gitlab.example.com/root" }, - "platform_kubernetes": - { + "platform_kubernetes": { "api_url":"https://104.197.68.152", "authorization_type":"rbac", - "ca_cert":"-----BEGIN CERTIFICATE-----\r\nAAAAA\r\n-----END CERTIFICATE-----" + "ca_cert":"-----BEGIN CERTIFICATE-----\r\nAAAAA\r\n-----END CERTIFICATE-----" }, - "management_project": - { + "management_project": { "id":2, - "description": "sdhfgnbsdjfhg", + "description":"sdhfgnbsdjfhg", "name":"project2", "name_with_namespace":"John Doe8 / project2", "path":"project2", @@ -71,13 +70,11 @@ func TestGroupListClusters(t *testing.T) { "id":19, "name":"cluster-2" } - ]`) + ]`) }) clusters, _, err := client.GroupCluster.ListClusters(26) - if err != nil { - t.Errorf("GroupCluster.ListClusters returned error: %v", err) - } + require.NoError(t, err) want := []*GroupCluster{ { @@ -119,9 +116,8 @@ func TestGroupListClusters(t *testing.T) { Name: "cluster-2", }, } - if !reflect.DeepEqual(want, clusters) { - t.Errorf("GroupCluster.ListClusters returned %+v, want %+v", clusters, want) - } + + assert.Equal(t, want, clusters) } func TestGetGroupCluster(t *testing.T) { @@ -141,8 +137,7 @@ func TestGetGroupCluster(t *testing.T) { "platform_type":"kubernetes", "environment_scope":"*", "cluster_type":"group_type", - "user": - { + "user": { "id":1, "name":"Administrator", "username":"root", @@ -150,35 +145,30 @@ func TestGetGroupCluster(t *testing.T) { "avatar_url":"https://www.gravatar.com/avatar/4249f4df72b..", "web_url":"https://gitlab.example.com/root" }, - "platform_kubernetes": - { + "platform_kubernetes": { "api_url":"https://104.197.68.152", "authorization_type":"rbac", "ca_cert":"-----BEGIN CERTIFICATE-----\r\nAAAAA\r\n-----END CERTIFICATE-----" }, - "management_project": - { + "management_project": { "id":2, - "description": "skjdfgsdfg", + "description":"skjdfgsdfg", "name":"project2", "name_with_namespace":"John Doe8 / project2", "path":"project2", "path_with_namespace":"namespace2/project2", "created_at":"2019-10-11T02:55:54.138Z" }, - "group": - { + "group": { "id":26, "name":"group-with-clusters-api", "web_url":"https://gitlab.example.com/group-with-clusters-api" } - }`) + }`) }) cluster, _, err := client.GroupCluster.GetCluster(26, 18) - if err != nil { - t.Errorf("GroupCluster.GetCluster returned error: %v", err) - } + require.NoError(t, err) want := &GroupCluster{ ID: 18, @@ -219,9 +209,8 @@ func TestGetGroupCluster(t *testing.T) { WebURL: "https://gitlab.example.com/group-with-clusters-api", }, } - if !reflect.DeepEqual(want, cluster) { - t.Errorf("GroupCluster.GetCluster returned %+v, want %+v", cluster, want) - } + + assert.Equal(t, want, cluster) } func TestAddGroupCluster(t *testing.T) { @@ -240,8 +229,7 @@ func TestAddGroupCluster(t *testing.T) { "platform_type":"kubernetes", "environment_scope":"*", "cluster_type":"group_type", - "user": - { + "user": { "id":1, "name":"Administrator", "username":"root", @@ -249,26 +237,22 @@ func TestAddGroupCluster(t *testing.T) { "avatar_url":"https://www.gravatar.com/avatar/4249f4df72b..", "web_url":"https://gitlab.example.com/root" }, - "platform_kubernetes": - { + "platform_kubernetes": { "api_url":"https://35.111.51.20", "authorization_type":"rbac", "ca_cert":"-----BEGIN CERTIFICATE-----\r\nAAAAA\r\n-----END CERTIFICATE-----" }, - "management_project":null, - "group": - { + "management_project": null, + "group": { "id":26, "name":"group-with-clusters-api", "web_url":"https://gitlab.example.com/root/group-with-clusters-api" } - }`) + }`) }) cluster, _, err := client.GroupCluster.AddCluster(26, &AddGroupClusterOptions{}) - if err != nil { - t.Errorf("GroupCluster.AddCluster returned error: %v", err) - } + require.NoError(t, err) want := &GroupCluster{ ID: 24, @@ -293,16 +277,14 @@ func TestAddGroupCluster(t *testing.T) { AuthorizationType: "rbac", CaCert: "-----BEGIN CERTIFICATE-----\r\nAAAAA\r\n-----END CERTIFICATE-----", }, - ManagementProject: nil, Group: &Group{ ID: 26, Name: "group-with-clusters-api", WebURL: "https://gitlab.example.com/root/group-with-clusters-api", }, } - if !reflect.DeepEqual(want, cluster) { - t.Errorf("GroupCluster.AddCluster returned %+v, want %+v", cluster, want) - } + + assert.Equal(t, want, cluster) } func TestEditGroupCluster(t *testing.T) { @@ -322,43 +304,40 @@ func TestEditGroupCluster(t *testing.T) { "platform_type":"kubernetes", "environment_scope":"*", "cluster_type":"group_type", - "user": - { - "id":1, - "name":"Administrator", - "username":"root", - "state":"active", - "avatar_url":"https://www.gravatar.com/avatar/4249f4df72b..", - "web_url":"https://gitlab.example.com/root" + "user": { + "id":1, + "name":"Administrator", + "username":"root", + "state":"active", + "avatar_url":"https://www.gravatar.com/avatar/4249f4df72b..", + "web_url":"https://gitlab.example.com/root" }, - "platform_kubernetes": - { - "api_url":"https://new-api-url.com", - "authorization_type":"rbac" + "platform_kubernetes": { + "api_url":"https://new-api-url.com", + "authorization_type":"rbac" }, - "management_project": - { - "id":2, - "description":"sjdkfngjkdsfngdfgndfg", - "name":"project2", - "name_with_namespace":"John Doe8 / project2", - "path":"project2", - "path_with_namespace":"namespace2/project2", - "created_at":"2019-10-11T02:55:54.138Z" + "management_project": { + "id":2, + "description":"sjdkfngjkdsfngdfgndfg", + "name":"project2", + "name_with_namespace":"John Doe8 / project2", + "path":"project2", + "path_with_namespace":"namespace2/project2", + "created_at":"2019-10-11T02:55:54.138Z" }, - "group": - { - "id":26, - "name":"group-with-clusters-api", - "web_url":"https://gitlab.example.com/group-with-clusters-api" + "group": { + "id":26, + "name":"group-with-clusters-api", + "web_url":"https://gitlab.example.com/group-with-clusters-api" } - }`) + }`) }) name := "new-cluster-name" domain := "new-domain.com" environmentScope := "*" apiURL := "https://new-api-url.com" + opt := &EditGroupClusterOptions{ Name: &name, Domain: &domain, @@ -367,10 +346,10 @@ func TestEditGroupCluster(t *testing.T) { APIURL: &apiURL, }, } + cluster, _, err := client.GroupCluster.EditCluster(26, 24, opt) - if err != nil { - t.Errorf("GroupCluster.EditCluster returned error: %v", err) - } + require.NoError(t, err, "GroupCluster.EditCluster should not return an error") + require.NotNil(t, cluster, "Cluster response should not be nil") want := &GroupCluster{ ID: 24, @@ -410,9 +389,8 @@ func TestEditGroupCluster(t *testing.T) { WebURL: "https://gitlab.example.com/group-with-clusters-api", }, } - if !reflect.DeepEqual(want, cluster) { - t.Errorf("GroupCluster.EditCluster returned %+v, want %+v", cluster, want) - } + + assert.Equal(t, want, cluster, "GroupCluster.EditCluster returned unexpected result") } func TestDeleteGroupCluster(t *testing.T) { @@ -424,7 +402,5 @@ func TestDeleteGroupCluster(t *testing.T) { }) _, err := client.GroupCluster.DeleteCluster(26, 23) - if err != nil { - t.Errorf("GroupCluster.DeleteCluster returned error: %v", err) - } + require.NoError(t, err, "GroupCluster.DeleteCluster should not return an error") } -- GitLab From 472e180d9ccaaea40d54effd569a7951e9e9ca67 Mon Sep 17 00:00:00 2001 From: zubeen Date: Thu, 23 Oct 2025 17:58:14 +0530 Subject: [PATCH 3/4] revert changes --- dockerfile_templates_test.go | 85 ++++++++++++++++++++++++++---------- 1 file changed, 63 insertions(+), 22 deletions(-) diff --git a/dockerfile_templates_test.go b/dockerfile_templates_test.go index af1eaea6..af74815c 100644 --- a/dockerfile_templates_test.go +++ b/dockerfile_templates_test.go @@ -19,9 +19,8 @@ package gitlab import ( "fmt" "net/http" + "reflect" "testing" - - "github.com/stretchr/testify/assert" ) func TestDockerfileTemplatesService_ListTemplates(t *testing.T) { @@ -31,28 +30,67 @@ func TestDockerfileTemplatesService_ListTemplates(t *testing.T) { mux.HandleFunc("/api/v4/templates/dockerfiles", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodGet) fmt.Fprintf(w, `[ - {"key":"Binary","name":"Binary"}, - {"key":"Binary-alpine","name":"Binary-alpine"}, - {"key":"Binary-scratch","name":"Binary-scratch"}, - {"key":"Golang","name":"Golang"}, - {"key":"Golang-alpine","name":"Golang-alpine"}, - {"key":"Golang-scratch","name":"Golang-scratch"} - ]`) + { + "key":"Binary", + "name":"Binary" + }, + { + "key":"Binary-alpine", + "name":"Binary-alpine" + }, + { + "key":"Binary-scratch", + "name":"Binary-scratch" + }, + { + "key":"Golang", + "name":"Golang" + }, + { + "key":"Golang-alpine", + "name":"Golang-alpine" + }, + { + "key":"Golang-scratch", + "name":"Golang-scratch" + } + ]`) }) templates, _, err := client.DockerfileTemplate.ListTemplates(&ListDockerfileTemplatesOptions{}) - assert.NoError(t, err, "DockerfileTemplate.ListTemplates should not return an error") + if err != nil { + t.Errorf("DockerfileTemplate.ListTemplates returned error: %v", err) + } want := []*DockerfileTemplateListItem{ - {Key: "Binary", Name: "Binary"}, - {Key: "Binary-alpine", Name: "Binary-alpine"}, - {Key: "Binary-scratch", Name: "Binary-scratch"}, - {Key: "Golang", Name: "Golang"}, - {Key: "Golang-alpine", Name: "Golang-alpine"}, - {Key: "Golang-scratch", Name: "Golang-scratch"}, + { + Key: "Binary", + Name: "Binary", + }, + { + Key: "Binary-alpine", + Name: "Binary-alpine", + }, + { + Key: "Binary-scratch", + Name: "Binary-scratch", + }, + { + Key: "Golang", + Name: "Golang", + }, + { + Key: "Golang-alpine", + Name: "Golang-alpine", + }, + { + Key: "Golang-scratch", + Name: "Golang-scratch", + }, + } + if !reflect.DeepEqual(want, templates) { + t.Errorf("DockerfileTemplate.ListTemplates returned %+v, want %+v", templates, want) } - - assert.Equal(t, want, templates, "DockerfileTemplate.ListTemplates returned unexpected result") } func TestDockerfileTemplatesService_GetTemplate(t *testing.T) { @@ -64,16 +102,19 @@ func TestDockerfileTemplatesService_GetTemplate(t *testing.T) { fmt.Fprintf(w, `{ "name": "Binary", "content": "# This file is a template, and might need editing before it works on your project." - }`) + }`) }) template, _, err := client.DockerfileTemplate.GetTemplate("Binary") - assert.NoError(t, err, "DockerfileTemplate.GetTemplate should not return an error") + if err != nil { + t.Errorf("DockerfileTemplate.GetTemplate returned error: %v", err) + } want := &DockerfileTemplate{ Name: "Binary", Content: "# This file is a template, and might need editing before it works on your project.", } - - assert.Equal(t, want, template, "DockerfileTemplate.GetTemplate returned unexpected result") + if !reflect.DeepEqual(want, template) { + t.Errorf("DockerfileTemplate.GetTemplate returned %+v, want %+v", template, want) + } } -- GitLab From d34b0ccc37958c7998e7af6d03f5a5ac583f8be3 Mon Sep 17 00:00:00 2001 From: zubeen Date: Thu, 23 Oct 2025 18:13:52 +0530 Subject: [PATCH 4/4] fix duo's review comments --- group_clusters_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/group_clusters_test.go b/group_clusters_test.go index 1492af3a..8577a871 100644 --- a/group_clusters_test.go +++ b/group_clusters_test.go @@ -277,6 +277,7 @@ func TestAddGroupCluster(t *testing.T) { AuthorizationType: "rbac", CaCert: "-----BEGIN CERTIFICATE-----\r\nAAAAA\r\n-----END CERTIFICATE-----", }, + ManagementProject: nil, Group: &Group{ ID: 26, Name: "group-with-clusters-api", -- GitLab