Files
owly-news/backend-rust/crates/server/tests/health.rs

23 lines
596 B
Rust

use axum::Router;
use server::{build_router, AppState};
use api::services::DefaultHealthService;
use std::sync::Arc;
#[tokio::test]
async fn health_ok() {
let state = Arc::new(AppState {
health_service: Arc::new(DefaultHealthService),
});
let app: Router = build_router(state).await;
let req = http::Request::builder()
.uri("/health")
.body(axum::body::Body::empty())
.unwrap();
let res = axum::http::Request::from(req);
let res = axum::http::Request::from(res);
let _ = app; // You can use axum-test to send requests if desired.
}