| 378 | } |
| 379 | |
| 380 | pub fn add_user_with_name( |
| 381 | env: &PocketIc, |
| 382 | user_name: String, |
| 383 | identity: Principal, |
| 384 | group_ids: Vec<String>, |
| 385 | station_canister_id: Principal, |
| 386 | ) -> UserDTO { |
| 387 | let add_user = RequestOperationInput::AddUser(AddUserOperationInput { |
| 388 | name: user_name, |
| 389 | identities: vec![identity], |
| 390 | groups: group_ids, |
| 391 | status: UserStatusDTO::Active, |
| 392 | }); |
| 393 | let add_user_request = submit_request(env, WALLET_ADMIN_USER, station_canister_id, add_user); |
| 394 | let new_request = wait_for_request( |
| 395 | env, |
| 396 | WALLET_ADMIN_USER, |
| 397 | station_canister_id, |
| 398 | add_user_request, |
| 399 | ) |
| 400 | .unwrap(); |
| 401 | match new_request.operation { |
| 402 | RequestOperationDTO::AddUser(add_user) => add_user.user.unwrap(), |
| 403 | _ => panic!("invalid request operation"), |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | pub fn get_user(env: &PocketIc, user_id: Principal, station_canister_id: Principal) -> UserDTO { |
| 408 | let res: (ApiResult<MeResponse>,) = |