M src/service/gotify.rs => src/service/gotify.rs +25 -0
@@ 53,3 53,28 @@ impl Service for GotifyService {
Ok(())
}
}
+
+#[cfg(test)]
+mod tests {
+ use crate::config::Config;
+
+ use super::*;
+
+ #[tokio::test]
+ async fn config() {
+ Config::from_str(
+ r#"
+ [services.g]
+ type = "gotify"
+ instance = "gotify.tld"
+ token = "secret"
+ "#,
+ )
+ .await
+ .unwrap()
+ .services["g"]
+ .as_any()
+ .downcast_ref::<GotifyConfig>()
+ .unwrap();
+ }
+}
M src/service/matrix.rs => src/service/matrix.rs +26 -0
@@ 97,3 97,29 @@ impl Service for MatrixService {
Ok(())
}
}
+
+#[cfg(test)]
+mod tests {
+ use crate::config::Config;
+
+ use super::*;
+
+ #[tokio::test]
+ async fn config() {
+ Config::from_str(
+ r#"
+ [services.m]
+ type = "matrix"
+ instance = "matrix.tld"
+ token = "secret"
+ room = "!room:matrix.tld"
+ "#,
+ )
+ .await
+ .unwrap()
+ .services["m"]
+ .as_any()
+ .downcast_ref::<MatrixConfig>()
+ .unwrap();
+ }
+}