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; }