Skip to content

Commit

Permalink
fix: lambda functions for tests
Browse files Browse the repository at this point in the history
Co-authored-by: Trong Huu Nguyen <[email protected]>
Co-authored-by: Tommy Trøen <[email protected]>
  • Loading branch information
3 people committed Nov 8, 2024
1 parent a2330c2 commit e5aeabd
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ mod tests {
use serde_json::{json, Value};
use std::collections::HashMap;
use std::fmt::Debug;
use axum::response::IntoResponse;
use testcontainers::{ContainerAsync, GenericImage};

/// Test a full round-trip of the `/token`, `/token/exchange`, and `/introspect` endpoints.
Expand Down Expand Up @@ -215,7 +214,6 @@ mod tests {

#[cfg(test)]
impl TokenServer {

async fn new() -> Self {
let mut keys = HashMap::<String, Vec<jwk::JsonWebKey>>::new();
keys.insert("keys".to_string(), vec![get_signing_key()]);
Expand All @@ -234,14 +232,10 @@ mod tests {
.route("/token", get(|| async {
"Hello, world!"
}))
.route("/jwks", get(self.jwks()));
.route("/jwks", get(|| async { Json(self.keys) }));

axum::serve(self.listener, app).await
}

fn jwks(&self) -> Json<HashMap<String, Vec<jwk::JsonWebKey>>> {
Json(self.keys.clone())
}
}

#[tokio::test]
Expand Down

0 comments on commit e5aeabd

Please sign in to comment.