File tree 3 files changed +23
-9
lines changed
service/access_control_lists/users
3 files changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -679,7 +679,7 @@ func TestListRoles(t *testing.T) {
679
679
},
680
680
},
681
681
Users : []* roles.GetUserInRoleResponse {},
682
- Status : redis .String ("active" ),
682
+ Status : redis .String (roles . StatusActive ),
683
683
},
684
684
{
685
685
ID : redis .Int (999 ),
@@ -711,7 +711,7 @@ func TestListRoles(t *testing.T) {
711
711
Name : redis .String ("test-user" ),
712
712
},
713
713
},
714
- Status : redis .String ("active" ),
714
+ Status : redis .String (roles . StatusActive ),
715
715
},
716
716
}, actual )
717
717
@@ -905,7 +905,7 @@ func TestGetRole(t *testing.T) {
905
905
Name : redis .String ("test-user" ),
906
906
},
907
907
},
908
- Status : redis .String ("active" ),
908
+ Status : redis .String (roles . StatusActive ),
909
909
}, actual )
910
910
911
911
}
Original file line number Diff line number Diff line change @@ -14,9 +14,10 @@ func (o ListUsersResponse) String() string {
14
14
}
15
15
16
16
type GetUserResponse struct {
17
- ID * int `json:"id,omitempty"`
18
- Name * string `json:"name,omitempty"`
19
- Role * string `json:"role,omitempty"`
17
+ ID * int `json:"id,omitempty"`
18
+ Name * string `json:"name,omitempty"`
19
+ Role * string `json:"role,omitempty"`
20
+ Status * string `json:"status,omitempty"`
20
21
}
21
22
22
23
func (o GetUserResponse ) String () string {
@@ -45,3 +46,14 @@ type UpdateUserRequest struct {
45
46
func (o UpdateUserRequest ) String () string {
46
47
return internal .ToString (o )
47
48
}
49
+
50
+ const (
51
+ // StatusActive is the active value of the `Status` field in `User`
52
+ StatusActive = "active"
53
+ // StatusPending is the pending value of the `Status` field in `User`
54
+ StatusPending = "pending"
55
+ // StatusError is the error value of the `Status` field in `User`
56
+ StatusError = "error"
57
+ // StatusDeleting is the deleting value of the `Status` field in `User`
58
+ StatusDeleting = "deleting"
59
+ )
Original file line number Diff line number Diff line change @@ -526,6 +526,7 @@ func TestGetUser(t *testing.T) {
526
526
"id": 20000,
527
527
"name": "test-user",
528
528
"role": "test-role",
529
+ "status": "pending",
529
530
"links": [
530
531
{
531
532
"rel": "self",
@@ -544,8 +545,9 @@ func TestGetUser(t *testing.T) {
544
545
require .NoError (t , err )
545
546
546
547
assert .Equal (t , & users.GetUserResponse {
547
- ID : redis .Int (20000 ),
548
- Name : redis .String ("test-user" ),
549
- Role : redis .String ("test-role" ),
548
+ ID : redis .Int (20000 ),
549
+ Name : redis .String ("test-user" ),
550
+ Role : redis .String ("test-role" ),
551
+ Status : redis .String (users .StatusPending ),
550
552
}, actual )
551
553
}
You can’t perform that action at this time.
0 commit comments