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

pub struct TestServer { /* fields omitted */ }

The TestServer type.

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

Examples

use actix_web::test::TestServer;

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

let req = srv.get().finish().unwrap();
let response = srv.execute(req.send()).unwrap();
assert!(response.status().is_success());

Methods

impl TestServer
[src]

Start new test server

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

Create test server builder

Create test server builder with specific state factory

This method can be used for constructing application state. Also it can be used for external dependency initialization, like creating sync actors for diesel integration.

Start new test server with application factory

Get firat available unused address

Construct test server url

Construct test server url

Execute future on current core

Connect to websocket server at a given path

Connect to a websocket server

Create GET request

Create POST request

Create HEAD request

Connect to test http server

Trait Implementations

impl Drop for TestServer
[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl !Send for TestServer

impl !Sync for TestServer

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Erased for T