You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[cfg(test)]
mod tests {
#[test]
fn test_function() {
let app = Route::new().at("/", TestHandler); // This is imported, but throws error:
// trait bound for TestHandler: poem:Endpoint is not implemented.
let cli = TestClient::new(app);
let resp = cli.get("/").send().await;
resp.assert_text("test").await;
}
}
Code like this throws the trait impl error in the comment section.
Also using the example from poem-openapi/tests it would work, though I need to pass PG conn with openapiservice.data, which will make the TestClient not accept the AddDataEndpoint<Box<dyn Endpoint<Output = poem::Response>>, Pool> type.
Is the a way to use an openapiservice with data appended?
The text was updated successfully, but these errors were encountered:
Hello!
I would like to ask for assistance about writing integration tests in poem-openapi.
So far I have some handlers like:
creating function in tests/test.rs
Code like this throws the trait impl error in the comment section.
Also using the example from poem-openapi/tests it would work, though I need to pass PG conn with
openapiservice.data
, which will make the TestClient not accept the AddDataEndpoint<Box<dyn Endpoint<Output = poem::Response>>, Pool> type.Is the a way to use an openapiservice with data appended?
The text was updated successfully, but these errors were encountered: