Struct actix_web::test::TestServer [] [src]

pub struct TestServer { /* fields omitted */ }

The TestServer type.

TestServer is very simple test server that simplify process of writing integrational tests cases for actix web applications.

Examples

use actix_web::test::TestServer;

let srv = TestServer::new(|app| app.handler(my_handler));

assert!(reqwest::get(&srv.url("/")).unwrap().status().is_success());

Methods

impl TestServer
[src]

[src]

Start new test server

This methos accepts configuration method. You can add middlewares or set handlers for test application.

[src]

Start new test server with application factory

[src]

Start new test server with custom application state

This methos accepts state factory and configuration method.

[src]

Get firat available unused address

[src]

Construct test server url

[src]

Construct test server url

Trait Implementations

impl Drop for TestServer
[src]

[src]

Executes the destructor for this type. Read more