24 lines
623 B
Rust
24 lines
623 B
Rust
use axum::{
|
|
body::Body,
|
|
http::{Method, Request, StatusCode},
|
|
};
|
|
use tower::ServiceExt;
|
|
|
|
#[tokio::test]
|
|
async fn operation_system_router_exposes_health_endpoint() {
|
|
let app = app_operation_system::build_router(app_operation_system::app::test_state());
|
|
|
|
let response = app
|
|
.oneshot(
|
|
Request::builder()
|
|
.method(Method::GET)
|
|
.uri("/api/health")
|
|
.body(Body::empty())
|
|
.expect("request should build"),
|
|
)
|
|
.await
|
|
.expect("router should answer request");
|
|
|
|
assert_eq!(response.status(), StatusCode::OK);
|
|
}
|