()
| 1172 | #[test] |
| 1173 | #[cfg(feature = "apigw_rest")] |
| 1174 | fn deserializes_request_authorizer() { |
| 1175 | let input = include_str!("../../lambda-events/src/fixtures/example-apigw-request.json"); |
| 1176 | let result = from_str(input); |
| 1177 | assert!( |
| 1178 | result.is_ok(), |
| 1179 | "event was not parsed as expected {result:?} given {input}" |
| 1180 | ); |
| 1181 | let req = result.expect("failed to parse request"); |
| 1182 | |
| 1183 | let req_context = req.request_context_ref().expect("Request is missing RequestContext"); |
| 1184 | let authorizer = req_context.authorizer().expect("authorizer is missing"); |
| 1185 | assert_eq!(Some("admin"), authorizer.fields.get("principalId").unwrap().as_str()); |
| 1186 | } |
| 1187 | |
| 1188 | #[test] |
| 1189 | #[cfg(all(feature = "apigw_http", feature = "vpc_lattice"))] |
nothing calls this directly
no test coverage detected