rusmes_loadtest/protocols/
jmap.rs1use anyhow::Result;
4
5pub struct JmapClient;
7
8impl JmapClient {
9 #[allow(dead_code)]
11 pub async fn query_messages(host: &str, port: u16) -> Result<usize> {
12 let _url = format!("http://{}:{}/jmap", host, port);
13
14 let _request = serde_json::json!({
17 "using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail"],
18 "methodCalls": [
19 ["Email/query", {
20 "accountId": "user@example.com",
21 "filter": {},
22 "sort": [{"property": "receivedAt", "isAscending": false}],
23 "limit": 10
24 }, "c1"]
25 ]
26 });
27
28 Ok(1024)
30 }
31}
32
33#[cfg(test)]
34mod tests {
35 use super::*;
36
37 #[tokio::test]
38 async fn test_jmap_client_mock() {
39 let result = JmapClient::query_messages("localhost", 8080).await;
41 assert!(result.is_ok());
42 }
43}