1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 15:07:42 +02:00

refactor http-test server

This commit is contained in:
Nikolay Kim
2019-12-12 23:08:38 +06:00
parent db1d6b7963
commit 4937c9f9c2
17 changed files with 252 additions and 296 deletions

View File

@ -3,7 +3,7 @@ use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
use actix_http::HttpService;
use actix_http_test::TestServer;
use actix_http_test::test_server;
use actix_service::{pipeline_factory, ServiceFactory};
use actix_web::http::Version;
use actix_web::{web, App, HttpResponse};
@ -36,7 +36,7 @@ async fn test_connection_reuse_h2() {
let num = Arc::new(AtomicUsize::new(0));
let num2 = num.clone();
let srv = TestServer::start(move || {
let srv = test_server(move || {
let num2 = num2.clone();
pipeline_factory(move |io| {
num2.fetch_add(1, Ordering::Relaxed);