1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

Upgrade axum to 0.6.0-rc.1

This commit is contained in:
Quentin Gliech
2022-09-05 12:15:51 +02:00
parent b15b2d0c21
commit fa47f6e150
37 changed files with 501 additions and 378 deletions

View File

@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use axum::{extract::Extension, response::IntoResponse};
use axum::{extract::State, response::IntoResponse};
use mas_axum_utils::FancyError;
use sqlx::PgPool;
use tracing::{info_span, Instrument};
pub async fn get(Extension(pool): Extension<PgPool>) -> Result<impl IntoResponse, FancyError> {
pub async fn get(State(pool): State<PgPool>) -> Result<impl IntoResponse, FancyError> {
let mut conn = pool.acquire().await?;
sqlx::query("SELECT $1")
@@ -38,7 +38,9 @@ mod tests {
#[sqlx::test(migrator = "mas_storage::MIGRATOR")]
async fn test_get_health(pool: PgPool) -> Result<(), anyhow::Error> {
let app = crate::test_router(&pool).await?;
let state = crate::test_state(pool).await?;
let app = crate::api_router(state);
let request = Request::builder().uri("/health").body(Body::empty())?;
let response = app.oneshot(request).await?;