@@ -178,11 +178,11 @@ func TestRemoveProjectFromJobScopeAllowList(t *testing.T) {
178178 assert .Equal (t , 204 , resp .StatusCode )
179179}
180180
181- // This tests that when calling the GetProjectJobTokenInboundGroupsAllowList , we
182- // get a list of groups back properly . There isn't a "deep" test with every
183- // attribute specified, because the object returned is a *Group object, which
184- // is already tested in groups.go.
185- func TestGetProjectJobTokenInboundGroupsAllowList (t * testing.T ) {
181+ // This tests that when calling the GetJobTokenAllowlistGroups , we get a list
182+ // of groups back. There isn't a "deep" test with every attribute specified,
183+ // because the object returned is a *Group object, which is already tested in
184+ // groups.go.
185+ func TestGetJobTokenAllowlistGroups (t * testing.T ) {
186186 mux , client := setup (t )
187187
188188 // Handle project ID 1, and print a result of two groups
@@ -194,16 +194,16 @@ func TestGetProjectJobTokenInboundGroupsAllowList(t *testing.T) {
194194 })
195195
196196 want := []* Group {{ID : 1 }, {ID : 2 }}
197- groups , _ , err := client .JobTokenScope .GetProjectJobTokenInboundGroupsAllowList (
197+ groups , _ , err := client .JobTokenScope .GetJobTokenAllowlistGroups (
198198 1 ,
199- & GetJobTokenInboundGroupsAllowListOptions {},
199+ & GetJobTokenAllowlistGroupsOptions {},
200200 )
201201
202202 assert .NoError (t , err )
203203 assert .Equal (t , want , groups )
204204}
205205
206- func TestAddGroupToJobScopeGroupsAllowList (t * testing.T ) {
206+ func TestAddGroupToJobTokenAllowlist (t * testing.T ) {
207207 mux , client := setup (t )
208208
209209 mux .HandleFunc ("/api/v4/projects/1/job_token_scope/groups_allowlist" , func (w http.ResponseWriter , r * http.Request ) {
@@ -212,14 +212,14 @@ func TestAddGroupToJobScopeGroupsAllowList(t *testing.T) {
212212 // Read the request to determine which target group is passed in
213213 body , err := io .ReadAll (r .Body )
214214 if err != nil {
215- t .Fatalf ("JobTokenScope.AddGroupToJobScopeGroupsAllowList failed to read body" )
215+ t .Fatalf ("JobTokenScope.AddGroupToJobTokenAllowlist failed to read body" )
216216 }
217217
218218 // Parse to object to ensure it's sent on the request appropriately.
219- var createTokenRequest JobTokenInboundGroupsAllowOptions
219+ var createTokenRequest AddGroupToJobTokenAllowlistOptions
220220 err = json .Unmarshal (body , & createTokenRequest )
221221 if err != nil {
222- t .Fatalf ("JobTokenScope.AddGroupToJobScopeGroupsAllowList failed to unmarshal body: %v" , err )
222+ t .Fatalf ("JobTokenScope.AddGroupToJobTokenAllowlist failed to unmarshal body: %v" , err )
223223 }
224224
225225 // Ensure we provide the proper response
@@ -232,21 +232,21 @@ func TestAddGroupToJobScopeGroupsAllowList(t *testing.T) {
232232 }` , * createTokenRequest .TargetGroupID )
233233 })
234234
235- want := & JobTokenInboundGroupsAllowItem {
235+ want := & JobTokenAllowlistItem {
236236 SourceProjectID : 1 ,
237237 TargetGroupID : 2 ,
238238 }
239239
240- addTokenResponse , resp , err := client .JobTokenScope .AddGroupToJobScopeGroupsAllowList (
240+ addTokenResponse , resp , err := client .JobTokenScope .AddGroupToJobTokenAllowlist (
241241 1 ,
242- & JobTokenInboundGroupsAllowOptions {TargetGroupID : Ptr (2 )},
242+ & AddGroupToJobTokenAllowlistOptions {TargetGroupID : Ptr (2 )},
243243 )
244244 assert .NoError (t , err )
245245 assert .Equal (t , want , addTokenResponse )
246246 assert .Equal (t , 201 , resp .StatusCode )
247247}
248248
249- func TestRemoveGroupFromJobScopeGroupsAllowList (t * testing.T ) {
249+ func TestRemoveGroupFromJobTokenAllowlist (t * testing.T ) {
250250 mux , client := setup (t )
251251
252252 mux .HandleFunc ("/api/v4/projects/1/job_token_scope/groups_allowlist/2" , func (w http.ResponseWriter , r * http.Request ) {
@@ -255,12 +255,12 @@ func TestRemoveGroupFromJobScopeGroupsAllowList(t *testing.T) {
255255 // Read the request to determine which target group is passed in
256256 body , err := io .ReadAll (r .Body )
257257 if err != nil {
258- t .Fatalf ("JobTokenScope.RemoveGroupFromJobScopeGroupsAllowList failed to read body" )
258+ t .Fatalf ("JobTokenScope.RemoveGroupFromJobTokenAllowlist failed to read body" )
259259 }
260260
261261 // The body should be empty since all attributes are passed in the path
262262 if body != nil && string (body ) != "" {
263- t .Fatalf ("JobTokenScope.RemoveGroupFromJobScopeGroupsAllowList failed to unmarshal body: %v" , err )
263+ t .Fatalf ("JobTokenScope.RemoveGroupFromJobTokenAllowlist failed to unmarshal body: %v" , err )
264264 }
265265
266266 // Ensure we provide the proper response
@@ -270,7 +270,7 @@ func TestRemoveGroupFromJobScopeGroupsAllowList(t *testing.T) {
270270 fmt .Fprint (w , "" )
271271 })
272272
273- resp , err := client .JobTokenScope .RemoveGroupFromJobScopeGroupsAllowList (1 , 2 )
273+ resp , err := client .JobTokenScope .RemoveGroupFromJobTokenAllowlist (1 , 2 )
274274 assert .NoError (t , err )
275275 assert .Equal (t , 204 , resp .StatusCode )
276276}
0 commit comments