summaryrefslogtreecommitdiff
path: root/tests/src/directory/ldap.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/directory/ldap.rs')
-rw-r--r--tests/src/directory/ldap.rs30
1 files changed, 21 insertions, 9 deletions
diff --git a/tests/src/directory/ldap.rs b/tests/src/directory/ldap.rs
index 2435cf88..41245794 100644
--- a/tests/src/directory/ldap.rs
+++ b/tests/src/directory/ldap.rs
@@ -6,10 +6,10 @@
use std::fmt::Debug;
-use directory::{backend::internal::manage::ManageDirectory, Principal, QueryBy, Type};
+use directory::{backend::internal::manage::ManageDirectory, QueryBy, Type};
use mail_send::Credentials;
-use crate::directory::{map_account_ids, DirectoryTest};
+use crate::directory::{map_account_ids, DirectoryTest, IntoTestPrincipal, TestPrincipal};
#[tokio::test]
async fn ldap_directory() {
@@ -40,14 +40,19 @@ async fn ldap_directory() {
.await
.unwrap()
.unwrap()
+ .into_test()
.into_sorted(),
- Principal {
+ TestPrincipal {
id: base_store.get_account_id("john").await.unwrap().unwrap(),
name: "john".to_string(),
description: "John Doe".to_string().into(),
secrets: vec!["12345".to_string()],
typ: Type::Individual,
- member_of: map_account_ids(base_store, vec!["sales"]).await,
+ member_of: map_account_ids(base_store, vec!["sales"])
+ .await
+ .into_iter()
+ .map(|v| v.to_string())
+ .collect(),
emails: vec![
"john@example.org".to_string(),
"john.doe@example.org".to_string()
@@ -68,8 +73,9 @@ async fn ldap_directory() {
.await
.unwrap()
.unwrap()
+ .into_test()
.into_sorted(),
- Principal {
+ TestPrincipal {
id: base_store.get_account_id("bill").await.unwrap().unwrap(),
name: "bill".to_string(),
description: "Bill Foobar".to_string().into(),
@@ -102,14 +108,19 @@ async fn ldap_directory() {
.await
.unwrap()
.unwrap()
+ .into_test()
.into_sorted(),
- Principal {
+ TestPrincipal {
id: base_store.get_account_id("jane").await.unwrap().unwrap(),
name: "jane".to_string(),
description: "Jane Doe".to_string().into(),
typ: Type::Individual,
secrets: vec!["abcde".to_string()],
- member_of: map_account_ids(base_store, vec!["sales", "support"]).await,
+ member_of: map_account_ids(base_store, vec!["sales", "support"])
+ .await
+ .into_iter()
+ .map(|v| v.to_string())
+ .collect(),
emails: vec!["jane@example.org".to_string(),],
..Default::default()
}
@@ -122,8 +133,9 @@ async fn ldap_directory() {
.query(QueryBy::Name("sales"), true)
.await
.unwrap()
- .unwrap(),
- Principal {
+ .unwrap()
+ .into_test(),
+ TestPrincipal {
id: base_store.get_account_id("sales").await.unwrap().unwrap(),
name: "sales".to_string(),
description: "sales".to_string().into(),