Files
pruefwerk/compliance-agent/tests/integration/api/openapi.rs
T
sharang 32332f65bb
CI / Check (push) Skipped
CI / Agent integration (push) Skipped
CI / Detect Changes (push) Successful in 3s
CI / Deploy Docs (push) Successful in 1m11s
CI / Deploy MCP (push) Successful in 4m56s
CI / Deploy Dashboard (push) Successful in 6m45s
CI / Deploy Agent (push) Successful in 8m52s
feat(api): the agent serves an OpenAPI description, starting with DAST (#1006) (#1012)
2026-11-16 13:10:26 +00:00

23 lines
746 B
Rust

use crate::common::TestServer;
/// The agent serves its OpenAPI description (#1006), with the described
/// routes and the bearer scheme.
#[tokio::test]
async fn the_agent_serves_its_openapi_description() {
let server = TestServer::start().await;
let resp = server.get("/api/v1/openapi.json").await;
assert_eq!(resp.status(), 200);
assert_eq!(
resp.headers()["content-type"].to_str().unwrap(),
"application/json"
);
let doc: serde_json::Value = resp.json().await.unwrap();
assert_eq!(doc["info"]["title"], "Prüfwerk API");
assert!(doc["paths"]["/api/v1/dast/targets"]["post"].is_object());
assert!(doc["components"]["securitySchemes"]["bearer"].is_object());
server.cleanup().await;
}