Skip to content

Commit a23acd0

Browse files
Renamed .mocked to .mockedConfiguration
1 parent 0b4fe1d commit a23acd0

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Sources/WebPushTesting/VAPIDConfiguration+Testing.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ import WebPush
1212

1313
extension VAPID.Configuration {
1414
/// A mocked configuration useful when testing with the library, since the mocked manager doesn't make use of it anyways.
15-
public static let mocked = VAPID.Configuration(key: .mockedKey1, contactInformation: .email("[email protected]"))
15+
public static let mockedConfiguration = VAPID.Configuration(key: .mockedKey1, contactInformation: .email("[email protected]"))
1616
}

Sources/WebPushTesting/WebPushManager+Testing.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extension WebPushManager {
2323
/// - messageHandler: A handler to receive messages or throw errors.
2424
/// - Returns: A new manager suitable for mocking.
2525
public static func makeMockedManager(
26-
vapidConfiguration: VAPID.Configuration = .mocked,
26+
vapidConfiguration: VAPID.Configuration = .mockedConfiguration,
2727
// TODO: Add networkConfiguration for proxy, number of simultaneous pushes, etc…
2828
logger: Logger? = nil,
2929
messageHandler: @escaping @Sendable (

Tests/WebPushTests/WebPushManagerTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ struct WebPushManagerTests {
9090

9191
/// This is needed to cover the `uniquingKeysWith` safety call completely.
9292
@Test func managerConstructsAValidKeyLookupFromQuestionableConfiguration() async throws {
93-
var configuration = VAPID.Configuration.mocked
93+
var configuration = VAPID.Configuration.mockedConfiguration
9494
configuration.unsafeUpdateKeys(primaryKey: .mockedKey1, keys: [.mockedKey1], deprecatedKeys: [.mockedKey1])
9595
let manager = WebPushManager(vapidConfiguration: configuration)
9696
#expect(await manager.vapidKeyLookup == [.mockedKeyID1 : .mockedKey1])
@@ -105,7 +105,7 @@ struct WebPushManagerTests {
105105

106106
@Suite("VAPID Key Retrieval") struct VAPIDKeyRetrieval {
107107
@Test func retrievesPrimaryKey() async {
108-
let manager = WebPushManager(vapidConfiguration: .mocked)
108+
let manager = WebPushManager(vapidConfiguration: .mockedConfiguration)
109109
#expect(manager.nextVAPIDKeyID == .mockedKeyID1)
110110
await withThrowingTaskGroup(of: Void.self) { group in
111111
group.addTask {
@@ -116,7 +116,7 @@ struct WebPushManagerTests {
116116
}
117117

118118
@Test func alwaysRetrievesPrimaryKey() async throws {
119-
var configuration = VAPID.Configuration.mocked
119+
var configuration = VAPID.Configuration.mockedConfiguration
120120
try configuration.updateKeys(primaryKey: .mockedKey1, keys: [.mockedKey2], deprecatedKeys: [.mockedKey3])
121121
let manager = WebPushManager(vapidConfiguration: configuration)
122122
for _ in 0..<100_000 {
@@ -131,7 +131,7 @@ struct WebPushManagerTests {
131131
}
132132

133133
@Test func retrievesFallbackKeys() async throws {
134-
var configuration = VAPID.Configuration.mocked
134+
var configuration = VAPID.Configuration.mockedConfiguration
135135
try configuration.updateKeys(primaryKey: nil, keys: [.mockedKey1, .mockedKey2])
136136
let manager = WebPushManager(vapidConfiguration: configuration)
137137
var keyCounts: [VAPID.Key.ID : Int] = [:]
@@ -148,7 +148,7 @@ struct WebPushManagerTests {
148148
}
149149

150150
@Test func neverRetrievesDeprecatedKeys() async throws {
151-
var configuration = VAPID.Configuration.mocked
151+
var configuration = VAPID.Configuration.mockedConfiguration
152152
try configuration.updateKeys(primaryKey: nil, keys: [.mockedKey1, .mockedKey2], deprecatedKeys: [.mockedKey3])
153153
let manager = WebPushManager(vapidConfiguration: configuration)
154154
for _ in 0..<100_000 {
@@ -163,7 +163,7 @@ struct WebPushManagerTests {
163163
}
164164

165165
@Test func keyStatus() async throws {
166-
var configuration = VAPID.Configuration.mocked
166+
var configuration = VAPID.Configuration.mockedConfiguration
167167
try configuration.updateKeys(primaryKey: .mockedKey1, keys: [.mockedKey2], deprecatedKeys: [.mockedKey3])
168168
let manager = WebPushManager(vapidConfiguration: configuration)
169169
#expect(manager.keyStatus(for: .mockedKeyID1) == .valid)

0 commit comments

Comments
 (0)