refactor: allow testing of mocked providers via AuthRegistry creation, avoid creation of responses in auth

This commit is contained in:
Ryan Walters
2025-09-19 11:50:25 -05:00
parent 4a041a7695
commit 76985f6390
9 changed files with 89 additions and 33 deletions

View File

@@ -26,7 +26,7 @@ pub struct TestContext {
}
#[builder]
pub async fn test_context(use_database: bool) -> TestContext {
pub async fn test_context(use_database: bool, auth_registry: Option<AuthRegistry>) -> TestContext {
CRYPTO_INIT.call_once(|| {
rustls::crypto::ring::default_provider()
.install_default()
@@ -74,7 +74,7 @@ pub async fn test_context(use_database: bool) -> TestContext {
};
// Create auth registry
let auth = AuthRegistry::new(&config).expect("Failed to create auth registry");
let auth = auth_registry.unwrap_or_else(|| AuthRegistry::new(&config).expect("Failed to create auth registry"));
// Create app state
let notify = Arc::new(Notify::new());