File tree Expand file tree Collapse file tree 2 files changed +28
-28
lines changed Expand file tree Collapse file tree 2 files changed +28
-28
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,34 @@ func TestTenantGetUser(t *testing.T) {
9090 }
9191}
9292
93+ func TestTenantQueryUsers (t * testing.T ) {
94+ resp := `{
95+ "usersInfo": [],
96+ "recordsCount": "0"
97+ }`
98+ s := echoServer ([]byte (resp ), t )
99+ defer s .Close ()
100+
101+ tenantClient , err := s .Client .TenantManager .AuthForTenant ("test-tenant" )
102+ if err != nil {
103+ t .Fatalf ("Failed to create tenant client: %v" , err )
104+ }
105+
106+ query := & QueryUsersRequest {
107+ ReturnUserInfo : true ,
108+ }
109+
110+ _ , err = tenantClient .QueryUsers (context .Background (), query )
111+ if err != nil {
112+ t .Fatalf ("QueryUsers() with tenant client = %v" , err )
113+ }
114+
115+ wantPath := "/projects/mock-project-id/tenants/test-tenant/accounts:query"
116+ if s .Req [0 ].RequestURI != wantPath {
117+ t .Errorf ("QueryUsers() URL = %q; want = %q" , s .Req [0 ].RequestURI , wantPath )
118+ }
119+ }
120+
93121func TestTenantGetUserByEmail (t * testing.T ) {
94122 s := echoServer (testGetUserResponse , t )
95123 defer s .Close ()
Original file line number Diff line number Diff line change @@ -2005,34 +2005,6 @@ func TestQueryUsersError(t *testing.T) {
20052005 }
20062006}
20072007
2008- func TestQueryUsersWithTenant (t * testing.T ) {
2009- resp := `{
2010- "usersInfo": [],
2011- "recordsCount": "0"
2012- }`
2013- s := echoServer ([]byte (resp ), t )
2014- defer s .Close ()
2015-
2016- tenantClient , err := s .Client .TenantManager .AuthForTenant ("test-tenant" )
2017- if err != nil {
2018- t .Fatalf ("Failed to create tenant client: %v" , err )
2019- }
2020-
2021- query := & QueryUsersRequest {
2022- ReturnUserInfo : true ,
2023- }
2024-
2025- _ , err = tenantClient .QueryUsers (context .Background (), query )
2026- if err != nil {
2027- t .Fatalf ("QueryUsers() with tenant client = %v" , err )
2028- }
2029-
2030- wantPath := "/projects/mock-project-id/tenants/test-tenant/accounts:query"
2031- if s .Req [0 ].RequestURI != wantPath {
2032- t .Errorf ("QueryUsers() URL = %q; want = %q" , s .Req [0 ].RequestURI , wantPath )
2033- }
2034- }
2035-
20362008func TestMakeExportedUser (t * testing.T ) {
20372009 queryResponse := & userQueryResponse {
20382010 UID : "testuser" ,
You can’t perform that action at this time.
0 commit comments