@@ -48,6 +48,19 @@ func TestAccGitlabGroupAccessToken_basic(t *testing.T) {
48
48
}),
49
49
),
50
50
},
51
+ // Update the Group Access Token Access Level to Owner
52
+ {
53
+ Config : testAccGitlabGroupAccessTokenUpdateAccessLevel (testGroup .ID ),
54
+ Check : resource .ComposeTestCheckFunc (
55
+ testAccCheckGitlabGroupAccessTokenExists ("gitlab_group_access_token.this" , & gat ),
56
+ testAccCheckGitlabGroupAccessTokenAttributes (& gat , & testAccGitlabGroupAccessTokenExpectedAttributes {
57
+ name : "my new group token" ,
58
+ scopes : map [string ]bool {"read_repository" : false , "api" : true , "write_repository" : false , "read_api" : false },
59
+ expiresAt : "2099-05-01" ,
60
+ accessLevel : gitlab .AccessLevelValue (gitlab .OwnerPermissions ),
61
+ }),
62
+ ),
63
+ },
51
64
// Add a CICD variable with Group Access Token value
52
65
{
53
66
Config : testAccGitlabGroupAccessTokenUpdateConfigWithCICDvar (testGroup .ID ),
@@ -229,6 +242,18 @@ resource "gitlab_group_access_token" "this" {
229
242
` , groupId )
230
243
}
231
244
245
+ func testAccGitlabGroupAccessTokenUpdateAccessLevel (groupId int ) string {
246
+ return fmt .Sprintf (`
247
+ resource "gitlab_group_access_token" "this" {
248
+ name = "my new group token"
249
+ group = %d
250
+ expires_at = "2099-05-01"
251
+ access_level = "owner"
252
+ scopes = ["api"]
253
+ }
254
+ ` , groupId )
255
+ }
256
+
232
257
func testAccGitlabGroupAccessTokenUpdateConfigWithCICDvar (groupId int ) string {
233
258
return fmt .Sprintf (`
234
259
resource "gitlab_group_access_token" "this" {
0 commit comments