pub struct TestApp {
pub app: Application,
pub container: Arc<Container>,
}Expand description
Test application for integration testing
Fields§
§app: Application§container: Arc<Container>Implementations§
Source§impl TestApp
impl TestApp
Sourcepub fn client(&self) -> TestClient
pub fn client(&self) -> TestClient
Create a test client for making requests
§Examples
use armature_testing::TestAppBuilder;
use armature_core::HttpResponse;
let app = TestAppBuilder::new()
.with_route("/test", |_req| async {
Ok(HttpResponse::ok().with_body(b"OK".to_vec()))
})
.build();
let client = app.client();
let response = client.get("/test").await;
assert_eq!(response.status(), Some(200));Auto Trait Implementations§
impl !RefUnwindSafe for TestApp
impl !UnwindSafe for TestApp
impl Freeze for TestApp
impl Send for TestApp
impl Sync for TestApp
impl Unpin for TestApp
impl UnsafeUnpin for TestApp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Injectable for T
impl<T> Injectable for T
Source§fn type_id_of() -> TypeIdwhere
Self: Sized,
fn type_id_of() -> TypeIdwhere
Self: Sized,
Returns the TypeId of this type (for internal use)
Source§fn type_name_of() -> &'static strwhere
Self: Sized,
fn type_name_of() -> &'static strwhere
Self: Sized,
Returns the type name for debugging