@@ -112,6 +112,7 @@ class ApiTests: AppTestCase {
112112 func test_search_unauthenticated( ) async throws {
113113 try await withDependencies {
114114 $0. environment. apiSigningKey = { " secret " }
115+ $0. environment. dbId = { nil }
115116 } operation: {
116117 // MUT
117118 try await app. test ( . GET, " api/search?query=test " ,
@@ -344,6 +345,7 @@ class ApiTests: AppTestCase {
344345 // Ensure unauthenticated access raises a 401
345346 try await withDependencies {
346347 $0. environment. builderToken = { " secr3t " }
348+ $0. environment. dbId = { nil }
347349 } operation: {
348350 // setup
349351 let p = try await savePackage ( on: app. db, " 1 " )
@@ -640,6 +642,7 @@ class ApiTests: AppTestCase {
640642 func test_post_docReport_non_existing_build( ) async throws {
641643 try await withDependencies {
642644 $0. environment. builderToken = { " secr3t " }
645+ $0. environment. dbId = { nil }
643646 } operation: {
644647 // setup
645648 let nonExistingBuildId = UUID ( )
@@ -665,6 +668,7 @@ class ApiTests: AppTestCase {
665668 func test_post_docReport_unauthenticated( ) async throws {
666669 try await withDependencies {
667670 $0. environment. builderToken = { " secr3t " }
671+ $0. environment. dbId = { nil }
668672 } operation: {
669673 // setup
670674 let p = try await savePackage ( on: app. db, " 1 " )
@@ -978,6 +982,7 @@ class ApiTests: AppTestCase {
978982 func test_package_collections_packageURLs_limit( ) throws {
979983 try withDependencies {
980984 $0. environment. apiSigningKey = { " secret " }
985+ $0. environment. dbId = { nil }
981986 } operation: {
982987 let dto = API . PostPackageCollectionDTO (
983988 // request 21 urls - this should raise a 400
@@ -999,6 +1004,7 @@ class ApiTests: AppTestCase {
9991004 func test_package_collections_unauthorized( ) throws {
10001005 try withDependencies {
10011006 $0. environment. apiSigningKey = { " secret " }
1007+ $0. environment. dbId = { nil }
10021008 } operation: {
10031009 // MUT - happy path
10041010 let body : ByteBuffer = . init( string: """
@@ -1042,6 +1048,7 @@ class ApiTests: AppTestCase {
10421048 func test_packages_get( ) async throws {
10431049 try await withDependencies {
10441050 $0. environment. apiSigningKey = { " secret " }
1051+ $0. environment. dbId = { nil }
10451052 } operation: {
10461053 let owner = " owner "
10471054 let repo = " repo "
0 commit comments