42 lines
929 B
Rust
42 lines
929 B
Rust
![]() |
use gb_testing::integration::{IntegrationTest, IntegrationTestCase};
|
||
|
use anyhow::Result;
|
||
|
use async_trait::async_trait;
|
||
|
|
||
|
struct ApiTest {
|
||
|
test: IntegrationTest,
|
||
|
}
|
||
|
|
||
|
#[async_trait]
|
||
|
impl IntegrationTestCase for ApiTest {
|
||
|
async fn setup(&mut self) -> Result<()> {
|
||
|
// Setup test environment
|
||
|
Ok(())
|
||
|
}
|
||
|
|
||
|
async fn execute(&self) -> Result<()> {
|
||
|
// Test API endpoints
|
||
|
Ok(())
|
||
|
}
|
||
|
|
||
|
async fn teardown(&mut self) -> Result<()> {
|
||
|
// Cleanup test environment
|
||
|
Ok(())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#[tokio::test]
|
||
|
async fn test_api_integration() -> Result<()> {
|
||
|
let mut test = ApiTest {
|
||
|
test: IntegrationTest {
|
||
|
docker: testcontainers::clients::Cli::default(),
|
||
|
db_pool: sqlx::PgPool::connect("postgres://postgres:postgres@localhost:5432/test").await?,
|
||
|
},
|
||
|
};
|
||
|
|
||
|
test.setup().await?;
|
||
|
test.execute().await?;
|
||
|
test.teardown().await?;
|
||
|
|
||
|
Ok(())
|
||
|
}
|