MCPcopy Index your code
hub / github.com/aws/aws-lambda-rust-runtime / test_ok_response

Function test_ok_response

lambda-runtime/src/runtime.rs:599–620  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

597
598 #[tokio::test]
599 async fn test_ok_response() -> Result<(), Error> {
600 let server = MockServer::start();
601
602 let mock = server.mock(|when, then| {
603 when.method(POST)
604 .path("/2018-06-01/runtime/invocation/156cb537-e2d4-11e8-9b34-d36013741fb9/response")
605 .body("\"{}\"");
606 then.status(200).body("");
607 });
608
609 let base = server.base_url().parse().expect("Invalid mock server Uri");
610 let client = Client::builder().with_endpoint(base).build()?;
611
612 let req = EventCompletionRequest::new("156cb537-e2d4-11e8-9b34-d36013741fb9", "{}");
613 let req = req.into_req()?;
614
615 let rsp = client.call(req).await?;
616
617 mock.assert_async().await;
618 assert_eq!(rsp.status(), StatusCode::OK);
619 Ok(())
620 }
621
622 #[tokio::test]
623 async fn test_error_response() -> Result<(), Error> {

Callers

nothing calls this directly

Calls 4

buildMethod · 0.80
with_endpointMethod · 0.80
into_reqMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected