From bc91fcc0304a0a24effc1d34c9a4a3c511ac1e03 Mon Sep 17 00:00:00 2001 From: Adam Fowler Date: Wed, 27 Dec 2023 18:49:45 +0100 Subject: [PATCH] Update for addServices api change --- .../HummingbirdFluentTests/FluentTests.swift | 2 +- .../HummingbirdFluentTests/PersistTests.swift | 26 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Tests/HummingbirdFluentTests/FluentTests.swift b/Tests/HummingbirdFluentTests/FluentTests.swift index e805334..b21c543 100644 --- a/Tests/HummingbirdFluentTests/FluentTests.swift +++ b/Tests/HummingbirdFluentTests/FluentTests.swift @@ -93,7 +93,7 @@ final class FluentTests: XCTestCase { .first() } var app = HBApplication(responder: router.buildResponder()) - app.addService(fluent) + app.addServices(fluent) try await app.test(.live) { client in let planet = Planet(name: "Saturn") let id = try await client.XCTExecute( diff --git a/Tests/HummingbirdFluentTests/PersistTests.swift b/Tests/HummingbirdFluentTests/PersistTests.swift index 0768e2f..8f44a34 100644 --- a/Tests/HummingbirdFluentTests/PersistTests.swift +++ b/Tests/HummingbirdFluentTests/PersistTests.swift @@ -59,9 +59,9 @@ final class PersistTests: XCTestCase { var logger = Logger(label: "FluentTests") logger.logLevel = .trace let fluent = HBFluent(logger: logger) - let (router, _) = try await createRouter(fluent: fluent) + let (router, persist) = try await createRouter(fluent: fluent) var app = HBApplication(responder: router.buildResponder()) - app.addService(fluent) + app.addServices(fluent, persist) try await app.test(.live) { client in let tag = UUID().uuidString try await client.XCTExecute(uri: "/persist/\(tag)", method: .put, body: ByteBufferAllocator().buffer(string: "Persist")) { _ in } @@ -83,7 +83,7 @@ final class PersistTests: XCTestCase { return .ok } var app = HBApplication(responder: router.buildResponder()) - app.addService(fluent) + app.addServices(fluent, persist) try await app.test(.live) { client in let tag = UUID().uuidString try await client.XCTExecute(uri: "/create/\(tag)", method: .put, body: ByteBufferAllocator().buffer(string: "Persist")) { _ in } @@ -108,7 +108,7 @@ final class PersistTests: XCTestCase { return .ok } var app = HBApplication(responder: router.buildResponder()) - app.addService(fluent) + app.addServices(fluent, persist) try await app.test(.live) { client in let tag = UUID().uuidString try await client.XCTExecute(uri: "/create/\(tag)", method: .put, body: ByteBufferAllocator().buffer(string: "Persist")) { response in @@ -122,9 +122,9 @@ final class PersistTests: XCTestCase { func testSetTwice() async throws { let fluent = HBFluent(logger: Logger(label: "FluentTests")) - let (router, _) = try await createRouter(fluent: fluent) + let (router, persist) = try await createRouter(fluent: fluent) var app = HBApplication(responder: router.buildResponder()) - app.addService(fluent) + app.addServices(fluent, persist) try await app.test(.live) { client in let tag = UUID().uuidString @@ -141,9 +141,9 @@ final class PersistTests: XCTestCase { func testExpires() async throws { let fluent = HBFluent(logger: Logger(label: "FluentTests")) - let (router, _) = try await createRouter(fluent: fluent) + let (router, persist) = try await createRouter(fluent: fluent) var app = HBApplication(responder: router.buildResponder()) - app.addService(fluent) + app.addServices(fluent, persist) try await app.test(.live) { client in let tag1 = UUID().uuidString @@ -184,7 +184,7 @@ final class PersistTests: XCTestCase { return value?.buffer } var app = HBApplication(responder: router.buildResponder()) - app.addService(fluent) + app.addServices(fluent, persist) try await app.test(.live) { client in let tag = UUID().uuidString @@ -198,9 +198,9 @@ final class PersistTests: XCTestCase { func testRemove() async throws { let fluent = HBFluent(logger: Logger(label: "FluentTests")) - let (router, _) = try await createRouter(fluent: fluent) + let (router, persist) = try await createRouter(fluent: fluent) var app = HBApplication(responder: router.buildResponder()) - app.addService(fluent) + app.addServices(fluent, persist) try await app.test(.live) { client in let tag = UUID().uuidString try await client.XCTExecute(uri: "/persist/\(tag)", method: .put, body: ByteBufferAllocator().buffer(string: "ThisIsTest1")) { _ in } @@ -213,9 +213,9 @@ final class PersistTests: XCTestCase { func testExpireAndAdd() async throws { let fluent = HBFluent(logger: Logger(label: "FluentTests")) - let (router, _) = try await createRouter(fluent: fluent) + let (router, persist) = try await createRouter(fluent: fluent) var app = HBApplication(responder: router.buildResponder()) - app.addService(fluent) + app.addServices(fluent, persist) try await app.test(.live) { client in let tag = UUID().uuidString try await client.XCTExecute(uri: "/persist/\(tag)/0", method: .put, body: ByteBufferAllocator().buffer(string: "ThisIsTest1")) { _ in }