keyforkd: complicate middleware test
This commit is contained in:
parent
b810ab2e90
commit
8510e382d2
|
@ -100,6 +100,14 @@ mod tests {
|
|||
field: String,
|
||||
}
|
||||
|
||||
impl Test {
|
||||
fn new() -> Self {
|
||||
Self {
|
||||
field: "hello world!".to_string()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct App;
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
|
@ -118,15 +126,16 @@ mod tests {
|
|||
}
|
||||
|
||||
fn call(&mut self, req: Test) -> Self::Future {
|
||||
Box::pin(async { Ok(req) })
|
||||
Box::pin(async {
|
||||
assert_eq!(req.field, Test::new().field);
|
||||
Ok(req)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn can_serde_responses() {
|
||||
let content = serialize(&Test {
|
||||
field: "hello world!".to_string(),
|
||||
})
|
||||
let content = serialize(&Test::new())
|
||||
.unwrap();
|
||||
let mut service = ServiceBuilder::new()
|
||||
.layer(BincodeLayer::<Test>::new())
|
||||
|
|
Loading…
Reference in New Issue