@@ -511,25 +511,25 @@ func (ts *OAuthClientTestSuite) TestUserListOAuthGrants() {
511511 // Check response
512512 assert .Equal (ts .T (), http .StatusOK , w .Code )
513513
514- var response UserOAuthGrantsListResponse
515- err = json .Unmarshal (w .Body .Bytes (), & response )
514+ var grants [] UserOAuthGrantResponse
515+ err = json .Unmarshal (w .Body .Bytes (), & grants )
516516 require .NoError (ts .T (), err )
517517
518518 // Should have 2 grants
519- assert .Len (ts .T (), response . Grants , 2 )
519+ assert .Len (ts .T (), grants , 2 )
520520
521521 // Verify client details are included
522- for _ , grant := range response . Grants {
523- assert .NotEmpty (ts .T (), grant .ClientID )
524- assert .Equal (ts .T (), "Test Client" , grant .ClientName )
522+ for _ , grant := range grants {
523+ assert .NotEmpty (ts .T (), grant .Client . ID )
524+ assert .Equal (ts .T (), "Test Client" , grant .Client . Name )
525525 assert .NotEmpty (ts .T (), grant .Scopes )
526526 assert .NotEmpty (ts .T (), grant .GrantedAt )
527527 }
528528
529529 // Check that client1 (with read and write scopes) is in the response
530530 found := false
531- for _ , grant := range response . Grants {
532- if grant .ClientID == client1 .ID .String () {
531+ for _ , grant := range grants {
532+ if grant .Client . ID == client1 .ID .String () {
533533 found = true
534534 assert .Contains (ts .T (), grant .Scopes , "read" )
535535 assert .Contains (ts .T (), grant .Scopes , "write" )
@@ -553,12 +553,12 @@ func (ts *OAuthClientTestSuite) TestUserListOAuthGrantsEmpty() {
553553
554554 assert .Equal (ts .T (), http .StatusOK , w .Code )
555555
556- var response UserOAuthGrantsListResponse
557- err = json .Unmarshal (w .Body .Bytes (), & response )
556+ var grants [] UserOAuthGrantResponse
557+ err = json .Unmarshal (w .Body .Bytes (), & grants )
558558 require .NoError (ts .T (), err )
559559
560560 // Should have 0 grants
561- assert .Len (ts .T (), response . Grants , 0 )
561+ assert .Len (ts .T (), grants , 0 )
562562}
563563
564564func (ts * OAuthClientTestSuite ) TestUserListOAuthGrantsNoAuth () {
0 commit comments