examples: Simplify Request and Response construction (#3653)

This commit is contained in:
tottoto
2026-02-11 09:08:22 +01:00
committed by GitHub
parent 57e2455905
commit 3f8956dcd0
8 changed files with 20 additions and 64 deletions
+2 -12
View File
@@ -83,12 +83,7 @@ mod tests {
#[tokio::test]
async fn test_v1() {
let response = app()
.oneshot(
Request::builder()
.uri("/v1/foo")
.body(Body::empty())
.unwrap(),
)
.oneshot(Request::get("/v1/foo").body(Body::empty()).unwrap())
.await
.unwrap();
@@ -103,12 +98,7 @@ mod tests {
#[tokio::test]
async fn test_v4() {
let response = app()
.oneshot(
Request::builder()
.uri("/v4/foo")
.body(Body::empty())
.unwrap(),
)
.oneshot(Request::get("/v4/foo").body(Body::empty()).unwrap())
.await
.unwrap();