Testing with into_make_service_with_connect_info
#748
-
I have been testing happily enough with something resembling the following:
But then I needed to extract After figuring out that it was the missing Updated listener creation to use port
Usage:
To be clear, I don't think this is terrible! It's all pretty much done once, using reqwest as a client is a bit more ergonomic anyway, and we're actually testing more of the stack. However, I can't help but wonder if it's a little overkill. Any thoughts? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Overkill how? It's how we test axum internally and we've had no issues with it. So seems fine to me 😊 Whilst I wouldn't recommend it a different way of "faking a connection" is that you manually insert a |
Beta Was this translation helpful? Give feedback.
Overkill how? It's how we test axum internally and we've had no issues with it.
So seems fine to me 😊
Whilst I wouldn't recommend it a different way of "faking a connection" is that you manually insert a
ConnectInfo
of the right type as an extension on the test request. The 500 you're seeing comes from the extension not being set. I wouldn't recommend this because there is no guarantee the internals won't change in the future, although we have no such plans currently.