Skip to content

Commit

Permalink
Update for addServices api change
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Dec 27, 2023
1 parent a4779fd commit bc91fcc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Tests/HummingbirdFluentTests/FluentTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
26 changes: 13 additions & 13 deletions Tests/HummingbirdFluentTests/PersistTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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 }
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 }
Expand All @@ -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 }
Expand Down

0 comments on commit bc91fcc

Please sign in to comment.