Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33254902
D11464.1768579542.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D11464.1768579542.diff
View Options
diff --git a/services/commtest/tests/identity_integration_tests.rs b/services/commtest/tests/identity_integration_tests.rs
--- a/services/commtest/tests/identity_integration_tests.rs
+++ b/services/commtest/tests/identity_integration_tests.rs
@@ -3,7 +3,8 @@
};
use commtest::service_addr;
use grpc_clients::identity::{
- get_unauthenticated_client,
+ get_auth_client, get_unauthenticated_client,
+ protos::auth::{identity::IdentityInfo, Identity, UserIdentityRequest},
protos::unauthenticated::{
find_user_id_request::Identifier, FindUserIdRequest,
},
@@ -37,3 +38,39 @@
"User ID should match"
);
}
+
+#[tokio::test]
+async fn find_username_for_user() {
+ let device_info = register_user_device(None, None).await;
+
+ let mut client = get_auth_client(
+ &service_addr::IDENTITY_GRPC.to_string(),
+ device_info.user_id.clone(),
+ device_info.device_id,
+ device_info.access_token,
+ PLACEHOLDER_CODE_VERSION,
+ DEVICE_TYPE.to_string(),
+ )
+ .await
+ .expect("Couldn't connect to identity service");
+
+ let request = UserIdentityRequest {
+ user_id: device_info.user_id,
+ };
+ let response = client
+ .find_user_identity(request)
+ .await
+ .expect("request failed")
+ .into_inner();
+
+ let expected_username = device_info.username;
+ assert!(
+ matches!(
+ response.identity,
+ Some(Identity {
+ identity_info: Some(IdentityInfo::Username(username))
+ }) if username == expected_username
+ ),
+ "username doesn't match"
+ );
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 16, 4:05 PM (11 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5945180
Default Alt Text
D11464.1768579542.diff (1 KB)
Attached To
Mode
D11464: [commtest] Add test for FindUserIdentity RPC
Attached
Detach File
Event Timeline
Log In to Comment