pub struct Test {
    pub configs: TypeMap,
    pub compositions: Vec<Composition>,
}
Expand description

A single test which brings up one or more Servers.

A Test receives Configs via register which determines the servers that will be brought up when the test is executed. The run method is used to bring up the Servers and then run the given test body.

The body of a test is determined by an async closure passed to the run method. The closure will receive a TestInstance which can be used to access the Servers that were created when the test was setup.

Fields

configs: TypeMapcompositions: Vec<Composition>

Implementations

Creates an empty Test.

Registers a Config with this test.

A Test can be configured with any number of Configs for determining which Servers are brought up in a test. Each Config passed will have it’s respective Server created before the test body is ran.

Brings up the Servers registered with this test and then runs the given test body.

The test body receives a TestInstance which can be used for accessing any configured Servers through the server method. The test body is guaranteed to not execute until all configured Servers are verified to be running and available. The scope of the test body determines the life of the Servers: they are created before the closure is run and destroyed after the closure exits.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more