use camel_bean::handler;
#[allow(dead_code)]
struct TestService;
#[allow(dead_code)]
impl TestService {
#[handler]
pub async fn process_body(&self, body: String) -> Result<String, String> {
Ok(format!("processed: {}", body))
}
#[handler]
pub async fn process_with_headers(
&self,
_body: String,
_headers: std::collections::HashMap<String, String>,
) -> Result<String, String> {
Ok("processed with headers".to_string())
}
#[handler]
pub async fn process_exchange(
&self,
_exchange: &mut camel_api::Exchange,
) -> Result<(), String> {
Ok(())
}
#[handler]
pub async fn simple(&self) -> Result<String, String> {
Ok("simple".to_string())
}
pub fn helper(&self) -> String {
"helper".to_string()
}
pub async fn not_a_handler(&self) -> String {
"not a handler".to_string()
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_handler_attribute_compiles() {
let _service = TestService;
}
#[test]
fn test_multiple_handlers_allowed() {
let _service = TestService;
}
}