Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blind-oracle committed Jun 3, 2024
1 parent a6c30a5 commit d72da6a
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/routing/middleware/rate_limiter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@ use std::{net::IpAddr, sync::Arc, time::Duration};
use ::governor::{clock::QuantaInstant, middleware::NoOpMiddleware};
use anyhow::{anyhow, Error};
use axum::{extract::Request, response::IntoResponse};
use tower::{
layer::util::{Identity, Stack},
Layer, Service, ServiceBuilder,
};
use tower_governor::{
governor::GovernorConfigBuilder, key_extractor::KeyExtractor, GovernorError, GovernorLayer,
};
use tracing::debug;

use crate::{
http::ConnInfo,
Expand Down Expand Up @@ -87,7 +82,7 @@ mod tests {
http::{ConnInfo, Stats},
routing::{
error_cause::{ErrorCause, RateLimitCause},
middleware::rate_limiter::{build_rate_limiter_middleware, IpKeyExtractor},
middleware::rate_limiter::{build_middleware, IpKeyExtractor},
},
};

Expand Down Expand Up @@ -117,7 +112,7 @@ mod tests {
let burst_size = 5;

let rate_limiter_mw =
build_rate_limiter_middleware(rps, burst_size, IpKeyExtractor, RateLimitCause::Normal)
build_middleware(rps, burst_size, IpKeyExtractor, RateLimitCause::Normal)
.expect("failed to build middleware");

let mut app = Router::new()
Expand Down Expand Up @@ -149,7 +144,7 @@ mod tests {
let burst_size = 1;

let rate_limiter_mw =
build_rate_limiter_middleware(rps, burst_size, IpKeyExtractor, RateLimitCause::Normal)
build_middleware(rps, burst_size, IpKeyExtractor, RateLimitCause::Normal)
.expect("failed to build middleware");

let mut app = Router::new()
Expand Down Expand Up @@ -185,7 +180,7 @@ mod tests {
let burst_size = 1;

let rate_limiter_mw =
build_rate_limiter_middleware(rps, burst_size, IpKeyExtractor, RateLimitCause::Normal)
build_middleware(rps, burst_size, IpKeyExtractor, RateLimitCause::Normal)
.expect("failed to build middleware");

let mut app = Router::new()
Expand Down

0 comments on commit d72da6a

Please sign in to comment.