devboy_confluence/
liveness.rs1use async_trait::async_trait;
15use devboy_core::LivenessProbe;
16
17use crate::client::ConfluenceClient;
18
19#[async_trait]
20impl LivenessProbe for ConfluenceClient {
21 fn provider_name(&self) -> &str {
22 "confluence"
23 }
24}
25
26#[cfg(test)]
27mod tests {
28 use super::*;
29 use crate::client::ConfluenceAuth;
30 use devboy_core::liveness::LivenessStatus;
31 use secrecy::SecretString;
32
33 #[tokio::test]
34 async fn provider_name_is_confluence_and_default_returns_not_implemented() {
35 let client = ConfluenceClient::new(
36 "https://example.atlassian.net/wiki",
37 ConfluenceAuth::BearerToken(SecretString::from("any".to_owned())),
38 );
39 assert_eq!(client.provider_name(), "confluence");
40 let r = client
41 .test(&SecretString::from("any".to_owned()))
42 .await
43 .unwrap();
44 assert_eq!(r.status, LivenessStatus::NotImplemented);
45 assert!(r.detail.unwrap().contains("confluence"));
46 }
47}